aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDag-Erling Smørgrav <des@FreeBSD.org>2026-02-25 21:12:36 +0000
committerDag-Erling Smørgrav <des@FreeBSD.org>2026-02-25 21:12:36 +0000
commit7305604b29d3db29c9bb5de6e7a25829fb541d1e (patch)
tree91fb3d60ab71671ed3a583b265b1528a491feda2
parent7a1ade5109ac57d1f59eaa75b5d0f13fabecf6ba (diff)
system(3): Clarify return values
Our manual page currently states that system() will return 127 if it fails to execute the shell. The actual return value is, to quote POSIX, “as if the command language interpreter had terminated using exit(127) or _exit(127)”. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: bnovkov, kevans Differential Revision: https://reviews.freebsd.org/D55483
-rw-r--r--lib/libc/stdlib/system.38
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/libc/stdlib/system.3 b/lib/libc/stdlib/system.3
index 119432342f70..f09577099a5c 100644
--- a/lib/libc/stdlib/system.3
+++ b/lib/libc/stdlib/system.3
@@ -29,7 +29,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd January 11, 2024
+.Dd February 24, 2026
.Dt SYSTEM 3
.Os
.Sh NAME
@@ -77,8 +77,10 @@ or \-1 if an error occurred when invoking
.Xr fork 2
or
.Xr waitpid 2 .
-A return value of 127 means the execution of the shell
-failed.
+If the child process fails to execute the shell, it will terminate
+with an exit code of 127 and
+.Nm
+will return the corresponding exit status.
.Sh SEE ALSO
.Xr sh 1 ,
.Xr execve 2 ,