Demo: Which Entry a New Channel Gets¶
Read main() in lowest-fd.c and write down the number each open() will return, before running it.
Run¶
Ask¶
- What does
open()return afterclose(4)? What is the rule? - What does
open()return afterclose(0)? - From then on, where does
scanf()read from in this process? - How could a shell use this to run
sort < names.txt?