Machine-translated by Google. Questions are authored in English.
Top

Discussion

Which of the following is NOT a system call ?

  • A.fork()
  • B.exit()
  • C.read()
  • D.printf()

Answer: D

printf() is not a system call.

printf() is a function of the C standard library (<stdio.h>). It formats its arguments into a buffer in user space and, when the buffer is flushed, calls the write() system call to pass the bytes to the kernel. So it uses a system call but is not one itself.

fork() (create a process) and read() (read from a file descriptor) are UNIX system calls. exit() is the standard interface for ending a process, through the kernel's exit system call, and textbooks list it with the process-control system calls.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.