[Top][All Lists]

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

Re: eval doesn't close file descriptor?

From: Chet Ramey
Subject: Re: eval doesn't close file descriptor?
Date: Tue, 12 Feb 2013 14:50:29 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130107 Thunderbird/17.0.2

On 2/12/13 2:07 PM, Matei David wrote:

> ... there seem to be not 2 but 3(!) types of file descriptors:
> 1. fds which are copied across both subshells and exec; like 4
> 2. fds which are not copied across subshells; like 60&63
> 3. fds which are copied across subshells, but not exec; like 10
> I knew about types 1&2, but not about type 3. Apparently with your first
> suggestion, fd 10 is created and survives a subshell creation. Is this
> correct??

Yes, file descriptors used to save the state of other file descriptors
are set close-on-exec.  `man fcntl' for a description.


``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/

reply via email to

[Prev in Thread] Current Thread [Next in Thread]