summary refs log tree commit diff
path: root/Doc/Zsh
diff options
context:
space:
mode:
authorPeter Stephenson <p.stephenson@samsung.com>2019-07-02 13:42:53 +0100
committerPeter Stephenson <p.stephenson@samsung.com>2019-07-02 13:42:53 +0100
commit3bdf4d6641fb34d1c2f130abddb847169a793afe (patch)
treeb1c3686749a26212f08bfd8ffea464804f308d86 /Doc/Zsh
parent700ec49581650ea1f0bffacb207a30145e278417 (diff)
downloadzsh-3bdf4d6641fb34d1c2f130abddb847169a793afe.tar.gz
zsh-3bdf4d6641fb34d1c2f130abddb847169a793afe.tar.xz
zsh-3bdf4d6641fb34d1c2f130abddb847169a793afe.zip
44480: Don't automatically close externally visible file descroptors.
These are descriptors marked FDT_EXTERNAL.

Make all sysopen'ed file descriptors FDT_EXTERNAL.

Make =(...) call closem() consistent with other substitutions.

Document file descriptors are left open.
Diffstat (limited to 'Doc/Zsh')
-rw-r--r--Doc/Zsh/mod_socket.yo6
-rw-r--r--Doc/Zsh/mod_system.yo4
-rw-r--r--Doc/Zsh/redirect.yo3
3 files changed, 9 insertions, 4 deletions
diff --git a/Doc/Zsh/mod_socket.yo b/Doc/Zsh/mod_socket.yo
index 867f6081f..78d9254e8 100644
--- a/Doc/Zsh/mod_socket.yo
+++ b/Doc/Zsh/mod_socket.yo
@@ -43,7 +43,8 @@ startitem()
 item(tt(zsocket) tt(-l) [ tt(-v) ] [ tt(-d) var(fd) ] var(filename))(
 tt(zsocket -l) will open a socket listening on var(filename).
 The shell parameter tt(REPLY) will be set to the file descriptor
-associated with that listener.
+associated with that listener.  The file descriptor remains open in subshells
+and forked external executables.
 
 If tt(-d) is specified, its argument
 will be taken as the target file descriptor for
@@ -56,7 +57,8 @@ tt(zsocket -a) will accept an incoming connection
 to the socket associated with var(listenfd).
 The shell parameter tt(REPLY) will
 be set to the file descriptor associated with
-the inbound connection.
+the inbound connection.  The file descriptor remains open in subshells
+and forked external executables.
 
 If tt(-d) is specified, its argument
 will be taken as the target file descriptor for the
diff --git a/Doc/Zsh/mod_system.yo b/Doc/Zsh/mod_system.yo
index 3a85e760f..6292af071 100644
--- a/Doc/Zsh/mod_system.yo
+++ b/Doc/Zsh/mod_system.yo
@@ -45,7 +45,9 @@ specified as a comma-separated list. The following is a list of possible
 options. Note that, depending on the system, some may not be available.
 startitem()
 item(tt(cloexec))(
-mark file to be closed when other programs are executed
+mark file to be closed when other programs are executed (else
+the file descriptor remains open in subshells and forked external
+executables)
 )
 xitem(tt(create))
 item(tt(creat))(
diff --git a/Doc/Zsh/redirect.yo b/Doc/Zsh/redirect.yo
index 7e38cd0c3..13496d8d3 100644
--- a/Doc/Zsh/redirect.yo
+++ b/Doc/Zsh/redirect.yo
@@ -182,7 +182,8 @@ indent(... tt({myfd}>&1))
 This opens a new file descriptor that is a duplicate of file descriptor
 1 and sets the parameter tt(myfd) to the number of the file descriptor,
 which will be at least 10.  The new file descriptor can be written to using
-the syntax tt(>&$myfd).
+the syntax tt(>&$myfd).  The file descriptor remains open in subshells
+and forked external executables.
 
 The syntax tt({)var(varid)tt(}>&-), for example tt({myfd}>&-), may be used
 to close a file descriptor opened in this fashion.  Note that the