Skip to content

All programs done as part of the course CS513 - Software Systems

License

Notifications You must be signed in to change notification settings

hkcc375/CS513-SoftwareSystems

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CS513

All programs done as part of the course CS513 - Software Systems.

Q1.) Create the following types of a files using (i) shell command (ii) system call a. soft link (symlink system call) b. hard link (link system call) c. FIFO (mkfifo Library Function or mknod system call)

Q2.) Write a simple program to execute in an infinite loop at the background. Go to /proc directory and identify all the process related information in the corresponding proc directory.

Q3.) Write a program to create a file and print the file descriptor value. Use creat ( ) system call.

Q4.) Write a program to open an existing file with read write mode. Try O_EXCL flag also.

Q5.) Write a program to create five new files with infinite loop. Execute the program in the background and check the file descriptor table at /proc/pid/fd.

Q6.) Write a program to take input from STDIN and display on STDOUT. Use only read/write system calls.

Q7.) Write a program to copy file1 into file2 ($cp file1 file2).

Q8.) Write a program to open a file in read only mode, read line by line and display each line as it is read. Close the file when end of file is reached.

Q9.) Write a program to print the following information about a given file. a. inode b. number of hard links c. uid d. gid e. size f. block size g. number of blocks h. time of last access i. time of last modification j. time of last change

Q10.) Write a program to open a file with read write mode, write 10 bytes, move the file pointer by 10 bytes (use lseek) and write again 10 bytes. a. check the return value of lseek b. open the file with od and check the empty spaces in between the data.

Q11.) Write a program to open a file, duplicate the file descriptor and append the file with both the descriptors and check whether the file is updated properly or not. a. use dup b. use dup2 c. use fcntl

Q12.) Write a program to find out the opening mode of a file. Use fcntl.

Q13.) Write a program to wait for a STDIN for 10 seconds using select. Write a proper print statement to verify whether the data is available within 10 seconds or not (check in $man 2 select).

Q14.) Write a program to find the type of a file. a. Input should be taken from command line. b. program should be able to identify any type of a file.

Q15.) Write a program to display the environmental variable of the user (use environ).

Q16.) Write a program to perform mandatory locking. a. Implement write lock b. Implement read lock

Q17.) Write a program to simulate online ticket reservation. Implement write lock Write a program to open a file, store a ticket number and exit. Write a separate program, to open the file, implement write lock, read the ticket number, increment the number and print the new ticket number then close the file.

Q18.) Write a program to perform Record locking. a. Implement write lock b. Implement read lock Create three records in a file. Whenever you access a particular record, first lock it then modify/access to avoid race condition.

Q19.) Find out the priority of your running program. Modify the priority with nice command.

Q20.) Write a program, call fork and print the parent and child process id.

Q21.) Write a program, open a file, call fork, and then write to the file by both the child as well as the parent processes. Check output of the file.

Q22.) Write a program to create a Zombie state of the running program.

Q23.) Write a program to create an orphan process.

Q24.) Write a program to create three child processes. The parent should wait for a particular child (use waitpid system call).

Q25.) Write a program to execute ls -Rl by the following system calls a. execl b. execlp c. execle d. execv e. execvp

Q26.) Write a program to get scheduling policy and modify the scheduling policy (SCHED_FIFO, SCHED_RR).

Q27.) Write a program to run a script at a specific time using a Daemon process

About

All programs done as part of the course CS513 - Software Systems

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published