syscall update
Steve Munroe
sjmunroe at us.ibm.com
Fri Oct 11 02:19:27 EST 2002
Ok it seems that most platforms, including PowerPC, implement fcntl by judt
including the i386 implmentation (,/sysdeps/unix/sysv/linux/i386/fcntl.c).
The implementation of fcntl is conditioned on __ASSUME_FCNTL64 (from
glibc's kernel_features.h) and __NR_fcntl64 (from the kernel's
include/asm/unistd.h).
I made sure that __ASSUME_FCNTL64 is not defined for PowerPC64, but the
kernel headers still define __NR_fcntl64.
In this case fcntl tries fcntl64 just once per 64-bit process. Since the
fcntl64 syscall fails with ENOSYS it sets the static variable
__have_no_fcntl64 to "true" and only calls fcntl after that.
This happens because __NR_fcntl64 is defined. Otherwise it only calls
__NR_fcntl.
If only the kernel did not define__NR_fcntl64 ... ;)
As the there is only one set of /usr/include files for both 32- and 64-bit
and the kernels ./asm and ./linux header get copied into /usr/include. The
32- and 64-bit unistd.h should be the same. So use something like:
#if !defined __powerpc64__
#define __NR_fcntl64 204
#endif
Anton Blanchard
<anton at samba.org> To: linuxppc64-dev at lists.linuxppc.org
Sent by: cc:
owner-linuxppc64-dev at lists.l Subject: Re: syscall update
inuxppc.org
10/09/02 06:08 AM
Hi,
Ive updated the 2.5 tree with the 64bit changes and glibc 2.3 is
working well. Steve here is the thing I was mentioning earlier, a
strace of a 64 bit app shows we try fcntl64 before dropping back to
fcntl:
fcntl64(3, F_GETFD) = -1 ENOSYS (Function not
implemented)
fcntl(3, F_GETFD) = 0
Anton
** Sent via the linuxppc64-dev mail list. See http://lists.linuxppc.org/
More information about the Linuxppc64-dev
mailing list