From: Andrew Deason Date: Wed, 21 Jul 2010 16:34:39 +0000 (-0500) Subject: libafs: fix IOPEN for amd64 solaris X-Git-Tag: openafs-devel-1_5_76~81 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=f0a52e168c0f3495c7b168a63c149116219e3c1b;p=packages%2Fo%2Fopenafs.git libafs: fix IOPEN for amd64 solaris Solaris afs_syscall_iopen was returning the fd in r_val2 for 64-bit architectures (for 5.7 and beyond). If we are little-endian, though, we want the return value in r_val1; otherwise we just always return fd 0. So, put the fd in r_val1 if we are little-endian. Change-Id: I8553c338625e9c50f846f4676b53ea8f054b7a73 Reviewed-on: http://gerrit.openafs.org/2457 Tested-by: Andrew Deason Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- diff --git a/src/afs/SOLARIS/osi_inode.c b/src/afs/SOLARIS/osi_inode.c index 0353d1854..0c1a60826 100644 --- a/src/afs/SOLARIS/osi_inode.c +++ b/src/afs/SOLARIS/osi_inode.c @@ -295,7 +295,13 @@ afs_syscall_iopen(dev, inode, usrmod, rvp, credp) * XXX We should set the fp to null since we don't need it in the icalls */ setf(fd, fp); -#ifdef AFS_SUN57_64BIT_ENV + + /* rvp->r_val{1,2} are really members into a union and are re-extracted + * later by solaris. If we're not 64-bit, they appear to just be the same + * thing, but on 64-bit they point to two different 32-bit locations that + * make up one 64-bit int; so on 64-bit big-endian we need to set the + * second one. */ +#if defined(AFS_SUN57_64BIT_ENV) && !defined(AFSLITTLE_ENDIAN) rvp->r_val2 = fd; #else rvp->r_val1 = fd;