1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
|
.\" Hey Emacs! This file is -*- nroff -*- source.
.\"
.\" Copyright (C) 1997 Andries Brouwer (aeb@cwi.nl)
.\"
.\" 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
.\"
.\" 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.
.\"
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
.\"
.\" Traduction 21/07/1997 par Christophe Blaess (ccb@club-internet.fr)
.\"
.TH POLL 2 "21 Juillet 1997" Linux "Manuel du programmeur Linux"
.SH NOM
poll \- Attendre un evenement concernant un descripteur de fichier.
.SH SYNOPSIS
.B #include <linux/asm/poll.h>
.sp
.BI "int poll(struct pollfd *" ufds ", unsigned int " nfds ", int " delai );
.SH DESCRIPTION
.B poll
est une variation sur le theme de
.BR select (2).
Il utilise une table de
.I nfds
structures du type
.br
.nf
struct pollfd {
int fd;
short events;
short revents;
};
.fi
et un
.I delai
en millisecondes. (Une valeur negative indiquant un delai infini.)
Le champs
.I events
est un parametre d'entree, un masque de bits indiquant les evenements
qui interessent l'application.
Le champ
.I revents
est un parametre de sorte, rempli par le noyau avec les evenements qui
se sont effectivement produits, du type demande, ou de l'un des types
.B POLLERR
ou
.BR POLLHUP .
Les bits possibles pour ces masques sont definis dans <linux/asm/poll.h>:
.br
.nf
#define POLLIN 0x0001
#define POLLPRI 0x0002
#define POLLOUT 0x0004
#define POLLERR 0x0008
#define POLLHUP 0x0010
#define POLLNVAL 0x0020
#define POLLRDNORM 0x0040
#define POLLRDBAND 0x0080
#define POLLWRNORM 0x0100
#define POLLWRBAND 0x0200
#define POLLMSG 0x0400
.fi
.SH "VALEUR RENVOYEE"
.B poll
renvoie 0 s'il reussit, ou \-1 s'il echoue, auquel cas
.I errno
contient le code d'erreur.
.SH ERREURS
.TP
.B ENOMEM
Pas assez de memoire pour allouer la table des descripteurs de fichiers.
.TP
.B EFAULT
La table fournie en argument n'est pas dans l'espace d'adressage du processus
appelant.
.TP
.B EINTR
Un signal a ete recu avant qu'un evenement interessant ne se produise.
.SH "CONFORMITE"
Cet appel-systeme est specifique a Linux
.SH "VOIR AUSSI"
.BR select (2)
|