- 论坛徽章:
- 0
|
RedHat 9.0的glibc库版本太老,不支持epoll这个api。而且出于兼容性的考虑,不建议你升级glibc库到新版本,以免其他程序运行出错。如果你必须用RedHat这么老的版本的话,你只能用以下形式直接调用glibc底层_syscall1 _syscall3 _syscall4来使用epoll
- #define __sys_epoll_create(maxfds) _syscall1(int, sys_epoll_create, int, maxfds)
- #define __sys_epoll_ctl(epfd, op, fd, events) _syscall4(int, sys_epoll_ctl, \
- int, epfd, int, op, int, fd, unsigned int, events)
- #define __sys_epoll_wait(epfd, events, timeout) _syscall3(int, sys_epoll_wait, \
- int, epfd, struct pollfd **, events, int, timeout)
复制代码 sys_epoll_create sys_epoll_ctl sys_epoll_wait的内核常量值在对应内核的源码里查。比较老的内核应该是
- #define __NR_sys_epoll_create 254
- #define __NR_sys_epoll_ctl 255
- #define __NR_sys_epoll_wait 256
复制代码 |
|