GATE 2021 CS – Question 24
Which of the following standard C library functions will always invoke a system call when executed from a single-threaded process in a UNIX/Linux operating system?
Practise this question in The GATE Grind →
Show answer and explanation
Correct answer: (A) exit; (C) sleep
Explanation
exit ends with the _exit system call and sleep uses nanosleep/alarm-type calls. malloc may serve requests from already-mapped heap memory, and strlen is pure user-space code.