Simplify convoluted language, and remove incorrect statement

(that I added a while ago) about what is required by POSIX.
This commit is contained in:
kre 2018-05-03 00:32:11 +00:00
parent 74616670a2
commit 5cf0b51195

View File

@ -1,4 +1,4 @@
.\" $NetBSD: sh.1,v 1.204 2018/05/02 21:43:38 pgoyette Exp $
.\" $NetBSD: sh.1,v 1.205 2018/05/03 00:32:11 kre Exp $
.\" Copyright (c) 1991, 1993
.\" The Regents of the University of California. All rights reserved.
.\"
@ -2321,15 +2321,12 @@ or
.Xr fcntl 2
.Dv F_SETFD /
.Dv FD_CLOEXEC ) ,
unless the descriptors to which they point refer to the standard input,
unless the descriptors refer to the standard input,
output, or error (file descriptors 0, 1, 2).
Traditionally Bourne-like shells
(except
.Xr ksh 1 ) ,
made those file descriptors available to exec'ed processes.
This behavior is required by the POSIX standard, so when the
.Cm posix
option is set, this shell also acts that way.
To be assured the close-on-exec setting is off,
redirect the descriptor to (or from) itself,
either when invoking a command for which the descriptor is wanted open,