当我试图在 RHEL 5.5 服务器上手动编译 squid 时,运行configure
并得到
configure: WARNING: Eep! Cannot find epoll, kqueue, /dev/poll, poll or select!
configure: WARNING: Will try select and hope for the best.
configure: Using select for the IO loop.
看起来内核没有配置CONFIG_EPOLL
. 所以我尝试编译这个示例 epoll 程序来检查它是否有效。
在我的 gentoo 机器上(CONFIG_EPOLL
已启用。),它的编译没有任何问题。
在服务器上,我得到了
/tmp/cc8PhJh0.o: In function 'main':
epoll-exmaple.c:(.text+0x262): undefined reference to 'epoll_create1'
collect2: ld returned 1 exit status
我们都知道 c 程序编译器在 *.h 文件中查找定义,链接器将它们与 *.so 文件链接。
我的问题是,epoll_create1
是对内核的系统调用。链接器究竟搜索哪个文件来定位该系统调用的实现?
谢谢。