2004-11-03 13:51:07 +00:00
|
|
|
.\" Hey Emacs! This file is -*- nroff -*- source.
|
|
|
|
.\"
|
|
|
|
.\" Copyright (C) 1997 Andries Brouwer (aeb@cwi.nl)
|
2007-09-20 06:52:22 +00:00
|
|
|
.\" and Copyright (C) 2006, Michael Kerrisk <mtk.manpages@gmail.com>
|
2004-11-03 13:51:07 +00:00
|
|
|
.\"
|
|
|
|
.\" Permission is granted to make and distribute verbatim copies of this
|
|
|
|
.\" manual provided the copyright notice and this permission notice are
|
|
|
|
.\" preserved on all copies.
|
|
|
|
.\"
|
|
|
|
.\" Permission is granted to copy and distribute modified versions of this
|
|
|
|
.\" manual under the conditions for verbatim copying, provided that the
|
|
|
|
.\" entire resulting derived work is distributed under the terms of a
|
|
|
|
.\" permission notice identical to this one.
|
2007-04-12 22:42:49 +00:00
|
|
|
.\"
|
2004-11-03 13:51:07 +00:00
|
|
|
.\" Since the Linux kernel and libraries are constantly changing, this
|
|
|
|
.\" manual page may be incorrect or out-of-date. The author(s) assume no
|
|
|
|
.\" responsibility for errors or omissions, or for damages resulting from
|
|
|
|
.\" the use of the information contained herein. The author(s) may not
|
|
|
|
.\" have taken the same level of care in the production of this manual,
|
|
|
|
.\" which is licensed free of charge, as they might when working
|
|
|
|
.\" professionally.
|
2007-04-12 22:42:49 +00:00
|
|
|
.\"
|
2004-11-03 13:51:07 +00:00
|
|
|
.\" Formatted or processed versions of this manual, if unaccompanied by
|
|
|
|
.\" the source, must acknowledge the copyright and authors of this work.
|
|
|
|
.\"
|
|
|
|
.\" Additions from Richard Gooch <rgooch@atnf.CSIRO.AU> and aeb, 971207
|
2006-03-16 00:06:34 +00:00
|
|
|
.\" 2006-03-13, mtk, Added ppoll() + various other rewordings
|
2006-07-01 08:30:56 +00:00
|
|
|
.\" 2006-07-01, mtk, Added POLLRDHUP + various other wording and
|
|
|
|
.\" formatting changes.
|
2006-03-25 21:07:31 +00:00
|
|
|
.\"
|
_exit.2, brk.2, capget.2, chdir.2, chmod.2, chown.2, chroot.2, getdtablesize.2, gethostname.2, getpagesize.2, getsid.2, killpg.2, mknod.2, mknodat.2, poll.2, posix_fadvise.2, pread.2, readlink.2, setpgid.2, setreuid.2, sigaltstack.2, stat.2, symlink.2, sync.2, truncate.2, vfork.2, wait.2, wait4.2, a64l.3, abs.3, acos.3, acosh.3, asin.3, asinh.3, atan.3, atan2.3, atoi.3, cbrt.3, ceil.3, copysign.3, cosh.3, dirfd.3, div.3, ecvt.3, erf.3, erfc.3, exp.3, exp2.3, fabs.3, fdim.3, ffs.3, floor.3, fma.3, fmax.3, fmin.3, fmod.3, fpclassify.3, frexp.3, ftw.3, fwide.3, gcvt.3, getcwd.3, getdate.3, getgrent.3, gethostid.3, getpass.3, getpwent.3, getsubopt.3, getw.3, hypot.3, ilogb.3, index.3, isalpha.3, isgreater.3, iswblank.3, j0.3, ldexp.3, lockf.3, log.3, log10.3, log1p.3, logb.3, lrint.3, lround.3, mkstemp.3, mktemp.3, modf.3, mq_receive.3, mq_send.3, nan.3, nextafter.3, posix_fallocate.3, posix_memalign.3, printf.3, qecvt.3, random.3, realpath.3, remainder.3, remquo.3, rint.3, round.3, scalb.3, scalbln.3, scanf.3, siginterrupt.3, signbit.3, sigset.3, sinh.3, sqrt.3, strcasecmp.3, strcat.3, strchr.3, strcmp.3, strcoll.3, strcpy.3, strfry.3, strpbrk.3, strsep.3, strspn.3, strstr.3, strtod.3, strtok.3, strtol.3, strtoul.3, strxfrm.3, tanh.3, tgamma.3, trunc.3, ttyslot.3, ualarm.3, usleep.3, wprintf.3, armscii-8.7, cp1251.7, iso_8859-10.7, iso_8859-11.7, iso_8859-13.7, iso_8859-14.7, iso_8859-3.7, iso_8859-5.7, iso_8859-6.7, iso_8859-8.7, koi8-u.7: tstamp
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2010-09-19 17:19:13 +00:00
|
|
|
.TH POLL 2 2010-09-20 "Linux" "Linux Programmer's Manual"
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH NAME
|
2006-03-16 00:06:34 +00:00
|
|
|
poll, ppoll \- wait for some event on a file descriptor
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH SYNOPSIS
|
2006-03-16 00:06:34 +00:00
|
|
|
.nf
|
2006-07-01 08:30:56 +00:00
|
|
|
.B #include <poll.h>
|
2004-11-03 13:51:07 +00:00
|
|
|
.sp
|
2006-03-16 00:06:34 +00:00
|
|
|
.BI "int poll(struct pollfd *" fds ", nfds_t " nfds ", int " timeout );
|
|
|
|
.sp
|
getresuid.2, mremap.2, poll.2, remap_file_pages.2, setresuid.2, splice.2, sync_file_range.2, syscall.2, tee.2, vmsplice.2, INFINITY.3, aio_init.3, asprintf.3, assert_perror.3, basename.3, bsd_signal.3, canonicalize_file_name.3, clog10.3, crypt.3, dl_iterate_phdr.3, dlopen.3, encrypt.3, exp10.3, fcloseall.3, fenv.3, fopencookie.3, ftw.3, getaddrinfo_a.3, getloadavg.3, getutent.3, grantpt.3, hsearch.3, lseek64.3, memmem.3, mempcpy.3, pow10.3, program_invocation_name.3, ptsname.3, putgrent.3, sched_getcpu.3, sincos.3, strchr.3, strfry.3, strnlen.3, strptime.3, strstr.3, strverscmp.3, swab.3, sysv_signal.3, tsearch.3, unlockpt.3, wcwidth.3: Add reference to feature_test_macros(7)
Some pages simply list feature test macro requirements in
the form:
#define #GNU_SOURCE
#include <someheader.h>
For these pages, add a "See feature_test_macros(7)" comment
on the "#define" line.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2010-10-31 04:31:47 +00:00
|
|
|
.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
|
2006-07-01 08:30:56 +00:00
|
|
|
.B #include <poll.h>
|
2006-03-19 23:37:17 +00:00
|
|
|
.sp
|
2006-03-16 00:06:34 +00:00
|
|
|
.BI "int ppoll(struct pollfd *" fds ", nfds_t " nfds ", "
|
2010-06-12 12:15:00 +00:00
|
|
|
.BI " const struct timespec *" timeout_ts ", const sigset_t *" sigmask );
|
2006-03-16 00:06:34 +00:00
|
|
|
.fi
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH DESCRIPTION
|
2005-08-16 08:46:16 +00:00
|
|
|
.BR poll ()
|
2006-03-16 00:06:34 +00:00
|
|
|
performs a similar task to
|
|
|
|
.BR select (2):
|
|
|
|
it waits for one of a set of file descriptors to become ready
|
|
|
|
to perform I/O.
|
|
|
|
|
|
|
|
The set of file descriptors to be monitored is specified in the
|
|
|
|
.I fds
|
2009-09-15 04:05:42 +00:00
|
|
|
argument, which is an array of structures of the following form:
|
2007-12-19 06:57:44 +00:00
|
|
|
.in +4n
|
2004-11-03 13:51:07 +00:00
|
|
|
.nf
|
2005-08-16 08:46:16 +00:00
|
|
|
|
2007-12-19 05:53:30 +00:00
|
|
|
struct pollfd {
|
|
|
|
int fd; /* file descriptor */
|
|
|
|
short events; /* requested events */
|
|
|
|
short revents; /* returned events */
|
|
|
|
};
|
|
|
|
.in
|
2009-09-15 04:05:42 +00:00
|
|
|
.fi
|
|
|
|
.PP
|
|
|
|
The caller should specify the number of items in the
|
|
|
|
.I fds
|
|
|
|
array in
|
|
|
|
.IR nfds .
|
|
|
|
|
2004-11-03 13:51:07 +00:00
|
|
|
The field
|
|
|
|
.I fd
|
|
|
|
contains a file descriptor for an open file.
|
2006-07-01 08:30:56 +00:00
|
|
|
|
2004-11-03 13:51:07 +00:00
|
|
|
The field
|
|
|
|
.I events
|
2007-07-01 04:23:34 +00:00
|
|
|
is an input parameter, a bit mask specifying the events the application
|
2004-11-03 13:51:07 +00:00
|
|
|
is interested in.
|
2006-07-01 08:30:56 +00:00
|
|
|
|
2004-11-03 13:51:07 +00:00
|
|
|
The field
|
|
|
|
.I revents
|
|
|
|
is an output parameter, filled by the kernel with the events that
|
2006-03-16 00:06:34 +00:00
|
|
|
actually occurred.
|
|
|
|
The bits returned in
|
|
|
|
.I revents
|
2007-04-12 22:42:49 +00:00
|
|
|
can include any of those specified in
|
2006-03-16 00:06:34 +00:00
|
|
|
.IR events ,
|
|
|
|
or one of the values
|
|
|
|
.BR POLLERR ,
|
|
|
|
.BR POLLHUP ,
|
2004-11-03 13:51:07 +00:00
|
|
|
or
|
|
|
|
.BR POLLNVAL .
|
|
|
|
(These three bits are meaningless in the
|
|
|
|
.I events
|
|
|
|
field, and will be set in the
|
|
|
|
.I revents
|
|
|
|
field whenever the corresponding condition is true.)
|
2006-07-01 08:30:56 +00:00
|
|
|
|
2004-11-03 13:51:07 +00:00
|
|
|
If none of the events requested (and no error) has occurred for any
|
2006-03-16 00:06:34 +00:00
|
|
|
of the file descriptors, then
|
|
|
|
.BR poll ()
|
|
|
|
blocks until one of the events occurs.
|
2005-08-16 08:46:16 +00:00
|
|
|
|
2007-04-12 22:42:49 +00:00
|
|
|
The
|
2006-03-16 00:06:34 +00:00
|
|
|
.I timeout
|
|
|
|
argument specifies an upper limit on the time for which
|
|
|
|
.BR poll ()
|
|
|
|
will block, in milliseconds.
|
|
|
|
Specifying a negative value in
|
|
|
|
.I timeout
|
|
|
|
means an infinite timeout.
|
2006-07-01 08:30:56 +00:00
|
|
|
|
|
|
|
The bits that may be set/returned in
|
|
|
|
.I events
|
|
|
|
and
|
|
|
|
.I revents
|
2007-06-20 21:53:34 +00:00
|
|
|
are defined in \fI<poll.h>\fP:
|
2006-07-01 08:30:56 +00:00
|
|
|
.RS
|
|
|
|
.TP
|
|
|
|
.B POLLIN
|
|
|
|
There is data to read.
|
|
|
|
.TP
|
|
|
|
.B POLLPRI
|
2007-04-12 22:42:49 +00:00
|
|
|
There is urgent data to read (e.g., out-of-band data on TCP socket;
|
open.2, poll.2, select_tut.2, getpt.3, openpty.3, posix_openpt.3, ptsname.3, unlockpt.3, pts.4, tty_ioctl.4, proc.5, pty.7: spfix: s/psuedoterminal/psuedoterminal/g
Reported-by: Denis Barbier <bouzim@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2010-10-13 03:32:15 +00:00
|
|
|
pseudoterminal master in packet mode has seen state change in slave).
|
2006-07-01 08:30:56 +00:00
|
|
|
.TP
|
|
|
|
.B POLLOUT
|
|
|
|
Writing now will not block.
|
|
|
|
.TP
|
|
|
|
.BR POLLRDHUP " (since Linux 2.6.17)"
|
2007-04-12 22:42:49 +00:00
|
|
|
Stream socket peer closed connection,
|
2006-07-01 08:30:56 +00:00
|
|
|
or shut down writing half of connection.
|
2007-04-12 22:42:49 +00:00
|
|
|
The
|
2006-07-01 08:30:56 +00:00
|
|
|
.B _GNU_SOURCE
|
2010-09-10 04:33:31 +00:00
|
|
|
feature test macro must be defined
|
|
|
|
(before including
|
|
|
|
.I any
|
|
|
|
header files)
|
|
|
|
in order to obtain this definition.
|
2006-07-01 08:30:56 +00:00
|
|
|
.TP
|
|
|
|
.B POLLERR
|
|
|
|
Error condition (output only).
|
|
|
|
.TP
|
|
|
|
.B POLLHUP
|
|
|
|
Hang up (output only).
|
|
|
|
.TP
|
|
|
|
.B POLLNVAL
|
2007-04-12 22:42:49 +00:00
|
|
|
Invalid request:
|
2006-07-01 08:30:56 +00:00
|
|
|
.I fd
|
|
|
|
not open (output only).
|
|
|
|
.RE
|
|
|
|
.PP
|
2007-04-12 22:42:49 +00:00
|
|
|
When compiling with
|
2006-07-01 08:30:56 +00:00
|
|
|
.B _XOPEN_SOURCE
|
2007-04-12 22:42:49 +00:00
|
|
|
defined, one also has the following,
|
2006-07-01 08:30:56 +00:00
|
|
|
which convey no further information beyond the bits listed above:
|
|
|
|
.RS
|
|
|
|
.TP
|
|
|
|
.B POLLRDNORM
|
|
|
|
Equivalent to
|
|
|
|
.BR POLLIN .
|
|
|
|
.TP
|
|
|
|
.B POLLRDBAND
|
|
|
|
Priority band data can be read (generally unused on Linux).
|
|
|
|
.\" POLLRDBAND is used in the DECnet protocol.
|
|
|
|
.TP
|
|
|
|
.B POLLWRNORM
|
|
|
|
Equivalent to
|
|
|
|
.BR POLLOUT .
|
|
|
|
.TP
|
|
|
|
.B POLLWRBAND
|
|
|
|
Priority data may be written.
|
|
|
|
.RE
|
|
|
|
.PP
|
2007-04-12 22:42:49 +00:00
|
|
|
Linux also knows about, but does not use
|
2006-07-01 08:30:56 +00:00
|
|
|
.BR POLLMSG .
|
2006-03-16 00:06:34 +00:00
|
|
|
.SS ppoll()
|
2007-04-12 22:42:49 +00:00
|
|
|
The relationship between
|
2006-03-16 00:06:34 +00:00
|
|
|
.BR poll ()
|
2007-04-12 22:42:49 +00:00
|
|
|
and
|
|
|
|
.BR ppoll ()
|
2006-03-16 00:06:34 +00:00
|
|
|
is analogous to the relationship between
|
2007-05-11 23:07:02 +00:00
|
|
|
.BR select (2)
|
2006-03-16 00:06:34 +00:00
|
|
|
and
|
2007-05-11 23:07:02 +00:00
|
|
|
.BR pselect (2):
|
2006-03-16 00:06:34 +00:00
|
|
|
like
|
2007-05-11 23:07:02 +00:00
|
|
|
.BR pselect (2),
|
2006-03-16 00:06:34 +00:00
|
|
|
.BR ppoll ()
|
|
|
|
allows an application to safely wait until either a file descriptor
|
|
|
|
becomes ready or until a signal is caught.
|
|
|
|
.PP
|
2010-06-12 12:15:00 +00:00
|
|
|
Other than the difference in the precision of the
|
2011-09-08 13:58:45 +00:00
|
|
|
.I timeout
|
|
|
|
argument, the following
|
2006-03-16 00:06:34 +00:00
|
|
|
.BR ppoll ()
|
|
|
|
call:
|
|
|
|
.nf
|
|
|
|
|
2010-06-12 12:15:00 +00:00
|
|
|
ready = ppoll(&fds, nfds, timeout_ts, &sigmask);
|
2006-03-16 00:06:34 +00:00
|
|
|
|
|
|
|
.fi
|
|
|
|
is equivalent to
|
|
|
|
.I atomically
|
|
|
|
executing the following calls:
|
|
|
|
.nf
|
|
|
|
|
|
|
|
sigset_t origmask;
|
2010-06-12 12:15:00 +00:00
|
|
|
int timeout;
|
2006-03-16 00:06:34 +00:00
|
|
|
|
fallocate.2, kexec_load.2, poll.2, spu_run.2, atan2.3, cbrt.3, clock_getcpuclockid.3, end.3, frexp.3, getgrouplist.3, getifaddrs.3, matherr.3, modf.3, pow.3, pthread_getattr_np.3, pthread_getcpuclockid.3, sched_getcpu.3, tgamma.3, mouse.4, proc.5, feature_test_macros.7, spufs.7: Global fix: properly escape minus sign
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2011-09-10 01:57:53 +00:00
|
|
|
timeout = (timeout_ts == NULL) ? \-1 :
|
2010-06-12 12:15:00 +00:00
|
|
|
(timeout_ts.tv_sec * 1000 + timeout_ts.tv_nsec / 1000000);
|
2006-03-16 00:06:34 +00:00
|
|
|
sigprocmask(SIG_SETMASK, &sigmask, &origmask);
|
2007-03-01 01:27:34 +00:00
|
|
|
ready = poll(&fds, nfds, timeout);
|
2006-03-16 00:06:34 +00:00
|
|
|
sigprocmask(SIG_SETMASK, &origmask, NULL);
|
|
|
|
.fi
|
|
|
|
.PP
|
|
|
|
See the description of
|
|
|
|
.BR pselect (2)
|
|
|
|
for an explanation of why
|
|
|
|
.BR ppoll ()
|
|
|
|
is necessary.
|
|
|
|
|
2008-04-23 14:49:53 +00:00
|
|
|
If the
|
|
|
|
.I sigmask
|
|
|
|
argument is specified as NULL, then
|
|
|
|
no signal mask manipulation is performed
|
|
|
|
(and thus
|
|
|
|
.BR ppoll ()
|
|
|
|
differs from
|
|
|
|
.BR poll ()
|
2011-09-08 14:02:56 +00:00
|
|
|
only in the precision of the
|
|
|
|
.I timeout
|
|
|
|
argument).
|
2008-04-23 14:49:53 +00:00
|
|
|
|
2006-03-16 00:06:34 +00:00
|
|
|
The
|
2010-06-12 12:15:00 +00:00
|
|
|
.I timeout_ts
|
2007-04-12 22:42:49 +00:00
|
|
|
argument specifies an upper limit on the amount of time that
|
2006-03-16 00:06:34 +00:00
|
|
|
.BR ppoll ()
|
|
|
|
will block.
|
|
|
|
This argument is a pointer to a structure of the following form:
|
2007-12-19 06:57:44 +00:00
|
|
|
.in +4n
|
2006-03-16 00:06:34 +00:00
|
|
|
.nf
|
|
|
|
|
|
|
|
struct timespec {
|
|
|
|
long tv_sec; /* seconds */
|
|
|
|
long tv_nsec; /* nanoseconds */
|
|
|
|
};
|
|
|
|
.fi
|
2007-12-19 05:53:30 +00:00
|
|
|
.in
|
2006-03-16 00:06:34 +00:00
|
|
|
|
|
|
|
If
|
2010-06-12 12:15:00 +00:00
|
|
|
.I timeout_ts
|
2007-04-12 22:42:49 +00:00
|
|
|
is specified as NULL, then
|
2006-03-16 00:06:34 +00:00
|
|
|
.BR ppoll ()
|
|
|
|
can block indefinitely.
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH "RETURN VALUE"
|
2005-08-16 08:46:16 +00:00
|
|
|
On success, a positive number is returned; this is
|
intro.1, time.1, adjtimex.2, capget.2, eventfd.2, fcntl.2, getrlimit.2, getsockopt.2, gettimeofday.2, intro.2, ioctl_list.2, ioperm.2, mlock.2, pivot_root.2, poll.2, prctl.2, ptrace.2, sched_setscheduler.2, select_tut.2, semget.2, sigaltstack.2, signalfd.2, sysctl.2, timer_settime.2, timerfd_create.2, wait.2, CPU_SET.3, argz_add.3, assert_perror.3, atexit.3, backtrace.3, bcmp.3, clearenv.3, ctime.3, dl_iterate_phdr.3, dlopen.3, ecvt.3, errno.3, error.3, ether_aton.3, exit.3, fenv.3, ferror.3, finite.3, flockfile.3, fnmatch.3, fpathconf.3, fpclassify.3, ftime.3, ftok.3, ftw.3, fwide.3, getaddrinfo.3, gethostbyname.3, getlogin.3, getnameinfo.3, getnetent.3, getopt.3, getprotoent.3, getrpcent.3, getservent.3, glob.3, hsearch.3, inet.3, isalpha.3, iswalnum.3, iswalpha.3, iswblank.3, iswcntrl.3, iswctype.3, iswdigit.3, iswgraph.3, iswlower.3, iswprint.3, iswpunct.3, iswspace.3, iswupper.3, iswxdigit.3, longjmp.3, lsearch.3, malloc.3, matherr.3, mblen.3, mbsinit.3, mbtowc.3, on_exit.3, printf.3, pthread_attr_init.3, pthread_attr_setaffinity_np.3, pthread_attr_setdetachstate.3, pthread_attr_setguardsize.3, pthread_attr_setinheritsched.3, pthread_attr_setschedparam.3, pthread_attr_setschedpolicy.3, pthread_attr_setscope.3, pthread_attr_setstack.3, pthread_attr_setstackaddr.3, pthread_attr_setstacksize.3, pthread_cancel.3, pthread_cleanup_push.3, pthread_equal.3, pthread_getattr_np.3, pthread_getcpuclockid.3, pthread_setaffinity_np.3, pthread_setcancelstate.3, pthread_setconcurrency.3, pthread_setschedparam.3, pthread_setschedprio.3, ptsname.3, putenv.3, putgrent.3, raise.3, rcmd.3, regex.3, rexec.3, rpc.3, rpmatch.3, rtnetlink.3, scandir.3, sem_init.3, setaliasent.3, setbuf.3, setenv.3, setjmp.3, signbit.3, stdio_ext.3, strtod.3, strtol.3, strtoul.3, system.3, termios.3, timeradd.3, tzset.3, ualarm.3, wctomb.3, xdr.3, st.4, tty_ioctl.4, core.5, elf.5, proc.5, bootparam.7, capabilities.7, icmp.7, ip.7, ipv6.7, math_error.7, mdoc.samples.7, mq_overview.7, pthreads.7, raw.7, regex.7, socket.7, tcp.7, tzselect.8: Global fix: s/non-zero/nonzero/
The tendency in English, as prescribed in style guides like
Chicago MoS, is towards removing hyphens after prefixes
like "non-" etc.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2010-01-16 16:40:55 +00:00
|
|
|
the number of structures which have nonzero
|
2004-11-03 13:51:07 +00:00
|
|
|
.I revents
|
|
|
|
fields (in other words, those descriptors with events or errors reported).
|
|
|
|
A value of 0 indicates that the call timed out and no file
|
2007-04-12 22:42:49 +00:00
|
|
|
descriptors were ready.
|
|
|
|
On error, \-1 is returned, and
|
2004-11-03 13:51:07 +00:00
|
|
|
.I errno
|
|
|
|
is set appropriately.
|
|
|
|
.SH ERRORS
|
|
|
|
.TP
|
|
|
|
.B EFAULT
|
|
|
|
The array given as argument was not contained in the calling program's
|
|
|
|
address space.
|
|
|
|
.TP
|
|
|
|
.B EINTR
|
2008-07-04 15:50:36 +00:00
|
|
|
A signal occurred before any requested event; see
|
|
|
|
.BR signal (7).
|
2004-11-03 13:51:07 +00:00
|
|
|
.TP
|
|
|
|
.B EINVAL
|
|
|
|
The
|
|
|
|
.I nfds
|
2007-06-22 17:16:20 +00:00
|
|
|
value exceeds the
|
|
|
|
.B RLIMIT_NOFILE
|
|
|
|
value.
|
2004-11-03 13:51:07 +00:00
|
|
|
.TP
|
|
|
|
.B ENOMEM
|
|
|
|
There was no space to allocate file descriptor tables.
|
2006-03-16 00:06:34 +00:00
|
|
|
.SH VERSIONS
|
2005-10-19 14:48:35 +00:00
|
|
|
The
|
2007-04-12 22:42:49 +00:00
|
|
|
.BR poll ()
|
2005-10-19 14:48:35 +00:00
|
|
|
system call was introduced in Linux 2.1.23.
|
2007-04-12 22:42:49 +00:00
|
|
|
The
|
2005-10-19 14:54:31 +00:00
|
|
|
.BR poll ()
|
2005-10-19 14:48:35 +00:00
|
|
|
library call was introduced in libc 5.4.28
|
2011-09-08 14:01:37 +00:00
|
|
|
(and provides emulation using
|
|
|
|
.BR select (2)
|
|
|
|
if your kernel does not
|
2007-04-12 22:42:49 +00:00
|
|
|
have a
|
2005-10-20 15:11:10 +00:00
|
|
|
.BR poll ()
|
|
|
|
system call).
|
2006-03-16 00:06:34 +00:00
|
|
|
|
|
|
|
The
|
|
|
|
.BR ppoll ()
|
|
|
|
system call was added to Linux in kernel 2.6.16.
|
|
|
|
The
|
|
|
|
.BR ppoll ()
|
|
|
|
library call was added in glibc 2.4.
|
2007-05-18 16:06:42 +00:00
|
|
|
.SH "CONFORMING TO"
|
|
|
|
.BR poll ()
|
|
|
|
conforms to POSIX.1-2001.
|
|
|
|
.BR ppoll ()
|
2007-12-25 21:28:09 +00:00
|
|
|
is Linux-specific.
|
2007-05-18 16:06:42 +00:00
|
|
|
.\" NetBSD 3.0 has a pollts() which is like Linux ppoll().
|
2006-03-16 00:06:34 +00:00
|
|
|
.SH NOTES
|
accept.2, execve.2, futimesat.2, getresuid.2, getrlimit.2, madvise.2, mq_getsetattr.2, msgctl.2, nice.2, open.2, poll.2, setresuid.2, shmctl.2, sigaction.2, times.2, utimensat.2, __setfpucw.3, atoi.3, endian.3, err.3, euidaccess.3, fenv.3, fopencookie.3, fpurge.3, getgrouplist.3, getutmp.3, j0.3, lgamma.3, netlink.3, pthread_attr_init.3, pthread_attr_setaffinity_np.3, pthread_cleanup_push_defer_np.3, pthread_getattr_np.3, pthread_kill_other_threads_np.3, pthread_setaffinity_np.3, pthread_tryjoin_np.3, pthread_yield.3, random_r.3, readdir.3, rtnetlink.3, scanf.3, setenv.3, significand.3, sigsetops.3, strerror.3, strstr.3, sysv_signal.3, termios.3, timegm.3, unlocked_stdio.3, y0.3, locale.5, bootparam.7, feature_test_macros.7, ip.7, locale.7, pthreads.7, rtld-audit.7, nscd.8: Global fix: s/non-standard/nonstandard/
The tendency in English, as prescribed in style guides like
Chicago MoS, is towards removing hyphens after prefixes
like "non-" etc.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2010-01-16 16:37:52 +00:00
|
|
|
Some implementations define the nonstandard constant
|
2005-12-01 16:03:36 +00:00
|
|
|
.B INFTIM
|
|
|
|
with the value \-1 for use as a
|
2010-06-12 12:15:00 +00:00
|
|
|
.IR timeout
|
|
|
|
for
|
2010-07-02 05:12:35 +00:00
|
|
|
.BR poll ().
|
2005-12-01 16:03:36 +00:00
|
|
|
This constant is not provided in glibc.
|
2007-05-18 10:39:45 +00:00
|
|
|
.SS "Linux Notes"
|
|
|
|
The Linux
|
|
|
|
.BR ppoll ()
|
|
|
|
system call modifies its
|
2010-06-12 12:15:00 +00:00
|
|
|
.I timeout_ts
|
2007-05-18 10:39:45 +00:00
|
|
|
argument.
|
2007-06-08 09:56:56 +00:00
|
|
|
However, the glibc wrapper function hides this behavior
|
2007-05-18 10:39:45 +00:00
|
|
|
by using a local variable for the timeout argument that
|
|
|
|
is passed to the system call.
|
|
|
|
Thus, the glibc
|
|
|
|
.BR ppoll ()
|
|
|
|
function does not modify its
|
2010-06-12 12:15:00 +00:00
|
|
|
.I timeout_ts
|
2007-05-18 10:39:45 +00:00
|
|
|
argument.
|
2007-05-18 16:06:42 +00:00
|
|
|
.SH BUGS
|
|
|
|
See the discussion of spurious readiness notifications under the
|
|
|
|
BUGS section of
|
|
|
|
.BR select (2).
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH "SEE ALSO"
|
|
|
|
.BR select (2),
|
2006-04-21 06:49:34 +00:00
|
|
|
.BR select_tut (2),
|
2008-06-23 08:48:25 +00:00
|
|
|
.BR time (7)
|