aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/sys_procdesc.c
diff options
context:
space:
mode:
authorMariusz Zaborski <oshogbo@FreeBSD.org>2016-06-08 02:09:14 +0000
committerMariusz Zaborski <oshogbo@FreeBSD.org>2016-06-08 02:09:14 +0000
commitb3a734483e9263c26570003a96701df3d7538048 (patch)
tree4a66f3894cb509b4c2355cc20ab8eae477485ab2 /sys/kern/sys_procdesc.c
parent920be817aaee95cbe5c3bc11b33426c22b773a3f (diff)
downloadsrc-b3a734483e9263c26570003a96701df3d7538048.tar.gz
src-b3a734483e9263c26570003a96701df3d7538048.zip
Introduce the PD_CLOEXEC for pdfork(2).
Reviewed by: mjg
Notes
Notes: svn path=/head/; revision=301573
Diffstat (limited to 'sys/kern/sys_procdesc.c')
-rw-r--r--sys/kern/sys_procdesc.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/sys/kern/sys_procdesc.c b/sys/kern/sys_procdesc.c
index 0d3b1f4334bd..37139c1243aa 100644
--- a/sys/kern/sys_procdesc.c
+++ b/sys/kern/sys_procdesc.c
@@ -243,6 +243,22 @@ procdesc_new(struct proc *p, int flags)
}
/*
+ * Create a new process decriptor for the process that refers to it.
+ */
+int
+procdesc_falloc(struct thread *td, struct file **resultfp, int *resultfd,
+ int flags, struct filecaps *fcaps)
+{
+ int fflags;
+
+ fflags = 0;
+ if (flags & PD_CLOEXEC)
+ fflags = O_CLOEXEC;
+
+ return (falloc_caps(td, resultfp, resultfd, fflags, fcaps));
+}
+
+/*
* Initialize a file with a process descriptor.
*/
void