return (finishdup(fdp, uap->fd, i, p->p_retval));
case F_GETFD:
p->p_retval[0] = *pop & 1;
p->p_retval[0] = (*pop & UF_EXCLOSE) ? FD_CLOEXEC : 0;
return (0);
case F_SETFD:
*pop = (*pop &~ 1) | (uap->arg & 1);
*pop = (*pop &~ UF_EXCLOSE) |
(uap->arg & FD_CLOEXEC ? UF_EXCLOSE : 0);
case F_GETFL:
.El
.It Dv F_GETFD
Get the close-on-exec flag associated with the file descriptor
.Fa fd .
.Fa fd
If the low-order bit of the returned value is 0,
as
.Dv FD_CLOEXEC .
If the returned value anded with
.Dv FD_CLOEXEC
is 0,
the file will remain open across
.Fn exec ,
otherwise the file will be closed upon execution of
.It Dv F_SETFD
Set the close-on-exec flag associated with
to the low order bit of
to
.Fa arg ,
where
.Fa arg
(0 or 1 as above).
is either 0 or
.Dv FD_CLOEXEC ,
as described above.
.It Dv F_GETFL
Get descriptor status flags, as described below
.Fa ( arg