zoslib
z/OS C/C++ Library
Loading...
Searching...
No Matches
epoll.h
Go to the documentation of this file.
1
2// Licensed Materials - Property of IBM
3// ZOSLIB
4// (C) Copyright IBM Corp. 2020. All Rights Reserved.
5// US Government Users Restricted Rights - Use, duplication
6// or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
8
9#ifndef ZOS_SYS_EPOLL_H_
10#define ZOS_SYS_EPOLL_H_
11
12#define __XPLAT 1
13
14#include "zos-macros.h"
15
16#if (__EDC_TARGET < 0x42050000) && defined(ZOSLIB_ENABLE_V2R5_FEATURES)
17
18#include <sys/types.h>
19#include <stdint.h>
20
21/* epoll_create options */
22/* EPOLL_CLOEXEC: same value as O_CLOEXEC in fcntl.h */
23#define EPOLL_CLOEXEC 0x00001000
24
25/* epoll_ctl options */
26#define EPOLL_CTL_ADD 0
27#define EPOLL_CTL_MOD 1
28#define EPOLL_CTL_DEL 2
29
30/* epoll events */
31#define EPOLLRDNORM 0x0001
32#define EPOLLRDBAND 0x0002
33#define EPOLLIN 0x0003
34#define EPOLLOUT 0x0004
35#define EPOLLWRBAND 0x0008
36#define EPOLLPRI 0x0010
37#define EPOLLERR 0x0020
38#define EPOLLHUP 0x0040
39#define EPOLLEXCLUSIVE 0x20000000
40#define EPOLLONESHOT 0x40000000
41
42#if defined(__cplusplus)
43extern "C" {
44#endif
45
46typedef union epoll_data {
47 void * ptr;
48 int fd;
49 uint32_t u32;
50 uint64_t u64;
51} epoll_data_t;
52
53#if defined(__clang__) && !defined(__ibmxl__)
54struct epoll_event {
55 uint32_t events;
56 epoll_data_t data __attribute__((packed));
57};
58#else
59#pragma pack(1)
60struct epoll_event {
61 uint32_t events;
62 epoll_data_t data;
63};
64#pragma pack(reset)
65#endif
66
67__Z_EXPORT extern int (*epoll_create)(int);
68__Z_EXPORT extern int (*epoll_create1)(int);
69__Z_EXPORT extern int (*epoll_ctl)(int, int, int, struct epoll_event *);
70__Z_EXPORT extern int (*epoll_wait)(int, struct epoll_event *, int, int);
71__Z_EXPORT extern int (*epoll_pwait)(int, struct epoll_event *, int, int, const sigset_t *);
72
73#if defined(__cplusplus)
74}
75#endif
76
77#endif
78
79#endif
const unsigned char __ibm1047_iso88591[256] __attribute__((aligned(8)))
#define __Z_EXPORT
Definition zos-macros.h:13