- 论坛徽章:
- 0
|
一、怀疑是系统调用过程中的问题。
这个问题有点难度。
二、当前进展:
1.用户态epoll_ctl函数调用到内核态sys_epoll_ctl后,我增加了一些调试信息,发现:事件类型epds.event的值是正确的,监控的文件描述符epds.data的值始终是零。
三、以下为内核态sys_epoll_ctl的源代码:
SYSCALL_DEFINE4(epoll_ctl, int, epfd, int, op, int, fd,
struct epoll_event __user *, event)
{
int error;
struct file *file, *tfile;
struct eventpoll *ep;
struct epitem *epi;
struct epoll_event epds;
error = -EFAULT;
if (ep_op_has_event(op) &&
copy_from_user(&epds, event, sizeof(struct epoll_event))) /*event是用户态传递给内核态的参数*/
goto error_return;
printk("[func:%s line:%d] epds.events = 0x%x and epds.data = %llu\n",
__FUNCTION__, __LINE__, epds.events, (__u64)epds.data); |
|