Timeline for Why can't I run this C program?
Current License: CC BY-SA 3.0
11 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Aug 14, 2012 at 16:13 | vote | accept | Engine | ||
Aug 14, 2012 at 16:13 | vote | accept | Engine | ||
Aug 14, 2012 at 16:13 | |||||
Aug 14, 2012 at 9:36 | comment | added | OrangeDog |
@BruceEdiger learning how fork() works includes learning that it can copy buffered output. Being a reasonably complicated system call, some confusion is probably necessary in the learning process.
|
|
Aug 13, 2012 at 14:38 | comment | added | user732 | exit(0) will flush stdout and stderr. _exit(0) will not. You can end up with double outputs if there's some bytes on stdout when your program does the fork(), and the child calls exit(0). Because you're learning how fork() works why confuse yourself? | |
Aug 13, 2012 at 12:49 | comment | added | OrangeDog |
@BruceEdiger Why the need for _exit ? What's wrong with doing any cleanup that's been registered?
|
|
Aug 13, 2012 at 9:33 | answer | added | OrangeDog | timeline score: 23 | |
Aug 13, 2012 at 2:52 | history | tweeted | twitter.com/#!/StackUnix/status/234844775587659778 | ||
Aug 13, 2012 at 1:22 | comment | added | user732 | Just for the sake of your own sanity later, put a "break;" on the "case -1:" line. You'll thank yourself for it later. Also, have the child process call _exit(0), and the parent call exit(0). | |
Aug 13, 2012 at 0:42 | history | edited | Renan | CC BY-SA 3.0 |
added 51 characters in body; edited tags; edited title
|
Aug 13, 2012 at 0:31 | answer | added | Renan | timeline score: 68 | |
Aug 13, 2012 at 0:28 | history | asked | Engine | CC BY-SA 3.0 |