3 ms·
Isn't it easier to have the parent print the error message by passing yet another pipe to the child that closes on exec and can be used to pass up errno?
by ben0x539 12y ago
Isn't it easier to have the parent print the error message by passing yet another pipe to the child that closes on exec and can be used to pass up errno?
- ridiculous_fish 12y agoThat's a good idea! I'm not sure if it's easier but it would effectively sidestep this class of issues.
- bdonlan 12y agoYou could also use an inherited shared memory segment (an anonymous mmap with MAP_SHARED) to report failure codes. Since you only need to set this up once, it could result in lower overhead than creating pipes for every exec.