From nobody Sun Feb 1 21:41:13 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 4f438p3ZS2z6QjsQ for ; Sun, 01 Feb 2026 21:41:14 +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 4f438p0Tfxz3GNj for ; Sun, 01 Feb 2026 21:41:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1769982074; 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=KElqLTTvkYUpoYFF63xqyiTlYile6paNyyoXb0p7jHw=; b=lRTkYespYPmCUePft3tHU+dra6D1X3UXntcQdw+uZHhFCiHdTKCtHcPl9j4bcNKh18v7AO EIW3DMQSBszR+oLBtjSFnCn6VxesYiJy8bNl477XSCcbxKBoKWqOMIxQ86xHxbRNiQMTJi Kq7rkAzZMVSNd6VZ+3iEkX6PHt1ekGP4JnOo+BUloUXAlb6/h8CvCld65HNNJuyTTho8t8 A6c95p3rJPygalI/GiDnkbl3iCpXdAQorX+RxCOIrtt8EaZ81Fv1/i69yddI33rFVg+RZM RqIQuGjmc+9AqHGxqajY7JY222vt1lIU5JJpIAmh7d1/rUIC5bruVMKqjilyiA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1769982074; a=rsa-sha256; cv=none; b=HD34iVjU4smYcfFyC0x18nlrgy7r8RrJUnMGjTiGYpOu30h+1UhPl2s0KVUr6i7gqoWJio Ku35vhd5+cRKmzEXiABXFK1HjjyMpI4P3B7MwjloVikwPnuldRX0omIk4lkZtnEEV0scCA lI+37W2hVsVHUk2QOflEW+NCBQhPg/iO4sRwf+6drHNtk0FmA2//nEMadX7hWocXcBvPjR RCApf+aQ/SKT0/UC8jRVc0zcKHpEJNaYm2eHxHx5GldRGTRxreoTkQ1PYqghb3tHbdK4XP iaqF7d5XGvdexbY7PTSLbpdnQHJUBJ8kHWRTLDC5UzsZ6aSBxsFLsATUUpdRfQ== 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=1769982074; 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=KElqLTTvkYUpoYFF63xqyiTlYile6paNyyoXb0p7jHw=; b=NN11cxFavTNV2lBe1EdjnARb6EGlU6CHtHRdN878v2TuuPweh31nuvnihlCt67D7CMEArt 6bfitKUTzHd9TxAXro8yNXGaypG0lDOBnfhBqeuQsDEBjVmJFTUZ5YF0s0vqrLO+4ZOIb1 JgeI695OdMDOEkY8leNIb6aEDBSYsNTWa2jVCOf8Y+9Vu9661mIHoZinKcXjPyT/yKHTU3 31O440H/U+CLT3UELnlyeCcLNwA8DA5I+DunjukfSCFmhYrT/e0LesakMj6cXEV0uyawYO Hocj9gf8TZFkoWqz96mxf8nXwzZ3bL9FzRUX29gam/F/aZCi1pJP3F95bAABwg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4f438n74WRzy3N for ; Sun, 01 Feb 2026 21:41:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3badd by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 01 Feb 2026 21:41:13 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 4d8e4b67f5b5 - stable/15 - libc: document posix_spawnattr_{get,set}procdescp_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/stable/15 X-Git-Reftype: branch X-Git-Commit: 4d8e4b67f5b5f7c9a8a669d8ab0e39682b14a19f Auto-Submitted: auto-generated Date: Sun, 01 Feb 2026 21:41:13 +0000 Message-Id: <697fc879.3badd.531a2ebb@gitrepo.freebsd.org> The branch stable/15 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=4d8e4b67f5b5f7c9a8a669d8ab0e39682b14a19f commit 4d8e4b67f5b5f7c9a8a669d8ab0e39682b14a19f Author: Konstantin Belousov AuthorDate: 2026-01-26 20:06:44 +0000 Commit: Konstantin Belousov CommitDate: 2026-02-01 21:38:50 +0000 libc: document posix_spawnattr_{get,set}procdescp_np(3) (cherry picked from commit 77c5f29453ed3dbb4ba1a372329ab32ec27c998d) --- lib/libc/gen/Makefile.inc | 2 + lib/libc/gen/posix_spawn.3 | 2 + lib/libc/gen/posix_spawnattr_getprocdescp_np.3 | 94 ++++++++++++++++++++++++++ 3 files changed, 98 insertions(+) diff --git a/lib/libc/gen/Makefile.inc b/lib/libc/gen/Makefile.inc index 5d151a71ff7d..b274874973a3 100644 --- a/lib/libc/gen/Makefile.inc +++ b/lib/libc/gen/Makefile.inc @@ -277,6 +277,7 @@ MAN+= alarm.3 \ posix_spawnattr_getexecfd_np.3 \ posix_spawnattr_getflags.3 \ posix_spawnattr_getpgroup.3 \ + posix_spawnattr_getprocdescp_np.3 \ posix_spawnattr_getschedparam.3 \ posix_spawnattr_getschedpolicy.3 \ posix_spawnattr_init.3 \ @@ -472,6 +473,7 @@ MLINKS+=posix_spawn.3 posix_spawnp.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_getprocdescp_np.3 posix_spawnattr_setprocdescp_np.3 \ posix_spawnattr_getschedparam.3 posix_spawnattr_setschedparam.3 \ posix_spawnattr_getschedpolicy.3 posix_spawnattr_setschedpolicy.3 \ posix_spawnattr_getsigdefault.3 posix_spawnattr_setsigdefault.3 \ diff --git a/lib/libc/gen/posix_spawn.3 b/lib/libc/gen/posix_spawn.3 index a34344597a99..f7489890db31 100644 --- a/lib/libc/gen/posix_spawn.3 +++ b/lib/libc/gen/posix_spawn.3 @@ -458,6 +458,7 @@ action. .Xr posix_spawnattr_getexecfd_np 3 , .Xr posix_spawnattr_getflags 3 , .Xr posix_spawnattr_getpgroup 3 , +.Xr posix_spawnattr_getprocdescp_np 3 , .Xr posix_spawnattr_getschedparam 3 , .Xr posix_spawnattr_getschedpolicy 3 , .Xr posix_spawnattr_getsigdefault 3 , @@ -466,6 +467,7 @@ action. .Xr posix_spawnattr_setexecfd_np 3 , .Xr posix_spawnattr_setflags 3 , .Xr posix_spawnattr_setpgroup 3 , +.Xr posix_spawnattr_setprocdescp_np 3, .Xr posix_spawnattr_setschedparam 3 , .Xr posix_spawnattr_setschedpolicy 3 , .Xr posix_spawnattr_setsigdefault 3 , diff --git a/lib/libc/gen/posix_spawnattr_getprocdescp_np.3 b/lib/libc/gen/posix_spawnattr_getprocdescp_np.3 new file mode 100644 index 000000000000..fab529d91313 --- /dev/null +++ b/lib/libc/gen/posix_spawnattr_getprocdescp_np.3 @@ -0,0 +1,94 @@ +.\" 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 26, 2026 +.Dt POSIX_SPAWNATTR_GETPROCDESCP_NP 3 +.Os +.Sh NAME +.Nm posix_spawnattr_getprocdesp_np , +.Nm posix_spawnattr_setprocdescp_np +.Nd "get and set the spawn-procdescp attribute of a spawn attributes object" +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In spawn.h +.Ft int +.Fo posix_spawnattr_getprocdescp_np +.Fa "const posix_spawnattr_t *restrict attr" +.Fa "int **restrict fdpp" +.Fa "int *restrict pdrflagsp" +.Fc +.Ft int +.Fo posix_spawnattr_setprocdescp_np +.Fa "posix_spawnattr_t *attr" +.Fa "int *restrict fdp" +.Fa "int pdrflags" +.Fc +.Sh DESCRIPTION +The +.Fn posix_spawnattr_getprocdescp_np +function obtains the value of the spawn-procdescp attribute from the +attributes object referenced by +.Fa attr . +.Pp +The +.Fn posix_spawnattr_procdescp_np +function sets the spawn-procdescp attribute in an initialized attributes +object referenced by +.Fa attr . +.Pp +The spawn-procdescp attribute provides the location where the child process's +file descriptor will be stored after a successful spawn. +Setting the attribute to a non-NULL value implicitly request the creation of +the file descriptor that references the child process. +It wiil be created by the +.Xr pdrfork 2 +system call. which will be used instead of +.Xr fork/vfork/rfork 2 +when the attribute is set to +.Va NULL. +.Pp +If the attribute is set to a value other then +.Dv NULL , +it must be a valid pointer to a variable of +.Vt int +type, where the resulting descriptor will be stored. +The +.Fa pdrflags +argument specifies additional flags that are accepted by the +.Xr pdfork 2 +system call. +See its description for the list of the valid flags. +Note that the +.Va PD_CLOEXEC +flag is always set, preventing leakage of the process descriptor +into the newly created child. +.Pp +The default value for the spawn-procdescp attribute is +.Dv NULL , +which means that no process descriptor will be created. +.Sh RETURN VALUES +The +.Fn posix_spawnattr_getprocdescp_np +and +.Fn posix_spawnattr_setprocdescp_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_getprocdescp_np +and +.Fn posix_spawnattr_setprocdescp_np +are +.Fx +extensions that first appeared in +.Fx 16.0 .