Below is the list of some of system programs that I have written while doing my academic assignments:
- File I/O (Lab1)
- Implement
lseekbehaviour using system calls likeopen(), close(), read(), write(), creat() etc..
- Files and Directories (Lab2)
- Use of APIs like
opendir(), file stat structure, readdir(), mkdir(), chmod(), chdir(), etc.. - Implementation of
realpath()behaviour file stat structure information and other APIs available. - Create a shared directory for usage with a purpose that any user (not super user) can create new files in this directory, but only the owner can delete his own files and everyone else can read all files.
- File I/O & File Stat (Lab3)
- Using
dup()function redirectstdinto file1 andstdoutto file2. Read a line usingscanfandwritethe same usingprintf. Verify the contents of both files. stat()function behaviour.- Understanding
umask()function.
- Process Environment (Lab4)
- Understanding
environment variables, adding and removingenvironment variables. - Observing variable states after calling
setjmp() and longjmp().
- Process Control (Lab5)
- A program to demostate, A child process inherits real
user id,real group id,effective user idandeffective group idof the parent process, whileprocess idandparent process idare not. - A program to Verify whether it is possible for a child process to handle a file opened by its parent
Immediately after the
fork()call. - Child and Parent behaviour after calling
fork().
- Process Control-Threding (Lab6)
- Write A program to take input from user for number of files to be scanned and word to be searched. write a multi threaded program to search the files and return pattern if found.
- A program to find number of CPUs, create that many threads and attach those threads to CPUs.
- Process Control-Inheritance (Lab7)
- Program to demostrate, the child
execcall inherits the file descriptors of parent ifClose_on_execis not set. - Creating different processes using
fork()for commands read from file. - Use of
SETUIDfor managing permissions.
- Process Control-Waiting (Lab8)
- Understanding
wait()system call. - Call
fork(). Let the child create a new session. Verify that the child becomes the process group leader and it does not have a controlling terminal. - A program to verify that a parent process can change the process
group IDof one of its children before the child performs anexec(), but not afterward.
- Signals (Lab9)
- Playing with different signal mechanisms.