atexit(3) is one of the cases when _exit(2) must be used instead of exit(3).
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
We're a bit outside my expertise here, but initial thoughts:
atexit(3) is one of the cases when _exit(2) must be used instead of exit(3).
Shouldnt the cross-reference go the other way for discoverability then? atexit should link to _exit(2)?
Yes, I guess that would be a good idea. atexit(3) does describe the _exit(2) thing, but it doesn't have a cross-reference to it in SEE ALSO section.
Also, please update diffs with -U9999 so we can see all the context. Alternatively, try using src/tools/tools/git/git-arc.sh, which also has a manual in that dir too.
| lib/libsys/_exit.2 | ||
|---|---|---|
| 111 | Based on my comment above, again from not really understanding the implications of using the function, I don't think this is useful flow of information, to reference a function that requires a call from that calls manual. | |
| lib/libsys/_exit.2 | ||
|---|---|---|
| 111 | In most cases, programmers should use exit(3), which is a wrapper for _exit(2). From _exit(2): Most C programs call the library routine exit(3), which flushes buffers, closes streams, unlinks temporary files, etc., before calling _exit(). However, when function is registered to be called at program exit with atexit(3), then this function should not use exit(3) inside. Instead, it should use _exit(2) or abort(3). But of course, if this would be, as you said, not very useful, then I guess we could leave only _exit(2) reference from in atexit(3). | |