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).
System calls are very heavy performance-wise since they imply a context switch into the kernel. Therefore, for a simple library function like strcpy
(whose functionality is effectively equivalent to while(*d++ = *s++)
, but potentially optimized for the architecture), a system call would not make any sense.
Note that a page fault during copying could result in a kernel context switch and the appearance of a system call, but that would not be a result of strcpy
directly calling a system call.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With