select.2: Remove some ancient information about pre-POSIX types for 'timeout'

The discussion about pre-POSIX types for 'timeval' and 'timespec'
is rather old, and these days serves mainly to complicate the
page. Remove it.

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

View File

@ -267,32 +267,34 @@ with the desired
.IR sigmask ,
avoiding the race.)
.SS The timeout
The time structures involved are defined in
.I <sys/time.h>
and look like
The
.I timeout
argument for
.BR select ()
is a structure of the following type:
.PP
.in +4n
.EX
struct timeval {
long tv_sec; /* seconds */
long tv_usec; /* microseconds */
time_t tv_sec; /* seconds */
suseconds_t tv_usec; /* microseconds */
};
.EE
.in
.PP
and
The corresponding argument for
.BR pselect ()
has the following type:
.PP
.in +4n
.EX
struct timespec {
long tv_sec; /* seconds */
long tv_nsec; /* nanoseconds */
time_t tv_sec; /* seconds */
long tv_nsec; /* nanoseconds */
};
.EE
.in
.PP
(However, see below on the POSIX.1 versions.)
.PP
Some code calls
.BR select ()
with all three sets empty,
@ -444,33 +446,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 the types involved, the classical situation is that
the two fields of a
.I timeval
structure are typed as
.I long
(as shown above), and the structure is defined in
.IR <sys/time.h> .
The POSIX.1 situation is
.PP
.in +4n
.EX
struct timeval {
time_t tv_sec; /* seconds */
suseconds_t tv_usec; /* microseconds */
};
.EE
.in
.PP
where the structure is defined in
.I <sys/select.h>
and the data types
.I time_t
and
.I suseconds_t
are defined in
.IR <sys/types.h> .
.PP
Concerning prototypes, the classical situation is that one should
include
.I <time.h>