Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / native_client_sdk / src / libraries / nacl_io / include / sys / poll.h
blobd116253f41ab3aad0b096c7494c581a1c3ed9a24
1 /* Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 * Use of this source code is governed by a BSD-style license that can be
3 * found in the LICENSE file. */
5 #ifndef LIBRARIES_NACL_IO_INCLUDE_SYS_POLL_H_
6 #define LIBRARIES_NACL_IO_INCLUDE_SYS_POLL_H_
8 #include <stdint.h>
9 #include <sys/cdefs.h>
11 /* This header adds definitions of flags and structures for use with poll on
12 * toolchains with 'C' libraries which do not normally supply poll. */
14 /* Node state flags */
15 #define POLLIN 0x0001 /* Will not block READ select/poll. */
16 #define POLLPRI 0x0002 /* There is urgent data to read. */
17 #define POLLOUT 0x0004 /* Will not block WRITE select/poll. */
18 #define POLLERR 0x0008 /* Will not block EXECPT select/poll. */
19 #define POLLHUP 0x0010 /* Connection closed on far side. */
20 #define POLLNVAL 0x0020 /* Invalid FD. */
22 /* Number of file descriptors. */
23 typedef int nfds_t;
25 struct pollfd {
26 int fd;
27 uint16_t events;
28 uint16_t revents;
31 __BEGIN_DECLS
33 int poll(struct pollfd* __fds, nfds_t __nfds, int __timeout);
35 __END_DECLS
37 #endif /* LIBRARIES_NACL_IO_INCLUDE_SYS_POLL_H_ */