select.2: Remove details of historical #include requirements

The POSIX situation has been the norm for a long time now,
and including ancient details overcomplicates the page.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2020-02-18 09:34:20 +01:00
parent f0e902c3a1
commit a63fef4359
1 changed files with 1 additions and 24 deletions

View File

@ -41,14 +41,8 @@ select, pselect, FD_CLR, FD_ISSET, FD_SET, FD_ZERO \-
synchronous I/O multiplexing
.SH SYNOPSIS
.nf
/* According to POSIX.1-2001, POSIX.1-2008 */
.B #include <sys/select.h>
.PP
/* According to earlier standards */
.B #include <sys/time.h>
.B #include <sys/types.h>
.B #include <unistd.h>
.PP
.BI "int select(int " nfds ", fd_set *" readfds ", fd_set *" writefds ,
.BI " fd_set *" exceptfds ", struct timeval *" timeout );
.PP
@ -56,8 +50,6 @@ synchronous I/O multiplexing
.BI "int FD_ISSET(int " fd ", fd_set *" set );
.BI "void FD_SET(int " fd ", fd_set *" set );
.BI "void FD_ZERO(fd_set *" set );
.B #include <sys/select.h>
.PP
.BI "int pselect(int " nfds ", fd_set *" readfds ", fd_set *" writefds ,
.BI " fd_set *" exceptfds ", const struct timespec *" timeout ,
@ -446,18 +438,6 @@ in the main program.
or reading from a pipe that may be empty,
nonblocking I/O is used when reading from and writing to the pipe.)
.PP
Concerning prototypes, the classical situation is that one should
include
.I <time.h>
for
.BR select ().
The POSIX.1 situation is that one should include
.I <sys/select.h>
for
.BR select ()
and
.BR pselect ().
.PP
Under glibc 2.0,
.I <sys/select.h>
gives the wrong prototype for
@ -467,7 +447,6 @@ Under glibc 2.1 to 2.2.1, it gives
when
.B _GNU_SOURCE
is defined.
Since glibc 2.2.2, the requirements are as shown in the SYNOPSIS.
.\"
.SS Correspondence between select() and poll() notifications
Within the Linux kernel source,
@ -657,9 +636,7 @@ to a local variable and passing that variable to the system call.
.EX
#include <stdio.h>
#include <stdlib.h>
#include <sys/time.h>
#include <sys/types.h>
#include <unistd.h>
#include <sys/select.h>
int
main(void)