GATE CS 2021 Set 1 | Question 24

Operating Systems › Introduction & Process Management · MSQ · 1 mark · Answer: A, C

  1. Question 24Operating Systemsmsq1 mark
    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?
    • A.
      exit
      ✓
    • B.
      malloc
    • C.
      sleep
      ✓
    • D.
      strlen

    Answer: A, C

    Solution

    exit always triggers the exit/_exit system call and sleep always invokes a kernel timer (e.g. nanosleep). malloc may satisfy a request from the existing heap without a syscall, and strlen is pure user-space computation.

More GATE PYQ on Introduction & Process Management

All GATE CS Operating Systems PYQ →

Attempt GATE CS 2021 Set 1 in real GATE exam mode

Full paper with a timer, the GATE interface and a topic-wise analysis — free.

Create free account →