From nobody Sun Jan 25 17:20:56 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 4dzdjj0yFbz6PpdG for ; Sun, 25 Jan 2026 17:20:57 +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 "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dzdjh4cX7z3WXS for ; Sun, 25 Jan 2026 17:20:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1769361656; 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=+5JUCudFidhMkEwxRMQcThQtMsRm/PZ5tbpCPARydKU=; b=feWTqcXA226YagK+JU6m+rT2O2YLbXJJ/6aHLtn5e6E36vnYy/abvZQgkyi6litE2kcy7s m8kJDcSYzgrbW2vZIAGVgFxnvmmwlnUq97YrX0pbyCTRm//1IS8tUwPccNlsd/YqXssI7R SVbbI3Z5ff5HY0btcNBV1VTYD6c+4rk3QmPymVPFMaszsLVA6wg3LyZwXqo9gHMD73z50b /HUvX7+Pz+PtZ6LkTTiTrdXip2RTJN5dMptpMyYNaBCJTiZlrOdgtGX4T1uLOv3I1NsDdL Sy+HpB3P1ZJkCXfjhJHC9iJT7drjsC3UnC7OT7+a5wvF73zsNLmYpFZM29tgdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1769361656; 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=+5JUCudFidhMkEwxRMQcThQtMsRm/PZ5tbpCPARydKU=; b=WC7WcsnzsXs8/HBDLMByauA6V/TuHskLCmVCS3V+6iXayzfPkRewYCoyZ+MjOowFqJrOk9 DPWfw6FoqOMqi3A99gbiuJnyY5XoivFzbdY4OwxORtXTzZbHh9meY2kQars49bzgatuEqO NZuk+fmh0SPEUpbXZCmA7CSZewgEbrKAR6bntUNwnMnPOWzgFbxSur9vhgxcs5oH8utrmG oAMcMiekaAuzb+JRSQ5/8V4po0cCcHX0iKsUaRf7M9i1TcazrcYNx/REoqwCEkPenhkGec +Zhq8x1L9F5MYxOZ7ZqahifHDO2+jQm8o5jReCUzV9i6ZkjD0wg5VRSZo+oM9g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1769361656; a=rsa-sha256; cv=none; b=S31kncZWZHpsfdBluqkuwXq3eiVFppHUdlnzywk3LlCBOvZ52VX74TH8y53/+DRZ39jBEg DEmmKSDb2GkI5Adb44yjFby5Cr6twfb+kmX5QDv47XwdWEC5wJo8jz6jQCkMvwl9rNuw8B ecuLTPpkuUCjtiqYU70Tzub6MZfn4Yg4d0pa+j6zUOWBqcnYow3U8Ey8LzlE07e7J5knc2 B3bUnJlfcUV8t1ki1QaOXoNlzFOoAdb0YkDdA+KbkcnQjy3GIoO03u5uLCzArJ2Z9lJeIE zeZbjTVd/jH7c4KVMVxUgZOE2otJON5EKMV/wVnJi9Xf3NtIFjZ4jJjd7TvSBA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dzdjh47K1zkJL for ; Sun, 25 Jan 2026 17:20:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3c73d by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 25 Jan 2026 17:20:56 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 58580dc0c694 - main - libc: document posix_spawnattr_getexecfd_np(3) 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: 58580dc0c694b107ba7ba1b14dc8ee8f306e53f6 Auto-Submitted: auto-generated Date: Sun, 25 Jan 2026 17:20:56 +0000 Message-Id: <697650f8.3c73d.2fcd9b55@gitrepo.freebsd.org> The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=58580dc0c694b107ba7ba1b14dc8ee8f306e53f6 commit 58580dc0c694b107ba7ba1b14dc8ee8f306e53f6 Author: Konstantin Belousov AuthorDate: 2026-01-24 22:22:03 +0000 Commit: Konstantin Belousov CommitDate: 2026-01-25 17:20:00 +0000 libc: document posix_spawnattr_getexecfd_np(3) Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D54862 --- lib/libc/gen/Makefile.inc | 2 + lib/libc/gen/posix_spawn.3 | 2 + lib/libc/gen/posix_spawnattr_getexecfd_np.3 | 86 +++++++++++++++++++++++++++++ 3 files changed, 90 insertions(+) diff --git a/lib/libc/gen/Makefile.inc b/lib/libc/gen/Makefile.inc index 4d064d18d36e..5d151a71ff7d 100644 --- a/lib/libc/gen/Makefile.inc +++ b/lib/libc/gen/Makefile.inc @@ -274,6 +274,7 @@ MAN+= alarm.3 \ posix_spawn.3 \ posix_spawn_file_actions_addopen.3 \ posix_spawn_file_actions_init.3 \ + posix_spawnattr_getexecfd_np.3 \ posix_spawnattr_getflags.3 \ posix_spawnattr_getpgroup.3 \ posix_spawnattr_getschedparam.3 \ @@ -469,6 +470,7 @@ MLINKS+=posix_spawn.3 posix_spawnp.3 \ posix_spawn_file_actions_addopen.3 posix_spawn_file_actions_addfchdir_np.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 \ posix_spawnattr_getpgroup.3 posix_spawnattr_setpgroup.3 \ posix_spawnattr_getschedparam.3 posix_spawnattr_setschedparam.3 \ posix_spawnattr_getschedpolicy.3 posix_spawnattr_setschedpolicy.3 \ diff --git a/lib/libc/gen/posix_spawn.3 b/lib/libc/gen/posix_spawn.3 index 278fee88463a..a34344597a99 100644 --- a/lib/libc/gen/posix_spawn.3 +++ b/lib/libc/gen/posix_spawn.3 @@ -455,6 +455,7 @@ action. .Xr posix_spawn_file_actions_destroy 3 , .Xr posix_spawn_file_actions_init 3 , .Xr posix_spawnattr_destroy 3 , +.Xr posix_spawnattr_getexecfd_np 3 , .Xr posix_spawnattr_getflags 3 , .Xr posix_spawnattr_getpgroup 3 , .Xr posix_spawnattr_getschedparam 3 , @@ -462,6 +463,7 @@ action. .Xr posix_spawnattr_getsigdefault 3 , .Xr posix_spawnattr_getsigmask 3 , .Xr posix_spawnattr_init 3 , +.Xr posix_spawnattr_setexecfd_np 3 , .Xr posix_spawnattr_setflags 3 , .Xr posix_spawnattr_setpgroup 3 , .Xr posix_spawnattr_setschedparam 3 , diff --git a/lib/libc/gen/posix_spawnattr_getexecfd_np.3 b/lib/libc/gen/posix_spawnattr_getexecfd_np.3 new file mode 100644 index 000000000000..3f5c523d101d --- /dev/null +++ b/lib/libc/gen/posix_spawnattr_getexecfd_np.3 @@ -0,0 +1,86 @@ +.\" Copyright 2026 The FreeBSD Foundation +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.\" This documentation was written by +.\" Konstantin Belousov under sponsorship +.\" from the FreeBSD Foundation. +.\" +.Dd January 25, 2026 +.Dt POSIX_SPAWNATTR_GETEXECFD_NP 3 +.Os +.Sh NAME +.Nm posix_spawnattr_getexecfd_np , +.Nm posix_spawnattr_setexecfd_np +.Nd "get and set the spawn-execfd attribute of a spawn attributes object" +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In spawn.h +.Ft int +.Fo posix_spawnattr_getexecfd_np +.Fa "const posix_spawnattr_t *restrict attr" +.Fa "int *restrict fdp" +.Fc +.Ft int +.Fo posix_spawnattr_setexecfd_np +.Fa "posix_spawnattr_t *attr" +.Fa "int fd" +.Sh DESCRIPTION +The +.Fn posix_spawnattr_getexecfd_np +function obtains the value of the spawn-execfd attribute from the +attributes object referenced by +.Fa attr . +.Pp +The +.Fn posix_spawnattr_setexecfd_np +function sets the spawn-execfd attribute in an initialized attributes +object referenced by +.Fa attr . +.Pp +The spawn-execfd attribute provides the file descriptor that is used +to execute new image in the spawned process by the +.Xr posix_spawn 3 +family of functions. +If the attribute is set to a value other then \-1, it must be a valid +file descriptor which does not have the +.Va O_CLOFORK +flag set. +Then, +.Fn posix_spawn +executes the executable image referenced by the file descriptor in the +newly created process, using the +.Xr fexecve 2 +system call. +In this case, the +.Fa path +argument to +.Fn posix_spawn +is ignored. +.Pp +The default value for the spawn-execfd attribute is \-1, which +means that the executed image is specified by the +.Fa path +argument to +.Fn posix_spawn . +.Sh RETURN VALUES +The +.Fn posix_spawnattr_getexecfd_np +and +.Fn posix_spawnattr_setexecfd_np +functions return zero. +.Sh SEE ALSO +.Xr posix_spawn 3 , +.Xr posix_spawnattr_destroy 3 , +.Xr posix_spawnattr_init 3 , +.Xr posix_spawnp 3 +.Sh STANDARDS +The +.Fn posix_spawnattr_getexecfd_np +and +.Fn posix_spawnattr_setexecfd_np +are +.Fx +extensions that first appeared in +.Fx 16.0 .