GATE CS 2021 Set 1 | Question 24
Operating Systems › Introduction & Process Management · MSQ · 1 mark · Answer: A, C
- Question 24Operating Systemsmsq1 markWhich 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
exitalways triggers theexit/_exitsystem call andsleepalways invokes a kernel timer (e.g.nanosleep).mallocmay satisfy a request from the existing heap without a syscall, andstrlenis pure user-space computation. - A.
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 →