nrelease - fix/improve livecd
[dragonfly.git] / lib / libc / sys / pselect.2
1 .\"
2 .\" Copyright 2002 Massachusetts Institute of Technology
3 .\"
4 .\" Permission to use, copy, modify, and distribute this software and
5 .\" its documentation for any purpose and without fee is hereby
6 .\" granted, provided that both the above copyright notice and this
7 .\" permission notice appear in all copies, that both the above
8 .\" copyright notice and this permission notice appear in all
9 .\" supporting documentation, and that the name of M.I.T. not be used
10 .\" in advertising or publicity pertaining to distribution of the
11 .\" software without specific, written prior permission.  M.I.T. makes
12 .\" no representations about the suitability of this software for any
13 .\" purpose.  It is provided "as is" without express or implied
14 .\" warranty.
15 .\"
16 .\" THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''.  M.I.T. DISCLAIMS
17 .\" ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE,
18 .\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
19 .\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT
20 .\" SHALL M.I.T. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 .\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
23 .\" USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 .\" ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25 .\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
26 .\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 .\" SUCH DAMAGE.
28 .\"
29 .Dd November 15, 2019
30 .Dt PSELECT 2
31 .Os
32 .Sh NAME
33 .Nm pselect
34 .Nd synchronous I/O multiplexing a la POSIX.1g
35 .Sh LIBRARY
36 .Lb libc
37 .Sh SYNOPSIS
38 .In sys/select.h
39 .Ft int
40 .Fo pselect
41 .Fa "int nfds"
42 .Fa "fd_set * restrict readfds"
43 .Fa "fd_set * restrict writefds"
44 .Fa "fd_set * restrict exceptfds"
45 .Fa "const struct timespec * restrict timeout"
46 .Fa "const sigset_t * restrict newsigmask"
47 .Fc
48 .Sh DESCRIPTION
49 The
50 .Fn pselect
51 function was introduced by
52 .St -p1003.1g-2000
53 as a slightly stronger version of
54 .Xr select 2 .
55 The
56 .Fa nfds , readfds , writefds ,
57 and
58 .Fa exceptfds
59 arguments are all identical to the analogous arguments of
60 .Fn select .
61 The
62 .Fa timeout
63 argument in
64 .Fn pselect
65 points to a
66 .Vt "const struct timespec"
67 rather than the (modifiable)
68 .Vt "struct timeval"
69 used by
70 .Fn select ;
71 as in
72 .Fn select ,
73 a null pointer may be passed to indicate that
74 .Fn pselect
75 should wait indefinitely.
76 Finally,
77 .Fa newsigmask
78 specifies a signal mask which is set while waiting for input.
79 When
80 .Fn pselect
81 returns, the original signal mask is restored.
82 .Pp
83 See
84 .Xr select 2
85 for a more detailed discussion of the semantics of this interface, and
86 for macros used to manipulate the
87 .Vt "fd_set"
88 data type.
89 .Sh RETURN VALUES
90 The
91 .Fn pselect
92 function returns the same values and under the same conditions as
93 .Fn select .
94 .Sh ERRORS
95 The
96 .Fn pselect
97 function may fail for any of the reasons documented for
98 .Xr select 2
99 and (if a signal mask is provided)
100 .Xr sigprocmask 2 .
101 .Sh SEE ALSO
102 .Xr kqueue 2 ,
103 .Xr poll 2 ,
104 .Xr select 2 ,
105 .Xr sigprocmask 2
106 .Sh STANDARDS
107 The
108 .Fn pselect
109 function conforms to
110 .St -p1003.1-2001 .
111 .Sh HISTORY
112 The
113 .Fn pselect
114 function first appeared in
115 .Dx 1.11 .
116 .Sh AUTHORS
117 This manual page was originally written by
118 .An Garrett Wollman Aq Mt wollman@FreeBSD.org
119 for
120 .Fx
121 and later modified for
122 .Dx .