Skip to content

NurdaRyspay/splab3

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 

Repository files navigation

splab3 - pipeline

Aim

  • Learn how to combine several processes in a pipeline using various system calls and pipes.

Task

In this lab you are to write a program in C that solves the same problem as in splab1. The program should use the same tools that you used in splab1, but the shell logic should be done by the C program itself. You should use system calls like fork, exec*, wait/waitpid, open, close, pipe, dup2, exit/_exit.

By shell logic we mean:

  • forking processes and waiting results from them
  • opening files and i/o redirection (using pipe)
  • if statements and loops (e.g. for/while) of bash.

Store your splab1 solution in ./solution/top and splab3 solution in ./solution/top.c.

References

  1. man fdopen
  2. man 2 fork
  3. man 2 execve
  4. man 2 waitpid
  5. man 2 pipe
  6. man 2 dup2
  7. OSTEP Chapter 5
  8. Chapters 6, 24-28 of Linux Programming Interface by Micheal Kerrisk
  9. Chapter 5 of Linux System Programming by Robert Love
Credits

About

splab3 - io system calls

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages

  • C 60.2%
  • Shell 39.8%