Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Do file descriptors survive to subshell?
- X-seq: zsh-users 21875
- From: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: Do file descriptors survive to subshell?
- Date: Mon, 12 Sep 2016 17:29:20 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to; bh=zOpZYS90Gemt4jBM5/vYcjwRN0mayr6i0jWrXv7LTMI=; b=CGyfZ8BqRrdrdwYJdj2eVbW+TBmpWPx2fae59N+TYtfGETR2usLqBdgkdyCcU8qSd1 kKaW3q9t2Z3NfCj6XdEPBUBnUcP+O3wTFoCXsLYzJBeE7yOrgy6ruOXTn0vP59nGwWac aXMnKixhoKAOFptiGmPqz7/iuPP+HINFpAaltgQsvggsSDsMAEgvUAxr904ioE13O+1m xEW4r8CHl9bwmhz9Oy5CBxhOf8ER8p11jO5JPGz2Rl/6VQhxA000Qgbaz10oSzg3YKk2 pGc9I8lvM9f03KmrrW4jpb49NIET3Ial4yEBtfwi0QxVL4779M3SECMakpIMIqMWsjH0 VR4w==
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author