Re: fcntl error

From: Andreas Schwab
Date: Thu Mar 18 2004 - 12:50:42 EST


Linus Torvalds <torvalds@xxxxxxxx> writes:

> On Thu, 18 Mar 2004, David Howells wrote:
>>
>> The attached patch fixes a minor problem with fcntl.
>
> I agree that it is a cleanup, but I disagree on the "problem" part.
>
>> get_close_on_exec() uses FD_ISSET() to determine the fd state. However,
>> FD_ISSET() does not return 0 or 1 on all archs. On some it returns 0 or non-0,
>> which is fine by POSIX.
>
> FD_ISSET() is broken if it returns anything but 0/1, in my not-so-humble
> opinion.

POSIX clearly says that _any_ non-zero value is ok, similar to the ctype.h
functions. Of course, the kernel can set different standards internally.

Andreas.

--
Andreas Schwab, SuSE Labs, schwab@xxxxxxx
SuSE Linux AG, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/