musl-wiki
musl-wiki copied to clipboard
Thread-safety of system(3)
Hi!
POSIX doesn't require for system(3) to be thread-safe and musl doesn't implement it in this way either. However, the glibc man page explitely declares system(3) as thread-safe (without any clarifications how it is implemented). In fact, glibc's approach is similar to one used in Solaris.
For this reason, I think it is worth mentioning on https://wiki.musl-libc.org/functional-differences-from-glibc.html that glibc's behavior is a non-standard extension, and musl doesn't follow it. Right now the page lacks any mentions of system(3).
please discuss this on the mailing list or in musl irc channel. in general musl follows POSIX specification, not linux manpages, so man 3 system is irrelevant (use man 3p). imo if there's any change to be made to functional differences page it should be "musl follows the POSIX specification first and foremost when in doubt".