CITS2002 Systems Programming  
prev
CITS2002 CITS2002 schedule  

C programs as good OS citizens

  • consistently indicate their success or failure with their exit status

  • consistenly accept command-line arguments
    (options, then filenames or data)

  • may receive more persistent configuration via environment variables
    (conveniently managed by interactive shells)

  • consistent representation of system-specific errors setting errno and reporting of error messages using perror()

  • consistent default data streams, stdin, stdout, stderr which may be redirected using shells

  • many utility programs perform as filters independently of how their input and output is obtained
    (command-line, keyboard & screen, redirected files, or pipes)

 


CITS2002 Systems Programming, Lecture 23, p8, 17th October 2023.