There’s syscall which allows indirect system calls in Linux. What are the reasons to use it – and why is it better than direct call to the function?
There’s syscall which allows indirect system calls in Linux. What are the reasons to
Share
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.
Sometimes the kernel adds system calls and it takes a while for the C library to support them.
Or maybe you are compiling on an old Linux distribution, but want to run on a newer one.
Example code:
But in general, there is no advantage to using
syscallif the C library in your compilation environment has what you need. (For one thing, it is even less portable than using a Linux-specific interface, since the system call numbers vary by CPU.)