Back to index

glibc  2.9
poll.h
Go to the documentation of this file.
00001 /* Copyright (C) 1997, 2001, 2008 Free Software Foundation, Inc.
00002    This file is part of the GNU C Library.
00003 
00004    The GNU C Library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Lesser General Public
00006    License as published by the Free Software Foundation; either
00007    version 2.1 of the License, or (at your option) any later version.
00008 
00009    The GNU C Library is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Lesser General Public License for more details.
00013 
00014    You should have received a copy of the GNU Lesser General Public
00015    License along with the GNU C Library; if not, write to the Free
00016    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00017    02111-1307 USA.  */
00018 
00019 #ifndef _SYS_POLL_H
00020 # error "Never use <bits/poll.h> directly; include <sys/poll.h> instead."
00021 #endif
00022 
00023 /* Event types that can be polled for.  These bits may be set in `events'
00024    to indicate the interesting event types; they will appear in `revents'
00025    to indicate the status of the file descriptor.  */
00026 #define POLLIN              0x001         /* There is data to read.  */
00027 #define POLLPRI             0x002         /* There is urgent data to read.  */
00028 #define POLLOUT             0x004         /* Writing now will not block.  */
00029 
00030 #ifdef __USE_XOPEN
00031 /* These values are defined in XPG4.2.  */
00032 # define POLLRDNORM  0x040         /* Normal data may be read.  */
00033 # define POLLRDBAND  0x080         /* Priority data may be read.  */
00034 # define POLLWRNORM  POLLOUT              /* Writing now will not block.  */
00035 # define POLLWRBAND  0x100         /* Priority data may be written.  */
00036 #endif
00037 
00038 #ifdef __USE_GNU
00039 /* These are extensions for Linux.  */
00040 # define POLLMSG     0x400
00041 # define POLLREMOVE  0x1000
00042 # define POLLRDHUP   0x2000
00043 #endif
00044 
00045 /* Event types always implicitly polled for.  These bits need not be set in
00046    `events', but they will appear in `revents' to indicate the status of
00047    the file descriptor.  */
00048 #define POLLERR             0x008         /* Error condition.  */
00049 #define POLLHUP             0x010         /* Hung up.  */
00050 #define POLLNVAL     0x020         /* Invalid polling request.  */