Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 Feb 2026 21:12:55 +0000
From:      Dag-Erling=?utf-8?Q? Sm=C3=B8rg?=rav <des@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 7305604b29d3 - main - system(3): Clarify return values
Message-ID:  <699f65d7.27fd7.233b8521@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch main has been updated by des:

URL: https://cgit.FreeBSD.org/src/commit/?id=7305604b29d3db29c9bb5de6e7a25829fb541d1e

commit 7305604b29d3db29c9bb5de6e7a25829fb541d1e
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-02-25 21:12:36 +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
---
 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 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 ,


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?699f65d7.27fd7.233b8521>