Skip to content

Commit 549673b

Browse files
authored
Merge pull request #1 from elicn/libumem-epoll-fixes
Refactor and fixes
2 parents f99e07a + 0022b8d commit 549673b

File tree

2 files changed

+206
-202
lines changed

2 files changed

+206
-202
lines changed

qiling/os/posix/const.py

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,26 +1065,28 @@ class qnx_mmap_prot_flags(QlPrettyFlag):
10651065
SHMGET = 23
10661066
SHMCTL = 24
10671067

1068-
# epoll syscall, see https://codebrowser.dev/glibc/glibc/sysdeps/unix/sysv/linux/sys/epoll.h.html
1069-
EPOLL_OPS = {
1070-
0x001: "EPOLL_CTL_ADD",
1071-
0x002: "EPOLL_CTL_DEL",
1072-
0x003: "EPOLL_CTL_MOD"
1073-
}
1074-
1075-
EPOLLIN = 0x001
1076-
EPOLLPRI = 0x002
1077-
EPOLLOUT = 0x004
1078-
EPOLLRDNORM = 0x040
1079-
EPOLLRDBAND = 0x080
1080-
EPOLLWRNORM = 0x100
1081-
EPOLLWRBAND = 0x200
1082-
EPOLLMSG = 0x400
1083-
EPOLLERR = 0x008
1084-
EPOLLHUP = 0x010
1085-
EPOLLRDHUP = 0x2000
1086-
EPOLLEXCLUSIVE = 268435456 #1 << 28
1087-
EPOLLWAKEUP = 536870912 #1 << 29
1088-
EPOLLONESHOT = 1073741824 #1 << 30
1089-
EPOLLET = 2147483648 #1 << 31
1090-
EPOLL_CLOEXEC = 0x02000000
1068+
# see: https://elixir.bootlin.com/linux/v5.19.17/source/include/uapi/linux/eventpoll.h
1069+
EPOLL_CTL_ADD = 1
1070+
EPOLL_CTL_DEL = 2
1071+
EPOLL_CTL_MOD = 3
1072+
1073+
EPOLLIN = 0x00000001
1074+
EPOLLPRI = 0x00000002
1075+
EPOLLOUT = 0x00000004
1076+
EPOLLERR = 0x00000008
1077+
EPOLLHUP = 0x00000010
1078+
EPOLLNVAL = 0x00000020
1079+
EPOLLRDNORM = 0x00000040
1080+
EPOLLRDBAND = 0x00000080
1081+
EPOLLWRNORM = 0x00000100
1082+
EPOLLWRBAND = 0x00000200
1083+
EPOLLMSG = 0x00000400
1084+
EPOLLRDHUP = 0x00002000
1085+
1086+
# TODO: should be aligned to emulated system's close-on-exec value
1087+
EPOLL_CLOEXEC = 0o2000000
1088+
1089+
EPOLLEXCLUSIVE = 0b1 << 28
1090+
EPOLLWAKEUP = 0b1 << 29
1091+
EPOLLONESHOT = 0b1 << 30
1092+
EPOLLET = 0b1 << 31

0 commit comments

Comments
 (0)