From f0a52e168c0f3495c7b168a63c149116219e3c1b Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Wed, 21 Jul 2010 11:34:39 -0500 Subject: [PATCH] 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 --- src/afs/SOLARIS/osi_inode.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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; -- 2.39.5