Module Name: src
Committed By: christos
Date: Tue Jan 5 18:16:20 UTC 2016
Modified Files:
src/bin/sh: sh.1
Log Message:
Document close-on-exec redirection behavior.
To generate a diff of this commit:
cvs rdiff -u -r1.115 -r1.116 src/bin/sh/sh.1
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/bin/sh/sh.1
diff -u src/bin/sh/sh.1:1.115 src/bin/sh/sh.1:1.116
--- src/bin/sh/sh.1:1.115 Tue May 26 17:35:15 2015
+++ src/bin/sh/sh.1 Tue Jan 5 13:16:20 2016
@@ -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 @@ Any redirections on the
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