USP Materials

Home > Courses > USP

Unit 1

1. Program to list contents of a directory given as command line argument.(1.3)

2. Program to copy data from standard input to standard output(using read & write).(1.4)

3. Program to copy data from standard input to standard output(using standard IO)(1.5)

4.  Implement a simple command interpreter program(Read command from terminal and execute them.Use fork,exec & waitpid)( 1.7)

5. Program to check a file is seekable or not.(3.1)

6. Program to create a file with a hole.(3.2)

Unit 2

1. Program to display the type of the file given as command line argument.(4.3)

2. Program to check access permission of the user on a given file(access function).(4.8)

3. Program to change file creation mask of a process.(4.9)

4. Program to read and change mode of file(Use functions stat & chmod) (4.12)

5. Program to unlink a file while it is open.(4.16)

6. Program to truncate a given file without changing its access time and modification time.(4.21)

Unit 3

1. Write a program to define two exit handler functions and register them so that they are automatically called when the program terminates.Verify the invocation of both exit handlers on process termination (7.3)

2. Write a program to display any number of command line arguments passed to it from the terminal. (7.4)

3. Write a command interpreter simulation program to demonstrate use of setjmp and longjmp.(7.11)

4. Write a program to demonstrate the impact of jump across functions on various types of variable(global,static, volatile etc.) (7.13)

5. Write a program to display the various resource limits of a process. (7.16m).

6. Write a program to create a child process and show that child and parent do not share same DS and SS.( 8.1)

7. Write a program to demonstrate use of function vfork and show that child and parent share same DS and SS.( 8.3)

8. Write a program to create a child process.The parent process shall wait for the termination of the child and print the exit status value of the child(8.6 )

9. Write a program to avoid creation of zombie process even when the parent process do not wait for the child(8.8).

Additional Programs:

1. Program to read and display the contents of file given as command line argument.

2. Program to find the size of given file(using read function).

3. Write UNIX program to copy a file using read & write functions.

(src and dest file names passed as command line argument)

4. Write program to find the size of a file using lseek function.

5. Write program to find the size of a file using stat function.

6. Program to split a given file into 3 files of sizes in the ratio 2:3:5.

7. Write a prgram to demonstrate usage of all the three ways to access the environment variables(main function parameter: envp, environ pointer, getenv function) (7.5.c)

8. Write a simple program to demonstrate use of functions: setjmp and longjmp  to jump across functions. (jmp.c)

9. Write a program to demonstrate the scenario of a process becoming zombie.(8.8z.c)