1 System Calls in An Operating System
1 System Calls in An Operating System
Systems
1 Introduction
In an operating system, system calls provide an interface between a process
and the operating system kernel. These calls are used to perform tasks that
are critical for the execution of processes, such as file handling, process control,
memory management, and inter-process communication.
1
• close() - Closes a file.
• unlink() - Deletes a file.
2
3 Lab Exercises
Exercise 1: Process Creation and Termination
1. Write a C program that creates a child process using fork() and prints
the process ID of both parent and child processes.
2. Implement the exit() system call to terminate the child process and
display an appropriate message.
4 Conclusion
System calls are crucial for the execution of processes and facilitate interaction
between user-level programs and the kernel. Understanding these calls is es-
sential for developing low-level applications and interacting with the operating
system.