Re: fcntl for mingw

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Hash: SHA1

According to Bruno Haible on 12/11/2009 8:38 AM:
>> +  switch (action)
>> +    {
>> +    case F_DUPFD_CLOEXEC:
>> +      {
>> +        int target = va_arg (arg, int);
> Is the arg of type 'int' or 'long'? POSIX says it's an 'int'. But
> the Linux man page
>   <>
> says it's 'long' "in most cases", and indeed glibc's fcntl.c implementation
> uses a 'void *', that is, the same as a 'long'.

That's (hopefully) a bug in the Linux man page.  The return type is int,
and since the arg is an fd and the return type an fd, they had better be
the same type.  But all the same, I'm cc'ing the man page maintainer.

> It makes a difference on big-endian 64-bit platforms (SPARC64, PPC64),

No one writes fcntl(fd,F_DUPFD,1L), since that is contrary to POSIX; and
if fcntl(fd,F_DUPFD,1) doesn't work, then that is a bug in the kernel.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             ebb9@xxxxxxx
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at
Comment: Using GnuPG with Mozilla -

To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at

[Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Memory]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Photo]     [Yosemite]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]     [Linux Resources]

Add to Google Powered by Linux