CS FundamentalsHardGATE CS

After a successful exec() call, which of these is preserved from the calling process?

  1. A. The code, data and stack segments
  2. B. The signal handlers installed with signal()
  3. C. The process ID and (by default) open file descriptors
  4. D. The heap allocations made with malloc

Correct answer: C. The process ID and (by default) open file descriptors

exec replaces the address space (code, data, heap, stack) and resets caught signal handlers to default, but the PID stays the same and file descriptors without close-on-exec remain open.

More Operating Systems questions

Exams that ask this topic