I want to know if there is any libc function that does not invoke any syscall()? For example, for the libc function “strcpy()”, does it any syscall (let’s consider all possible linux systems).
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.
syscalls are somewhat like an interface from the userland (the place where your program runs) to the kernel land. They are needed when you’re doing things which only the kernel can, like communicating with hardware (e.g. read bytes from the network card, starting a process, even allocating memory via malloc (using
brk), etc.).Userland functions on the other hand, like
strcpy, are not indented to do syscalls. They don’t need special privileges to do what they do, they just operate on the memory of the process in user land.As syscalls introduce a major performance penalty (changing modes from user to kernel land and back is costly), having those in a often called function like
strcpywouldn’t make sense from a design point of view and are as such unlikely to be seen.