/oslab

operating systems lab s7

Primary LanguageC

#OSLAB #CS 17L2 NETWORKS AND OPERATING SYSTEMS LABORATORY

##CYCLE I ###Expt No:1

####STUDY OF SYSTEM CALLS

AIM: To study the system calls – create(), open(), read(), write(), close(), sleep(), exit(), unlink(), kill(), getpid(), getppid(), getuid(), getgid(), geteuid(), getegid(), fork(), system(), pipe(), mknod(), execl(), wait(),socket()

creat() system call

<Header files, syntax and description>

open() system call

<Header files, syntax and description>

read() system call

<Header files, syntax and description>

write() system call

<Header files, syntax and description>

close() system call

<Header files, syntax and description>

sleep() system call

<Header files, syntax and description>

exit() system call

<Header files, syntax and description>

unlink() system call

<Header files, syntax and description>

kill() system call

<Header files, syntax and description>

####Program No: (i): To get the process id, parent process id, real user id, real group id, effective user id, effective group id.

<Header files, syntax and description of getpid(), getppid(), getuid(), getgid(), geteuid(), getegid()>

Program, Execution Steps, Output

Case 1: Same real user and effective user

Case 2: Different real user and effective user

####Program No: (ii): Familiarization of fork() system call

<Header files, syntax and description>

Program, Execution Steps, Output

####Program No: (iii): Familiarization of system() system call

<Header files, syntax and description>

Program, Execution Steps, Output

####Program No: (iv): Familiarization of pipe() system call <Header files, syntax and description>

Program, Execution Steps, Output

####Program No: (v): To create a FIFO (named pipe)

<Header files, syntax and description>

Program, Execution Steps, Output

####Program No: (vi): Familiarization of execl() system call

<Header files, syntax and description>

Program, Execution Steps, Output

####Program No: (vii): Familiarization of wait() system call

<Header files, syntax and description>

Program, Execution Steps, Output

Case 1: Executing without wait system call

Case 2: Executing with wait system call

####Program No: (viii): Familiarization of socket() system call

<Header files, syntax and description>

Program, Execution Steps, Output

##Expt No:2 ##FILE TYPE AIM: To print the type of a given file

<Header files, syntax and description>

Program, Execution steps, Output for regular file, character special file, block special file, directory, fifo, symbolic link, socket

##Expt No:2 ##FILE ATTRIBUTES AIM: To accept a file name from the keyboard and display the following attributes of the file

a) Access permissions b) i-node number c)Time of last file access d) Time of last file modification e) File Size

<Header files, syntax and description>

Program, Execution steps, Output

##Expt No:2 ##STUDY OF SIGNALS AIM: To study the signals – SIGINT, SIGCLD, SIGQUIT,SIGALRM

<Header files, syntax and description>

Program, Execution steps

Output

Case 1: While pressing Ctrl + C

Case 2: While pressing Ctrl + /

Case 3: Without pressing Ctrl + C & Ctrl + /