[klibc] Re: [PATCH] fcntl takes unsigned long as third arg
H. Peter Anvin
hpa at zytor.com
Wed Aug 25 13:16:49 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 *)
>
Hm. POSIX wants signed long; glibc has int fcntl(int, int, ...), since
it needs to take either a signed long or a struct flock. Probably we
need to do something similar to the hack we did for open(2).
-hpa
More information about the klibc
mailing list