Git Product home page Git Product logo

splab3's Introduction

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

splab3's People

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.