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 <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
* 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;