bug-gnulib
[Top][All Lists]
Advanced

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

Re: poll: enable argument check


From: Paul Eggert
Subject: Re: poll: enable argument check
Date: Sat, 22 Apr 2017 18:53:19 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0

Bruno Haible wrote:
TYPE_MAXIMUM (nfds_t) / 2 is good for a quick check against an out-of-bounds 
nfd.
POSIX [1] says that nfd is out-of-bounds if it is > getdtablesize().

OK, but getdtablesize returns 'int' so the 'poll' code should compare to INT_MAX rather than to an expression that would not be appropriate on (admittedly weird) platforms where nfds_t differs in width from 'int'. Also, that comment is still confusing. How about the attached?

Attachment: 0001-poll-improve-fast-check-for-out-of-range-NFD.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]