From nobody Fri Apr 3 08:23:17 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4fnBYx2jS9z6Y0GJ for ; Fri, 03 Apr 2026 08:23:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fnBYx1vbgz3qC7 for ; Fri, 03 Apr 2026 08:23:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1775204597; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CVJ1ijDWd+CN8nyi8k5ZUaMDoqxUXPTyouYAAQNnCck=; b=UUUNJ6N+1aLpV5oQmzNdIrT13wJQs86giWIY3yFd3a7UMZ5twS0vyfnTIXtVp1mBdwvMLW izE0MnmVeTTghT8nhWP70w6VDNkX3V0E6dwR2jc02VJ6XER4tW/ja/Px6zo8OX3R5xGqlE mlKuGF1oL3HMLzhfHGy1eDlfrqjIkSD7kQBqJjD4LaqanFMCQYkfz0EL2BTPuIUczjOSD2 iAiJAcfilBDb30c4Iy9CSiGQVNZDNbL+uurqDI7YcViEKPIXtBQWti+iwnJETGBVRpnoIa B53rOUqJkUbu2hIFzQewbPsHg000Wbq5gPDY16rIjxGGZ0OqeQDT8SHGlCZtrQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1775204597; a=rsa-sha256; cv=none; b=eOg7MZfVuTScBMahQ2w+sKxXYr7X+AtDIFckVQTVjK3WolKj3Iz3U1gDKbUhXdK6OenKr6 lUvKMyUMJ0GjvtGsxKSH7pAZKoI4GaaGjr7LdZ9FmyxXsmGGA8NCY66B3HmafS/Ir/Q+1T URsQGhSefbcp3GeAE5hcGJe56Vl0G09NiEpRZ2OCwCeDGv0BB3s+NMfWZXAacI5sfRxmyz Ybu+VuI6F4JMXdH5DuVRTHoT3xS8LzqQeKknC1Iio7STrmj8enQBnunLUSkR1h8p8oqBAk N7zCEMPqDAXbXQl+Fgjqy0jJWf+Flhnvt8bcngZOvPSn3nsJBDbj3Y7D3iXWow== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1775204597; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CVJ1ijDWd+CN8nyi8k5ZUaMDoqxUXPTyouYAAQNnCck=; b=U/lWFcSbfaPUHdvWbVf0FYW3KQjiO+AJplRiSoV/wPd5z8zdvfOkXHQvkee5kiiHT37JZz pm7Z/iaZzxxzobaCPHOuUYBF2ARYsJa2VpQtCIpRbB44EErni6C9snnpatdjAg4vr8vzfE A1Nmz74BIYN4c/3WpEiuEPbnd1pyzCPvx6N0RT3fyUqbcFa78rwtCMUWDfbMCE3jBOGGb4 JtVWY0QRLtNodngaOJcW/tKKgr52woY9dxbHN0KEJDyaD9Fie8BM2J0gMuB4E7ULuN9EMw G9jeBJO+6YYr/IGio7uh5Oh86CxochiZsfDu1YQKQo30I7LfdTW0SiJVWhVyeg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fnBYx1SDnzgrY for ; Fri, 03 Apr 2026 08:23:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 33731 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 03 Apr 2026 08:23:17 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 7caa71145c5e - main - posix_spawn: actions chdir and fchdir are now required by POSIX List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7caa71145c5eea5925c295e0cdd95b517005acf9 Auto-Submitted: auto-generated Date: Fri, 03 Apr 2026 08:23:17 +0000 Message-Id: <69cf78f5.33731.1b36b6c7@gitrepo.freebsd.org> The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=7caa71145c5eea5925c295e0cdd95b517005acf9 commit 7caa71145c5eea5925c295e0cdd95b517005acf9 Author: Konstantin Belousov AuthorDate: 2026-04-02 07:57:58 +0000 Commit: Konstantin Belousov CommitDate: 2026-04-03 08:22:53 +0000 posix_spawn: actions chdir and fchdir are now required by POSIX Drop the _np suffix. Reviewed by: dim Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D56222 --- ObsoleteFiles.inc | 4 ++++ include/spawn.h | 4 ++++ lib/libc/gen/Makefile.inc | 4 ++-- lib/libc/gen/Symbol.map | 2 ++ lib/libc/gen/posix_spawn.3 | 4 ++-- lib/libc/gen/posix_spawn.c | 5 +++++ lib/libc/gen/posix_spawn_file_actions_addopen.3 | 29 +++++++++++++++---------- 7 files changed, 36 insertions(+), 16 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 0f8fd14e2c44..a4fdac95bf5a 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -51,6 +51,10 @@ # xargs -n1 | sort | uniq -d; # done +# 20260402: posix_spawn_file_actions_addchdir lost _np suffix +OLD_FILES+=usr/share/man/man3/posix_spawn_file_actions_addchdir_np.3.gz +OLD_FILES+=usr/share/man/man3/posix_spawn_file_actions_addfchdir_np.3.gz + # 20260324: test file renamed OLD_FILES+=usr/tests/sys/netinet/tcp_implied_connect diff --git a/include/spawn.h b/include/spawn.h index 636b20755238..e0b11d78d595 100644 --- a/include/spawn.h +++ b/include/spawn.h @@ -85,6 +85,10 @@ int posix_spawn_file_actions_addopen(posix_spawn_file_actions_t * __restrict, int, const char * __restrict, int, mode_t); int posix_spawn_file_actions_adddup2(posix_spawn_file_actions_t *, int, int); int posix_spawn_file_actions_addclose(posix_spawn_file_actions_t *, int); +int posix_spawn_file_actions_addchdir(posix_spawn_file_actions_t * + __restrict, const char * __restrict); +int posix_spawn_file_actions_addfchdir(posix_spawn_file_actions_t *, + int); #if __BSD_VISIBLE int posix_spawn_file_actions_addchdir_np(posix_spawn_file_actions_t * diff --git a/lib/libc/gen/Makefile.inc b/lib/libc/gen/Makefile.inc index 28e55f58ccf3..c36c4e10f2dc 100644 --- a/lib/libc/gen/Makefile.inc +++ b/lib/libc/gen/Makefile.inc @@ -468,8 +468,8 @@ MLINKS+=posix_spawn.3 posix_spawnp.3 \ posix_spawn_file_actions_addopen.3 posix_spawn_file_actions_addclose.3 \ posix_spawn_file_actions_addopen.3 posix_spawn_file_actions_addclosefrom_np.3 \ posix_spawn_file_actions_addopen.3 posix_spawn_file_actions_adddup2.3 \ - posix_spawn_file_actions_addopen.3 posix_spawn_file_actions_addchdir_np.3 \ - posix_spawn_file_actions_addopen.3 posix_spawn_file_actions_addfchdir_np.3 \ + posix_spawn_file_actions_addopen.3 posix_spawn_file_actions_addchdir.3 \ + posix_spawn_file_actions_addopen.3 posix_spawn_file_actions_addfchdir.3 \ posix_spawn_file_actions_init.3 posix_spawn_file_actions_destroy.3 \ posix_spawnattr_getflags.3 posix_spawnattr_setflags.3 \ posix_spawnattr_getexecfd_np.3 posix_spawnattr_setexecfd_np.3 \ diff --git a/lib/libc/gen/Symbol.map b/lib/libc/gen/Symbol.map index ddbd0522e13f..60f34b3a1923 100644 --- a/lib/libc/gen/Symbol.map +++ b/lib/libc/gen/Symbol.map @@ -475,6 +475,8 @@ FBSD_1.8 { }; FBSD_1.9 { + posix_spawn_file_actions_addchdir; + posix_spawn_file_actions_addfchdir; posix_spawnattr_getexecfd_np; posix_spawnattr_getprocdescp_np; posix_spawnattr_setexecfd_np; diff --git a/lib/libc/gen/posix_spawn.3 b/lib/libc/gen/posix_spawn.3 index 9fa370a7960f..0f25fc348610 100644 --- a/lib/libc/gen/posix_spawn.3 +++ b/lib/libc/gen/posix_spawn.3 @@ -446,11 +446,11 @@ action. .Xr sched_setscheduler 2 , .Xr setpgid 2 , .Xr vfork 2 , -.Xr posix_spawn_file_actions_addchdir_np 3 , +.Xr posix_spawn_file_actions_addchdir 3 , .Xr posix_spawn_file_actions_addclose 3 , .Xr posix_spawn_file_actions_addclosefrom_np 3 , .Xr posix_spawn_file_actions_adddup2 3 , -.Xr posix_spawn_file_actions_addfchdir_np 3 , +.Xr posix_spawn_file_actions_addfchdir 3 , .Xr posix_spawn_file_actions_addopen 3 , .Xr posix_spawn_file_actions_destroy 3 , .Xr posix_spawn_file_actions_init 3 , diff --git a/lib/libc/gen/posix_spawn.c b/lib/libc/gen/posix_spawn.c index 656c0f20f798..11cdb5a29d03 100644 --- a/lib/libc/gen/posix_spawn.c +++ b/lib/libc/gen/posix_spawn.c @@ -549,6 +549,8 @@ posix_spawn_file_actions_addchdir_np(posix_spawn_file_actions_t * STAILQ_INSERT_TAIL(&(*fa)->fa_list, fae, fae_list); return (0); } +__weak_reference(posix_spawn_file_actions_addchdir_np, + posix_spawn_file_actions_addchdir); int posix_spawn_file_actions_addfchdir_np(posix_spawn_file_actions_t *__restrict fa, @@ -571,6 +573,9 @@ posix_spawn_file_actions_addfchdir_np(posix_spawn_file_actions_t *__restrict fa, return (0); } +__weak_reference(posix_spawn_file_actions_addfchdir_np, + posix_spawn_file_actions_addfchdir); + int posix_spawn_file_actions_addclosefrom_np (posix_spawn_file_actions_t * __restrict fa, int from) diff --git a/lib/libc/gen/posix_spawn_file_actions_addopen.3 b/lib/libc/gen/posix_spawn_file_actions_addopen.3 index 80bc91454471..1d0eac45f872 100644 --- a/lib/libc/gen/posix_spawn_file_actions_addopen.3 +++ b/lib/libc/gen/posix_spawn_file_actions_addopen.3 @@ -40,8 +40,8 @@ .Nm posix_spawn_file_actions_adddup2 , .Nm posix_spawn_file_actions_addclose , .Nm posix_spawn_file_actions_addclosefrom_np , -.Nm posix_spawn_file_actions_addchdir_np , -.Nm posix_spawn_file_actions_addfchdir_np +.Nm posix_spawn_file_actions_addchdir , +.Nm posix_spawn_file_actions_addfchdir .Nd "add open, dup2, close, closefrom, or chdir/fchdir actions to spawn file actions object" .Sh LIBRARY .Lb libc @@ -72,12 +72,12 @@ .Fa "int from" .Fc .Ft int -.Fo posix_spawn_file_actions_addchdir_np +.Fo posix_spawn_file_actions_addchdir .Fa "posix_spawn_file_actions_t *restrict file_actions" .Fa "const char *restrict path" .Fc .Ft int -.Fo posix_spawn_file_actions_addfchdir_np +.Fo posix_spawn_file_actions_addfchdir .Fa "posix_spawn_file_actions_t * file_actions" .Fa "int fildes" .Fc @@ -189,9 +189,9 @@ For each open file descriptor, logically the close action is performed, and any possible errors encountered are ignored. .Pp The -.Fn posix_spawn_file_actions_addchdir_np +.Fn posix_spawn_file_actions_addchdir and -.Fn posix_spawn_file_actions_addfchdir_np +.Fn posix_spawn_file_actions_addfchdir functions add a change current directory action to the object referenced by .Fa file_actions @@ -201,11 +201,11 @@ in the order of insertion into the object. It also sets the working directory for the spawned program. The -.Fn posix_spawn_file_actions_addchdir_np +.Fn posix_spawn_file_actions_addchdir function takes the .Fa path to set as the working directory, while -.Fn posix_spawn_file_actions_addfchdir_np +.Fn posix_spawn_file_actions_addfchdir takes the directory file descriptor. .Sh RETURN VALUES Upon successful completion, these functions return zero; @@ -250,11 +250,8 @@ is equal to A future update of the Standard is expected to require this behavior. .Pp The -.Fn posix_spawn_file_actions_addchdir_np , -.Fn posix_spawn_file_actions_addfchdir_np , -and .Fn posix_spawn_file_actions_addclosefrom_np -functions are non-standard functions implemented after the similar +function is non-standard and implemented after the similar functionality provided by glibc. .Sh HISTORY The @@ -271,5 +268,13 @@ and .Fn posix_spawn_file_actions_addclosefrom_np functions first appeared in .Fx 13.1 . +In +.Fx 16.0 , +the +.Fn posix_spawn_file_actions_addchdir , +.Fn posix_spawn_file_actions_addfchdir +aliases where added to the corresponding functions with the +.Ql _np +suffix. .Sh AUTHORS .An \&Ed Schouten Aq Mt ed@FreeBSD.org