zsh-users
 help / color / mirror / code / Atom feed
From: Sebastian Gniazdowski <sgniazdowski@gmail.com>
To: Zsh Users <zsh-users@zsh.org>
Subject: Do file descriptors survive to subshell?
Date: Mon, 12 Sep 2016 17:29:20 +0200	[thread overview]
Message-ID: <CAKc7PVBMgptkuPOmrcevDwsOrcWzeqO03G8xfr-aGoDade2EQg@mail.gmail.com> (raw)

Hello,
I run subshell (zsh-5.2-dev-1) and there, an exported variable
containing file descriptor works with cat <&$FD. I was first thinking
there's a bug when read -u $FD -t returned true for it, added bunch of
zwarns() to source, and was surprised that (util.c):

ret = select(fd+1, (SELECT_ARG_2_T) &foofd, NULL, NULL, &expire_tv);


returns 1, i.e. one ready fd in set. It is then when I tried to just
cat from the FD, and it worked. Is it expected? How could the FD
survive, maybe because I do flock() (program util-linux/flock, using
call flock()) on it? But the "survive FD" feature should work only for
"exec zsh-5.2-dev-1", not "zsh-5.2-dev-1", shouldn't it ...

Best regards,
Sebastian Gniazdowski


             reply	other threads:[~2016-09-12 16:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20160912160148eucas1p1c7f423821260c611c9b34fbe47bfcf86@eucas1p1.samsung.com>
2016-09-12 15:29 ` Sebastian Gniazdowski [this message]
2016-09-12 16:19   ` Peter Stephenson
2016-09-12 16:29     ` Sebastian Gniazdowski
2016-09-12 18:24       ` Bart Schaefer
2016-09-13  8:54         ` Sebastian Gniazdowski
2016-09-14 17:53           ` Bart Schaefer
2016-09-15  6:41             ` Sebastian Gniazdowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAKc7PVBMgptkuPOmrcevDwsOrcWzeqO03G8xfr-aGoDade2EQg@mail.gmail.com \
    --to=sgniazdowski@gmail.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).