View | Details | Raw Unified | Return to bug 12723
Collapse All | Expand All

(-)kern_descrip.c (-2 / +3 lines)
Lines 247-257 Link Here
247
		return (finishdup(fdp, uap->fd, i, p->p_retval));
247
		return (finishdup(fdp, uap->fd, i, p->p_retval));
248
248
249
	case F_GETFD:
249
	case F_GETFD:
250
		p->p_retval[0] = *pop & 1;
250
		p->p_retval[0] = (*pop & UF_EXCLOSE) ? FD_CLOEXEC : 0;
251
		return (0);
251
		return (0);
252
252
253
	case F_SETFD:
253
	case F_SETFD:
254
		*pop = (*pop &~ 1) | (uap->arg & 1);
254
		*pop = (*pop &~ UF_EXCLOSE) |
255
			(uap->arg & FD_CLOEXEC ? UF_EXCLOSE : 0);
255
		return (0);
256
		return (0);
256
257
257
	case F_GETFL:
258
	case F_GETFL:
(-)fcntl.2 (-4 / +12 lines)
Lines 80-87 Link Here
80
.El
80
.El
81
.It Dv F_GETFD
81
.It Dv F_GETFD
82
Get the close-on-exec flag associated with the file descriptor
82
Get the close-on-exec flag associated with the file descriptor
83
.Fa fd .
83
.Fa fd
84
If the low-order bit of the returned value is 0,
84
as
85
.Dv FD_CLOEXEC .
86
If the returned value anded with
87
.Dv FD_CLOEXEC
88
is 0,
85
the file will remain open across
89
the file will remain open across
86
.Fn exec ,
90
.Fn exec ,
87
otherwise the file will be closed upon execution of
91
otherwise the file will be closed upon execution of
Lines 91-99 Link Here
91
.It Dv F_SETFD
95
.It Dv F_SETFD
92
Set the close-on-exec flag associated with
96
Set the close-on-exec flag associated with
93
.Fa fd
97
.Fa fd
94
to the low order bit of
98
to
99
.Fa arg ,
100
where
95
.Fa arg
101
.Fa arg
96
(0 or 1 as above).
102
is either 0 or
103
.Dv FD_CLOEXEC ,
104
as described above.
97
.It Dv F_GETFL
105
.It Dv F_GETFL
98
Get descriptor status flags, as described below
106
Get descriptor status flags, as described below
99
.Fa ( arg
107
.Fa ( arg

Return to bug 12723