Blame lib/poll.in.h

Packit Service a2489d
/* Header for poll(2) emulation
Packit Service a2489d
   Contributed by Paolo Bonzini.
Packit Service a2489d
Packit Service a2489d
   Copyright 2001-2003, 2007, 2009-2018 Free Software Foundation, Inc.
Packit Service a2489d
Packit Service a2489d
   This file is part of gnulib.
Packit Service a2489d
Packit Service a2489d
   This program is free software; you can redistribute it and/or modify
Packit Service a2489d
   it under the terms of the GNU General Public License as published by
Packit Service a2489d
   the Free Software Foundation; either version 3, or (at your option)
Packit Service a2489d
   any later version.
Packit Service a2489d
Packit Service a2489d
   This program is distributed in the hope that it will be useful,
Packit Service a2489d
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service a2489d
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit Service a2489d
   GNU General Public License for more details.
Packit Service a2489d
Packit Service a2489d
   You should have received a copy of the GNU General Public License along
Packit Service a2489d
   with this program; if not, see <https://www.gnu.org/licenses/>.  */
Packit Service a2489d
Packit Service a2489d
#ifndef _@GUARD_PREFIX@_POLL_H
Packit Service a2489d
Packit Service a2489d
#if __GNUC__ >= 3
Packit Service a2489d
@PRAGMA_SYSTEM_HEADER@
Packit Service a2489d
#endif
Packit Service a2489d
@PRAGMA_COLUMNS@
Packit Service a2489d
Packit Service a2489d
/* The include_next requires a split double-inclusion guard.  */
Packit Service a2489d
#if @HAVE_POLL_H@
Packit Service a2489d
# @INCLUDE_NEXT@ @NEXT_POLL_H@
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
#ifndef _@GUARD_PREFIX@_POLL_H
Packit Service a2489d
#define _@GUARD_PREFIX@_POLL_H
Packit Service a2489d
Packit Service a2489d
Packit Service a2489d
/* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
Packit Service a2489d
Packit Service a2489d
/* The definition of _GL_WARN_ON_USE is copied here.  */
Packit Service a2489d
Packit Service a2489d
Packit Service a2489d
#if !@HAVE_POLL_H@
Packit Service a2489d
Packit Service a2489d
/* fake a poll(2) environment */
Packit Service a2489d
# define POLLIN      0x0001      /* any readable data available   */
Packit Service a2489d
# define POLLPRI     0x0002      /* OOB/Urgent readable data      */
Packit Service a2489d
# define POLLOUT     0x0004      /* file descriptor is writable   */
Packit Service a2489d
# define POLLERR     0x0008      /* some poll error occurred      */
Packit Service a2489d
# define POLLHUP     0x0010      /* file descriptor was "hung up" */
Packit Service a2489d
# define POLLNVAL    0x0020      /* requested events "invalid"    */
Packit Service a2489d
# define POLLRDNORM  0x0040
Packit Service a2489d
# define POLLRDBAND  0x0080
Packit Service a2489d
# define POLLWRNORM  0x0100
Packit Service a2489d
# define POLLWRBAND  0x0200
Packit Service a2489d
Packit Service a2489d
# if !GNULIB_defined_poll_types
Packit Service a2489d
Packit Service a2489d
struct pollfd
Packit Service a2489d
{
Packit Service a2489d
  int fd;                       /* which file descriptor to poll */
Packit Service a2489d
  short events;                 /* events we are interested in   */
Packit Service a2489d
  short revents;                /* events found on return        */
Packit Service a2489d
};
Packit Service a2489d
Packit Service a2489d
typedef unsigned long nfds_t;
Packit Service a2489d
Packit Service a2489d
#  define GNULIB_defined_poll_types 1
Packit Service a2489d
# endif
Packit Service a2489d
Packit Service a2489d
/* Define INFTIM only if doing so conforms to POSIX.  */
Packit Service a2489d
# if !defined (_POSIX_C_SOURCE) && !defined (_XOPEN_SOURCE)
Packit Service a2489d
#  define INFTIM (-1)
Packit Service a2489d
# endif
Packit Service a2489d
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
Packit Service a2489d
#if @GNULIB_POLL@
Packit Service a2489d
# if @REPLACE_POLL@
Packit Service a2489d
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit Service a2489d
#   undef poll
Packit Service a2489d
#   define poll rpl_poll
Packit Service a2489d
#  endif
Packit Service a2489d
_GL_FUNCDECL_RPL (poll, int, (struct pollfd *pfd, nfds_t nfd, int timeout));
Packit Service a2489d
_GL_CXXALIAS_RPL (poll, int, (struct pollfd *pfd, nfds_t nfd, int timeout));
Packit Service a2489d
# else
Packit Service a2489d
#  if !@HAVE_POLL@
Packit Service a2489d
_GL_FUNCDECL_SYS (poll, int, (struct pollfd *pfd, nfds_t nfd, int timeout));
Packit Service a2489d
#  endif
Packit Service a2489d
_GL_CXXALIAS_SYS (poll, int, (struct pollfd *pfd, nfds_t nfd, int timeout));
Packit Service a2489d
# endif
Packit Service a2489d
_GL_CXXALIASWARN (poll);
Packit Service a2489d
#elif defined GNULIB_POSIXCHECK
Packit Service a2489d
# undef poll
Packit Service a2489d
# if HAVE_RAW_DECL_POLL
Packit Service a2489d
_GL_WARN_ON_USE (poll, "poll is unportable - "
Packit Service a2489d
                 "use gnulib module poll for portability");
Packit Service a2489d
# endif
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
Packit Service a2489d
#endif /* _@GUARD_PREFIX@_POLL_H */
Packit Service a2489d
#endif /* _@GUARD_PREFIX@_POLL_H */