[cs631apue] warm-up exercise

Jan Schaumann jschauma at stevens.edu
Mon Sep 10 11:07:42 EDT 2018


Hello,

If you have a few minutes before today's class, please do this little
warm-up exercise to prime your mental cache for tonight's lecture:

Write a program that:
- prints the value of STDIN FILENO, STDOUT FILENO, STDERR FILENO
- prints the value of the file descriptors referenced via the stdin,
  stdout, stderr streams
- open(2)'s a file, then prints the value of that file descriptor
- fopen(3)'s a file, then prints the value of the file descriptor
  referenced via that stream

What results do you expect?  Does the outcome match your expectations?

-Jan


More information about the cs631apue mailing list