[klibc] Re: [PATCH] fcntl takes unsigned long as third arg
H. Peter Anvin
hpa at zytor.com
Wed Aug 25 13:48:43 PDT 2004
Olaf Hering wrote:
> The syscall defines only a signed long, but the kernel expects unsigned.
> No idea if this is intentional or if it breaks anything. I just had to
> look why gcc complained about pointer to int conversions.
> diff -p -purN klibc-0.168/klibc/SYSCALLS.def klibc-0.168.fcntl/klibc/SYSCALLS.def
> --- klibc-0.168/klibc/SYSCALLS.def 2004-08-03 03:04:30.000000000 +0200
> +++ klibc-0.168.fcntl/klibc/SYSCALLS.def 2004-08-25 15:32:30.000000000 +0200
> @@ -120,7 +120,7 @@ int close(int)
> <32> int _llseek::__llseek(int, unsigned long, unsigned long, off_t *, int)
> int dup(int)
> int dup2(int, int)
> -int fcntl(int, int, long)
> +int fcntl(int, int, unsigned long)
> int ioctl(int, int, void *)
> int flock(int, int)
> int _newselect,select::select(int, fd_set *, fd_set *, fd_set *, struct timeval *)
Bleah. fcntl() is a can of worms. Not only is it varadic, but it has a
whole different set of operations for "struct flock64".
I really hate multiplexed system calls. I *really, really* hate
multiplexed API calls.
More information about the klibc