|
Home About Us A-Z Index Search * Contact Us Register Login Press ShopThe Open Brand -- Problem Reporting and Interpretations System |
Problem Report 1587 Details
Show help | Quick Search | Submit a Test Suite Support Request | Click here to view your privileges
This page provides all information on Problem Report 1587.
Report 1587 Actions
Problem Report Number 1587 Submitter's Classification Specification problem State Resolved Resolution Permanent Interpretation (PIN) Problem Resolution ID PIN.X.0144 Raised 1995-11-03 08:00 Updated 2003-03-13 08:00 Published 1995-11-13 08:00 Product Standard Internationalised System Calls and Libraries Extended (UNIX 95) Certification Program The Open Brand certification program Test Suite VSU version 4.1.0 Test Identification CAPI.os/ioprim/select 21 22 Specification System Interfaces and Libraries Issue 4 Version 2 Location in Spec See Problem Text Problem Summary PIN4U.00010 select should not fail if called with nfds == FD_SETSIZE. Problem Text
We feel that there is a problem with the description of the
select() function as described below:
In the <sys/time.h> description, you find this statement:
"FD_SETSIZE
Maximum number of file descriptors in an fd_set structure."
We understand this as the "number" of file descriptors we can use,
indicating a "range" of file descriptors from 0 to FD_SETSIZE-1 since
0 is a valid file or socket descriptor.
In the select() DESCRIPTION, you find the statement:
"The nfds argument specifies the range of file descriptors to be
tested. The select() function tests file descriptors in the range
of 0 to nfds-1."
It is clear from the text that if nfds == FD_SETSIZE, the test
should go from 0 to FD_SETSIZE-1.
This point is further enforced by the following statement found in
the 7th paragraph of the DESCRIPTION:
"For each file descriptor less than nfds, the corresponding
bit will be set on successful completion if it was set on
input and the associated condition is true for that descriptor."
However, the select() ERRORS section states
"EINVAL The nfds argument is less than 0, or greater than or equal
to FD_SETSIZE."
We believe this contradicts 1 and 2 above. Since nfds is the
number of file descriptors to test (range from 0 to nfds-1) and
FD_SETSIZE is defined as the maximum number of file descriptors in an
fd_set structure (indicating file descriptors 0 thru FD_SETSIZE-1 are
available), then we need be able to specify FD_SETSIZE as the nfds
value so that file descriptors in the range 0 to FD_SETSIZE-1 are
tested.
Also note that the BSD documentation for select() says exactly
what XPG4 says, "greater than or equal to", but the BSD
supplemental documentation [Advanced 43.BSD IPC Tutorial] say
that select(FD_SETSIZE, X, Y, Z, foo) should work! But the
4.3BSD IPC Tutorial has sample code that uses FD_SETSIZE as the
first argument.
We think that 3. above should read:
"EINVAL The nfds argument is less than or equal to 0, or greater
than FD_SETSIZE."Test Output
10|2060 /tset/CAPIbase/fselect/fselect21 19:29:57|TC Start, scenario ref
15|2042 1.10 1|TCM Start
400|2042 21 1 19:30:00|IC Start
200|2042 1 19:30:00|TP Start
520|2042 1 93782048 1 1|SPEC1170TESTSUITE CASE 21
520|2042 1 93782048 1 2|A call to int select(int nfds, fd_set *readfds,
520|2042 1 93782048 1 3|*writefds, fd_set *exceptfds, const struct timev
520|2042 1 93782048 1 4|*timeout) when a timeout is specified shall not
520|2042 1 93782048 1 5|any pending timers setup by alarm(), ualarm() or
520|2042 1 93782048 1 6|setitimer().
520|2042 1 130613270 1 1|PREP: Create fifo
520|2042 1 130613270 1 2|PREP: Find FIFO buffer size
520|2042 1 130613270 1 3|PREP: Insure O_NONBLOCK is set
520|2042 1 130613270 1 4|PREP: Fill FIFO
520|2042 1 130613270 1 5|PREP: writefds references write end of fifo
520|2042 1 130613270 1 6|PREP: Set up to catch the SIGALRM signal
520|2042 1 130613270 1 7|PREP: Set up SIGALRM using ualarm
520|2042 1 130613270 1 8|PREP: Call select with no events pending to for
ut
520|2042 1 130613270 1 9|ERROR: select failed, errno = 121(EINVAL - Inva
220|2043 1 1 19:30:11|FAIL
410|2043 22 1 19:30:11|IC End
80|2061 0 19:30:12|TC End
10|2061 /tset/CAPIbase/fselect/fselect22 19:30:08|TC Start, scenario ref
15|2043 1.10 1|TCM Start
400|2043 22 1 19:30:11|IC Start
200|2043 1 19:30:11|TP Start
520|2043 1 93847584 1 1|SPEC1170TESTSUITE CASE 22
520|2043 1 93847584 1 2|EBADF in errno and return -1 on a call to int
520|2043 1 93847584 1 3|select(int nfds, fd_set *readfds, fd_set *writef
520|2043 1 93847584 1 4|fd_set *exceptfds, const struct timeval *timeout
520|2043 1 93847584 1 5|one or more of the file descriptor sets specify
520|2043 1 93847584 1 6|descriptor that is not a valid open file descrip
520|2043 1 130744342 1 1|PREP: Create temporary file
520|2043 1 130744342 1 2|PREP: Close file to get invalid file descriptor
520|2043 1 130744342 1 3|CLEANUP: Remove temporary file
520|2043 1 130744342 1 4|TEST: Call to select on readfds returns -1
520|2043 1 130744342 1 5|TEST: EBADF in errno
520|2043 1 130744342 1 6|ERROR: select set errno to 121(EINVAL - Invalid
220|2043 1 1 19:30:11|FAIL
410|2043 22 1 19:30:11|IC End
80|2061 0 19:30:12|TC EndReview Information
Review Type TSMA Review Start Date null Completed null Status Complete Review Recommendation No Resolution Given Review Response
A permanent interpretation is recommended.
VSU currently tests the behavior recommended above.
Review Type SA Review Start Date null Completed null Status Complete Review Resolution Permanent Interpretation (PIN) Review Conclusion
A Permanent Interpretation is granted.
Problem Reporting System Options:
- View Report 1587
- List All PRs
- Search Reports
- Email the System Administrator
- View the The Open Brand Interpretations Database User Manual
Contact the Certification Authority