Process control system
calls
File Management System Calls
Device Management System Calls
100

What does the fork() system call do?

It creates a new process by duplicating the current process.

100

What system call is used to open a file?

open()

100

What system call configures a device like a terminal?

ioctl()

200

Explain the difference between fork() and exec()?

fork() creates a new process, exec() replaces the current process image with a new one.

200

Describe what happens when read() is called on a file descriptor?

Data is read from the file into a buffer in memory.

200

Explain how read() differs when used on a device vs a regular file.

On devices, read() gets real-time input (e.g., from keyboard), unlike static file data.

300

Write a small scenario where wait() is used in a parent process?

A parent process creates a child using fork() and then uses wait() to pause until the child finishes

300

How would you write “Hello” into a file named test.txt using system calls?

Use open() with write flag, then write() to write the text, and close() afterward.

300

How would you read from a USB device in Linux?

Use open() to access the device file (e.g., /dev/sda), then read().

400

What happens if a process calls fork() multiple times in a loop?

Multiple child processes are created, possibly exponentially depending on structure.

400

Analyze the impact of not closing a file after using it?

It can lead to memory leaks, file descriptor exhaustion, or data not being written properly.

400

Analyze the advantages and disadvantages of using ioctl() for device control.Pros:

pros: flexible, powerful; 

Cons: device-specific, harder to standardize.

500

Design a process management routine using fork(), exec(), and wait() to load a new program.

Use fork() to create a child, exec() to load the new program, and wait() in the parent to wait for child termination.

500

Write a pseudo-code to read the first 100 bytes of a file and print it.

Use open() → read() → write() to STDOUT → close()

500

Design a system to control fan speed using a device file and ioctl().

Identify the device file → Use open() → Set speed with ioctl() → close()