summaryrefslogtreecommitdiff
path: root/Kernel/API/POSIX/poll.h
blob: c481ab61c751572491ad479a85a15521def9e58d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
 * Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org>
 *
 * SPDX-License-Identifier: BSD-2-Clause
 */

#pragma once

#include <Kernel/API/POSIX/sys/types.h>

#ifdef __cplusplus
extern "C" {
#endif

#define POLLIN (1u << 0)
#define POLLRDNORM POLLIN
#define POLLPRI (1u << 1)
#define POLLOUT (1u << 2)
#define POLLWRNORM POLLOUT
#define POLLERR (1u << 3)
#define POLLHUP (1u << 4)
#define POLLNVAL (1u << 5)
#define POLLWRBAND (1u << 12)
#define POLLRDHUP (1u << 13)

struct pollfd {
    int fd;
    short events;
    short revents;
};

typedef unsigned nfds_t;

#ifdef __cplusplus
}
#endif