IceWalkers.com - Linux Software downloads and news
Name : Password :
Linux SoftwareLinux RPMLinux HowtosLink UsAboutAdvertise

poll (2)

POLL(2)                    Linux Programmer's Manual                   POLL(2)



NAME
       poll - wait for some event on a file descriptor

SYNOPSIS
       #include<sys/poll.h>

       intpoll(structpollfd*ufds,unsignedint nfds,int timeout);

DESCRIPTION
       poll  is  a variation on the theme of select.  It specifies an array of
       nfds structures of type
               struct pollfd {
                       int fd;           /* file descriptor */
                       short events;     /* requested events */
                       short revents;    /* returned events */
               };
       and a timeout in milliseconds. A negative value means infinite timeout.
       The  field  fd  contains a file descriptor for an open file.  The field
       events is an input parameter,  a  bitmask  specifying  the  events  the
       application  is  interested in.  The field revents is an output parame-
       ter, filled by the kernel  with  the  events  that  actually  occurred,
       either of the type requested, or of one of the types POLLERR or POLLHUP
       or POLLNVAL.  (These three bits are meaningless in  the  events  field,
       and  will be set in the revents field whenever the corresponding condi-
       tion is true.)  If none of the events  requested  (and  no  error)  has
       occurred  for any of the file descriptors, the kernel waits for timeout
       milliseconds for one of these events to occur.  The following  possible
       bits in these masks are defined in <sys/poll.h>
           #define POLLIN      0x0001    /* There is data to read */
           #define POLLPRI     0x0002    /* There is urgent data to read */
           #define POLLOUT     0x0004    /* Writing now will not block */
           #define POLLERR     0x0008    /* Error condition */
           #define POLLHUP     0x0010    /* Hung up */
           #define POLLNVAL    0x0020    /* Invalid request: fd not open */
       In  <asm/poll.h>  also  the  values POLLRDNORM, POLLRDBAND, POLLWRNORM,
       POLLWRBAND and POLLMSG are defined.

RETURNVALUE
       On success, a positive number is returned, where the number returned is
       the  number  of structures which have non-zero 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 descriptors have been
       selected. On error, -1 is returned, and errno is set appropriately.

ERRORS
       EBADF  An invalid file descriptor was given in one of the sets.

       ENOMEM There was no space to allocate file descriptor tables.

       EFAULT The array given as argument was not  contained  in  the  calling
              program's address space.

       EINTR  A signal occurred before any requested event.

CONFORMINGTO
       XPG4-UNIX.

AVAILABILITY
       The  poll()  systemcall  was  introduced  in  Linux 2.1.23.  The poll()
       library call was introduced in  libc  5.4.28  (and  provides  emulation
       using select if your kernel does not have a poll syscall).

SEEALSO
       select(2), select_tut(2)



Linux 2.1.23                      1997-12-07                           POLL(2)

_Exitgetsockoptoutwshmat
_exitgettidoutw_pshmctl
_llseekgettimeofdaypauseshmdt
_newselectgetuidpersonalityshmget
_sysctlgttypipeshmop
acceptidlepivot_rootshutdown
accessinbpollsigaction
acctinb_pprctlsigaltstack
adjtimexinlpreadsigblock
afs_syscallinl_pprofsiggetmask
alarminsbpselectsigmask
alloc_hugepagesinslptracesignal
arch_prctlinswpwritesigpause
bdflushintroquotactlsigpending
bindinwreadsigprocmask
breakinw_preaddirsigqueue
brkioctlreadlinksigreturn
cacheflushioctl_listreadvsigsetmask
capgetiopermrebootsigsuspend
capsetioplrecvsigtimedwait
chdiripcrecvfromsigvec
chmodkillrecvmsgsigwaitinfo
chownkillpgrenamesocket
chrootlchownrmdirsocketcall
clonelinksbrksocketpair
closelistensched_get_priority_maxssetmask
connectllseeksched_get_priority_minstat
creatlocksched_getaffinitystatfs
duplseeksched_getparamstime
dup2lstatsched_getschedulerstty
execvemadvisesched_rr_get_intervalswapoff
exitmincoresched_setaffinityswapon
fchdirmkdirsched_setparamsymlink
fchmodmknodsched_setschedulersync
fchownmlocksched_yieldsyscall
fcntlmlockallselectsyscalls
fdatasyncmmapselect_tutsysctl
flockmmap2semctlsysfs
forkmodify_ldtsemgetsysinfo
free_hugepagesmountsemopsyslog
fstatmprotectsendtime
fstatfsmpxsendfiletimes
fsyncmremapsendmsgtkill
ftruncatemsgctlsendtotruncate
futexmsggetsetcontextumask
getcontextmsgopsetdomainnameumount
getdentsmsgrcvsetegidumount2
getdomainnamemsgsndseteuiduname
getdtablesizemsyncsetfsgidundocumented
getegidmunlocksetfsuidunimplemented
geteuidmunlockallsetgidunlink
getgidmunmapsetgroupsuselib
getgroupsnanosleepsethostidustat
gethostidnfsservctlsethostnameutime
gethostnamenicesetitimerutimes
getitimerobsoletesetpgidvfork
getpagesizeoldfstatsetpgrpvhangup
getpeernameoldlstatsetpriorityvm86
getpgidoldoldunamesetregidwait
getpgrpoldstatsetresgidwait3
getpidoldunamesetresuidwait4
getppidopensetreuidwaitpid
getpriorityoutbsetrlimitwrite
getresgidoutb_psetsidwritev
getresuidoutlsetsockopt 
getrlimitoutl_psettimeofday 
getrusageoutsbsetuid 
getsidoutslsetup 


Claws Mail 3.7.2
Email client (and news reader), based on GTK+
Samba 3.4.0
Provides file and print services to SMB/CIFS clients
Amaya 11.2
Complete web browsing and authoring environment
Linux Kernel 2.6 2.6.30.1
Linux Kernel
Scintilla 1.79
Free source code editing component
Sawfish 1.5.0
An extensible window manager
ImageMagick 6.5.4.2
ImageMagick image processing studio
Wine 1.1.25
Free implementation of Windows on Unix
GEdit 2.26.3
Small but powerful text editor
WebGUI 7.7.13
A fully featured content management system.
Free IT Magazines, White Papers, eBooks, and more !
Oracle Magazine

Contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more.

Vulnerability Management for Dummies

Get all the Facts and See How to Implement a Successful Vulnerability Management Program.

Website Magazine

Has tapped premier talent in the Internet industry for our content and each and every issue will contain practical advice and insights for website owners.

Linux Software Map
Find Linux RPM
Best Rated Linux Software
Most Rated Linux Software
Linux Distributions
Linux Howtos
Linux Software
Linux / IT Resources
Site Resources
Google
Privacy Policy
Contact Us
Submit Software
Advertising info