[OpenAFS-devel] OpenAFS and OpenSolaris

Klas Heggemann klas@nada.kth.se
Thu, 18 Jun 2009 18:42:58 +0200


--Apple-Mail-4-748206700
Content-Type: text/plain;
	charset=US-ASCII;
	format=flowed;
	delsp=yes
Content-Transfer-Encoding: 7bit


here is my diff for src/rx/SOLARIS/rx_knet.c to build
a working module for newer opensolaris builds. (build > 105)

Code is #ifdef'd, so you need to define USE_SOCKPARAMS
somewhere, perhaps via configure.  Ideally this would by dynamic in  
some way,
and not compiled into the module




--Apple-Mail-4-748206700
Content-Disposition: attachment;
	filename=opensolaris.patch
Content-Type: application/octet-stream;
	x-unix-mode=0644;
	name="opensolaris.patch"
Content-Transfer-Encoding: 7bit

*** src/rx/SOLARIS/rx_knet.c	2009-06-18 18:32:06.766158285 +0200
--- src/rx/SOLARIS/rx_knet.c.ORIG	2009-06-18 18:39:12.110026731 +0200
***************
*** 50,68 ****
  /*
   * Function pointers for kernel socket routines
   */
- 
- #ifdef USE_SOCKPARAMS
  struct sonode *(*sockfs_socreate)
!    (struct sockparams *, int, int, int, int,  int *) = NULL; 
! struct vnode *(*sockfs_solookup)
!    (int, int, int, struct sockparams **) = NULL;
! #else
  struct vnode *(*sockfs_solookup)
!    (int, int, int, char *, int *) = NULL;
! struct sonode *(*sockfs_socreate)
!    (vnode_t *, int, int, int, int, struct sonode *, int *) = NULL;
! #endif
! 
  int (*sockfs_sobind)
    (struct sonode *, struct sockaddr *, int, int, int) = NULL;
  int (*sockfs_sorecvmsg)
--- 50,59 ----
  /*
   * Function pointers for kernel socket routines
   */
  struct sonode *(*sockfs_socreate)
!   (vnode_t *, int, int, int, int, struct sonode *, int *) = NULL;
  struct vnode *(*sockfs_solookup)
!   (int, int, int, char *, int *) = NULL;
  int (*sockfs_sobind)
    (struct sonode *, struct sockaddr *, int, int, int) = NULL;
  int (*sockfs_sorecvmsg)
***************
*** 331,341 ****
  osi_socket *
  rxk_NewSocketHost(afs_uint32 ahost, short aport)
  {
- #ifdef USE_SOCKPARAMS
-     struct sockparams *sp = NULL;
- #else
      vnode_t *accessvp;
- #endif
      struct sonode *so;
      struct sockaddr_in addr;
      int error;
--- 322,328 ----
***************
*** 394,417 ****
      }
  #endif
  
- #ifdef USE_SOCKPARAMS
-     sockfs_solookup(AF_INET, SOCK_DGRAM, 0, &sp);
-     if (sp == NULL) {
-       printf("solookup failed\m");
- 	return NULL;
-     }
-     so = sockfs_socreate(sp, AF_INET, SOCK_DGRAM, 0, SOV_STREAM, 
- 			 &error);
- #else
      accessvp = sockfs_solookup(AF_INET, SOCK_DGRAM, 0, "/dev/udp", &error);
      if (accessvp == NULL) {
-       printf("solookup failed\m");
  	return NULL;
      }
      so = sockfs_socreate(accessvp, AF_INET, SOCK_DGRAM, 0, SOV_STREAM, NULL,
  			 &error);
- #endif
- 
      if (so == NULL) {
  	return NULL;
      }
--- 381,393 ----
      }
  #endif
  
      accessvp = sockfs_solookup(AF_INET, SOCK_DGRAM, 0, "/dev/udp", &error);
      if (accessvp == NULL) {
  	return NULL;
      }
+ 
      so = sockfs_socreate(accessvp, AF_INET, SOCK_DGRAM, 0, SOV_STREAM, NULL,
  			 &error);
      if (so == NULL) {
  	return NULL;
      }

--Apple-Mail-4-748206700
Content-Type: text/plain;
	charset=US-ASCII;
	format=flowed
Content-Transfer-Encoding: 7bit





/Klas




--Apple-Mail-4-748206700--