Question:

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?

Show Hint

Process control and scheduling functions always require kernel involvement.
Updated On: Jan 30, 2026
  • \texttt{exit}
  • \texttt{malloc}
  • \texttt{sleep}
  • \texttt{strlen}
Hide Solution
collegedunia
Verified By Collegedunia

The Correct Option is A, C

Solution and Explanation

Step 1: Identify functions requiring kernel interaction.
A system call is required when a function needs kernel services such as process control or scheduling.

Step 2: Analyze each option.
\texttt{exit} always invokes a system call to terminate the process.
\texttt{sleep} always invokes a system call to suspend execution.
\texttt{malloc} may allocate memory from user-space heap and does not always invoke a system call.
\texttt{strlen} is purely a user-space function and never invokes a system call.

Step 3: Conclusion.
Therefore, only \texttt{exit} and \texttt{sleep} always invoke system calls.

Was this answer helpful?
0
0