下载openjdk源码
openjdk GitHub源码 https://github.com/openjdk/jdk8
ctrl+N 搜索class,如下得到3个类,选择solaris linux版本进入
进入DefaultSelectorProvider
可以看到create()方法中Linux系统调用的是EPollSelectorProvider
ctrl+N 搜索EPollSelectorProvider
进入可以看到如下new了EPollSelectorImpl 实现类
进入EPollSelectorImpl
看到如下构造函数,可以看到构造方法new了EPollArrayWrapper对象,查看此对象
进入EPollArrayWrapper
EPollArrayWrapper构造方法调用了epollCreate
定位到epollCreate,发现是native方法
native为linux底层方法,C语言开发的
查找native方法,Ctrl+Shift+R,用类名_epoll
可以看到是.c结尾的文件,为C语言
到这里epoll_create已经跟踪不了了,因为它是linux内核函数
进入linux系统,查看linux手册
1, 安裝man
yum install man-pages
2,查找方法man xxx
man epoll_create