Page MenuHomeFreeBSD

system(3): Fix null case
ClosedPublic

Authored by des on Tue, Feb 24, 1:44 PM.
Tags
None
Referenced Files
F147039949: D55484.id172585.diff
Sat, Mar 7, 8:13 PM
Unknown Object (File)
Thu, Mar 5, 1:08 AM
Unknown Object (File)
Tue, Mar 3, 8:19 PM
Unknown Object (File)
Mon, Mar 2, 6:18 AM
Unknown Object (File)
Sun, Mar 1, 2:24 PM
Unknown Object (File)
Sun, Mar 1, 3:41 AM
Unknown Object (File)
Sun, Mar 1, 3:40 AM
Unknown Object (File)
Sat, Feb 28, 3:13 PM
Subscribers

Details

Summary

Our manual page states that if given a null pointer, system() returns
non-zero if the shell is available and zero if it is not. This is
consistent with the C standard's description of system(), but it is not
what we actually do. What we actually do is always return non-zero, as
required by POSIX.

As the POSIX rationale explains, implementing the logic required by the
C standard does not violate POSIX, since a conforming system always has
a shell, therefore the logic will always return non-zero.

Since our libc is commonly used in non-conforming situations such as
chroots or thin jails, we should implement the full logic required by
the C standard.

Diff Detail

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