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