git: 83280570ea1f - stable/14 - system(3): Clarify return values
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 04 Mar 2026 14:45:14 UTC
The branch stable/14 has been updated by des:
URL: https://cgit.FreeBSD.org/src/commit/?id=83280570ea1fdc288bacdbabf7580c50fcc39355
commit 83280570ea1fdc288bacdbabf7580c50fcc39355
Author: Dag-Erling Smørgrav <des@FreeBSD.org>
AuthorDate: 2026-02-25 21:12:36 +0000
Commit: Dag-Erling Smørgrav <des@FreeBSD.org>
CommitDate: 2026-03-04 14:45:08 +0000
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
(cherry picked from commit 7305604b29d3db29c9bb5de6e7a25829fb541d1e)
---
lib/libc/stdlib/system.3 | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/lib/libc/stdlib/system.3 b/lib/libc/stdlib/system.3
index 7f1a34c69d2d..0b8a677c35b7 100644
--- a/lib/libc/stdlib/system.3
+++ b/lib/libc/stdlib/system.3
@@ -31,7 +31,7 @@
.\"
.\" @(#)system.3 8.1 (Berkeley) 6/4/93
.\"
-.Dd July 25, 2015
+.Dd February 24, 2026
.Dt SYSTEM 3
.Os
.Sh NAME
@@ -79,8 +79,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 ,