Page MenuHomeFreeBSD

Some clarifications for fork(2) and _Exit(3) man pages
ClosedPublic

Authored by kib on Aug 5 2021, 4:08 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Sep 24, 4:28 PM
Unknown Object (File)
Tue, Sep 24, 4:28 PM
Unknown Object (File)
Sun, Sep 8, 10:17 PM
Unknown Object (File)
Sun, Sep 8, 3:20 AM
Unknown Object (File)
Sat, Sep 7, 11:17 AM
Unknown Object (File)
Thu, Sep 5, 2:49 PM
Unknown Object (File)
Aug 22 2024, 6:23 AM
Unknown Object (File)
Aug 20 2024, 11:48 PM
Subscribers
None

Details

Summary

fork(2): comment about doubtful use of stdio and exit(3) in example
Add fflush(stdout) as the common idiom. Explain the need to use exit() but advise against it.

_Exit(3): document implementation

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kib requested review of this revision.Aug 5 2021, 4:08 PM
kib created this revision.
lib/libc/sys/fork.2
178

Maybe s/at least/and other possible issues/ or similar, if I understand correctly.

kib marked an inline comment as done.

reformulate 'at least'.

lib/libc/stdlib/exit.3
71 โ†—(On Diff #93333)

I do not understand what this is referring to: tmpfile() unlinks the newly created file before returning.

84 โ†—(On Diff #93333)

Assuming this refers to tmpfile(3), I do not see why.

kib marked 2 inline comments as done.

Remove references to tmpfile, add notion about destructors registered with __cxa_atexit(3)

This revision is now accepted and ready to land.Aug 8 2021, 4:31 PM