Multiple choice

Which of the following calls never returns an error?

  1. getpid

  2. fork

  3. ioctl

  4. open

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

The getpid system call retrieves the process ID of the calling process, which always succeeds and thus never returns an error. In contrast, fork, ioctl, and open can all fail under various system conditions such as resource exhaustion or invalid arguments.