epoll_create wrapper function is not used

Dmitry V. Levin ldv at altlinux.org
Tue Jun 30 16:43:40 UTC 2020

On Sun, Jun 28, 2020 at 10:24:23PM +0530, Bran S wrote:
> In tests/epoll_create.c:
>     const long int size = (long int) 0xdeadbeefffffffffULL;
>     long rc = syscall(__NR_epoll_create, size);
> Why syscall(__NR_epoll_create) is used when a wrapper function is
> available for it in #include <sys/epoll.h>? Are they different in some
> way? What is the reason for not using the wrapper?
> In manpage of epoll_create there is a line:
> "Library support is provided in glibc starting with version 2.3.2."
> Is this the reason? So that machines with glibc 2.3.2 can also use this?

epoll_create is a syscall obsoleted by epoll_create1, so some libc (e.g.
musl) implement epoll_create function using epoll_create1 syscall.

> Also, why the datatype of size parameter is 'long int'? epoll_create's
> prototype has got the size parameter's datatype to be 'int'.

This is a way of testing that extra bits are ignored.


More information about the Strace-devel mailing list