in reply to STDOUT changing descritpors
No, not without closing whatever handle has descriptor 1, then opening STDOUT - checking fileno to see if you got what you wanted.
There is no rule that says STDIN, STDOUT, STDERR are fileno 0, 1, 2. That's just their conventional default values. Closings and openings scramble the fileno values. It is an error to assume anything about those values.
A child process will never have its live inherited file handles changed by their modification in the parent. The parent handles have been duplicated by fork. The child's copies are still associated with the original file whatever the parent may do to modify its own.
After Compline,
Zaxo
|
|---|