下面是函数调用情况:
SYSCALL_DEFINE3(poll, struct pollfd __user *, ufds, unsigned int, nfds,
long, timeout_msecs)
#define SYSCALL_DEFINE3(name, ...) SYSCALL_DEFINEx(3, _##name, __VA_ARGS__)
#define SYSCALL_DEFINEx(x, sname, ...) \
__SYSCALL_DEFINEx(x, sname, __VA_ARGS__)
#define __SYSCALL_DEFINEx(x, name, ...) \
asmlinkage long sys##name(__SC_DECL##x(__VA_ARGS__))
宏解析得到函数:
asmlinkage long sys_poll(struct pollfd __user * ufds, unsigned int nfds,
long timeout_msecs)
上面这个函数位于fs/select.c中
poll(struct pollfd *fds, nfds_t nfds, int timeout) 对超时参数进行一些处理后直接调用下面函数
ret = do_sys_poll(ufds, nfds, to) ‘
poll_initwait(&table)
init_poll_funcptr(table->pt, __pollwait) --> table->pt->qproc = __pollwait;
fdcount = do_poll(nfds, head, &ta