Below is the list of some of system programs that I have written while doing my academic assignments:
- File I/O (Lab1)
- Implement
lseek
behaviour 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 redirectstdin
to file1 andstdout
to file2. Read a line usingscanf
andwrite
the 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 id
andeffective group id
of the parent process, whileprocess id
andparent process id
are 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
exec
call inherits the file descriptors of parent ifClose_on_exec
is not set. - Creating different processes using
fork()
for commands read from file. - Use of
SETUID
for 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 ID
of one of its children before the child performs anexec()
, but not afterward.
- Signals (Lab9)
- Playing with different signal mechanisms.