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.

Chet

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

Reply via email to