Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F164955921
D54899.id170489.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
4 KB
Referenced Files
None
Subscribers
None
D54899.id170489.diff
View Options
diff --git a/lib/libc/gen/Makefile.inc b/lib/libc/gen/Makefile.inc
--- a/lib/libc/gen/Makefile.inc
+++ b/lib/libc/gen/Makefile.inc
@@ -277,6 +277,7 @@
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 @@
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
--- a/lib/libc/gen/posix_spawn.3
+++ b/lib/libc/gen/posix_spawn.3
@@ -458,6 +458,7 @@
.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 @@
.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
--- /dev/null
+++ b/lib/libc/gen/posix_spawnattr_getprocdescp_np.3
@@ -0,0 +1,93 @@
+.\" Copyright 2026 The FreeBSD Foundation
+.\"
+.\" SPDX-License-Identifier: BSD-2-Clause
+.\"
+.\" This documentation was written by
+.\" Konstantin Belousov <kib@FreeBSD.org> 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-execfd attribute in an initialized attributes
+object referenced by
+.Fa attr .
+.Pp
+The spawn-procdescp attribute provides the location where the process
+file descriptor is stored after successful spawn.
+The file descriptor references the created process, it is created by the
+.Xr pdrfork 2
+system call, which is used instead of
+.Xr fork 2
+or
+.Xr rfork 2
+when the attribute is not set, and the opening of the process descriptor
+is not requested.
+.Pp
+If the attribute is set to a value other then
+.Dv NULL ,
+it must be a valid pointer to the variable of the
+.Vt int
+type, where the resulting descriptor is 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 the 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 is opened.
+.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 .
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Aug 6, 2:54 AM (6 h, 14 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
36065580
Default Alt Text
D54899.id170489.diff (4 KB)
Attached To
Mode
D54899: libc: document posix_spawnattr_{get,set}procdescp_np(3)
Attached
Detach File
Event Timeline
Log In to Comment