PSELECT(2)
π PSELECT(2) π
okay bestie, gather round, because today we're talking about pselect β the system call that does synchronous I/O multiplexing a la POSIX.1g β¨ she's giving select(2) but with a glow-up, and honestly? we're obsessed. this lives in section 2 of the System Calls Manual, so you know it's the real deal π
πΈ NAME πΈ
pselect β synchronous I/O multiplexing a la POSIX.1g π
π LIBRARY π
Standard C Library (libc, -lc) π«Ά
β¨ SYNOPSIS β¨
#include <sys/select.h>
int
pselect(int nfds, fd_set * restrict readfds, fd_set * restrict writefds,
fd_set * restrict exceptfds,
const struct timespec * restrict timeout,
const sigset_t * restrict newsigmask);
π DESCRIPTION π
so the tea is: pselect() was introduced by IEEE Std 1003.1g-2000 ("POSIX.1") as a slightly stronger version of select(2). like, select but she went to the gym πͺ
the nfds, readfds, writefds, and exceptfds arguments are all identical to the analogous arguments of select(). no notes, same energy π―
the timeout argument in pselect() points to a const struct timespec rather than the (modifiable) struct timeval used by select(). and just like in select(), a null pointer may be passed to indicate that pselect() should wait indefinitely β girl will wait forever, no cap π
finally, newsigmask specifies a signal mask which is set while waiting for input. and when pselect() returns, the original signal mask is restored. she always puts things back where she found them, queen behavior π
head over toselect(2)for a more detailed discussion of the semantics of this interface, and for the macros used to manipulate thefd_setdata type π¦
π RETURN VALUES π
the pselect() function returns the same values and under the same conditions as select(). that's it, that's the whole vibe β¨
π ERRORS π
the pselect() function may fail for any of the reasons documented for select(2) and (if a signal mask is provided) sigprocmask(2). so like, check both receipts bestie π
π SEE ALSO π
β STANDARDS β
the pselect() function conforms to IEEE Std 1003.1-2001 ("POSIX.1"). certified, licensed, iconic π
π°οΈ HISTORY π°οΈ
the pselect() function first appeared in FreeBSD 5.0. a legend was born β¨
π«Ά AUTHORS π«Ά
the first implementation of pselect() function and this manual page were written by Garrett Wollman <wollman@FreeBSD.org> π
and that's the whole page bestie!! this lil beauty is from the Debian crew, dated August 16, 2013, and yeah she's still rocking the PSELECT(2) title like the main character she is ππ mwah, go multiplex something π¦πΈ
π¦ where this page comes from
- debian bookworm: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- debian trixie: freebsd-manpages 12.2-2 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu jammy: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu noble: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu questing: freebsd-manpages 12.2-2
- ubuntu resolute: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu stonking: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- Copyright 2002 Massachusetts Institute of Technology
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms