I’m reading the source code of libevent,and when it needs to call epoll_create,it uses
syscall insteaded.
int epoll_create(int size)
{
return (syscall(__NR_epoll_create, size));
}
Will the latter case give a perfomance improvement?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
What you’re seeing is pretty much expected. If you poke around the kernel you’ll see most references to
epoll_create()are down in thearchdirectory, meaning they are very much architecture dependent. As such it’s pretty standard that it can’t be invoked directly from userspace.As for efficiency, take a look man syscall.
As it states in there:
Often the glibc wrapper function is quite thin, doing little work other thancopying arguments to the right registers before invoking the system call, and
then setting errno appropriately after the system call has returned.
So no, typically there’s no big performance hit by this implementation.