Skip to contentSkip to conversation

issue with epoll system call

DISCUSSION rohit verma 1 participant 1 message May 7, 2009

lore
Share & tools
lore
#0 lore raw

hi all,

The man pages of epoll_create says - "Since Linux 2.6.8, the size argument is unused.  (The kernel dynamically sizes the required data structures without needing this initial hint.)" .

Also, it says that the syscall returns EINVAL , when size is not positive. (i.e For, any value greater than 0, the kernel dynamically sizes the required data stuctures). When size is zero or less than zero, it has to return with error as EINVAL.

the link: http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=9fe5ad9c8cef9ad5873d8ee55d1cf00d9b607df0;hp=e38b36f325153eaadd1c2a7abc5762079233e540

shows the latest patch of the epoll syscall. here , the syscall says:

asmlinkage long sys_epoll_create(int size)
{
- return sys_epoll_create2(size,0);
+ if (size < 0)
+  return -EINVAL;
+
+return sys_epoll_create1(0);
}

So if size = 0, it returns success which might not be the expected result. So i feel that the condition check should be
" if (size <= 0) ". could u please check on this and reply me..

Thank you,

Regards,
rohit