Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/bin/sh Document close-on-exec redirection behavior.



details:   https://anonhg.NetBSD.org/src/rev/0f108e74aaae
branches:  trunk
changeset: 812841:0f108e74aaae
user:      christos <christos%NetBSD.org@localhost>
date:      Tue Jan 05 18:16:20 2016 +0000

description:
Document close-on-exec redirection behavior.

diffstat:

 bin/sh/sh.1 |  18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)

diffs (39 lines):

diff -r c286e1176d52 -r 0f108e74aaae bin/sh/sh.1
--- a/bin/sh/sh.1       Tue Jan 05 17:22:38 2016 +0000
+++ b/bin/sh/sh.1       Tue Jan 05 18:16:20 2016 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: sh.1,v 1.115 2015/05/26 21:35:15 christos Exp $
+.\"    $NetBSD: sh.1,v 1.116 2016/01/05 18:16:20 christos Exp $
 .\" Copyright (c) 1991, 1993
 .\"    The Regents of the University of California.  All rights reserved.
 .\"
@@ -31,7 +31,7 @@
 .\"
 .\"    @(#)sh.1        8.6 (Berkeley) 5/4/95
 .\"
-.Dd May 26, 2015
+.Dd January 5, 2015
 .Dt SH 1
 .Os
 .Sh NAME
@@ -1331,6 +1331,20 @@
 command are marked as permanent, so that they are not undone when the
 .Ic exec
 command finishes.
+File descriptors created via such redirections are marked close-on-exec
+(see 
+.Xr open 2
+.Dv O_CLOEXEC
+or
+.Xr fcntl 2
+.Dv F_SETFD /
+.Dv FD_CLOEXEC ) ,
+unless the descriptors they point to 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.
 .It exit Op Ar exitstatus
 Terminate the shell process.
 If



Home | Main Index | Thread Index | Old Index