Re: closing extra fd's in gnome_execute_*

On 12 Jan 1999, Elliot Lee wrote:

> On Tue, 12 Jan 1999 00:06:04 -0500 (EST), Manish Vachharajani
> <> wrote:
> >Also, should the gnome_client stuff set CLOEXEC on all the ICE fds by
> >default?  Do we ever want to inherit those on exec?  I don't think so.   
> In my perfect world, the CLOEXEC flag would be the default. However, there
> are reasons, historical and otherwise, why it is the way it is.
> IMHO CLOEXEC should be set on all fd's except 0,1,2 (the stdin/stdout/stderr
> of children should remain the same as their parents except under unusual
> circumstances), and pipes. X/ICE/CORBA/whatever fd's should be set CLOEXEC.

Well, we can fix CORBA, and change the flags for X in gtk+.  I don't know
if there is anything we can do about ICE and other wrapped connections

> As far as your "sysconf(SC_OPEN_MAX) will help us close all fd's" comment,
> note that closing even 1024 fd's will take a little bit of time, and when
> SC_OPEN_MAX goes up to 1 billion, it is going to become plain impractical :)

I agree, but for now the hack is there until all the CLOEXEC issues can be
resolved.  Once that is finished we can remove the CLOEXEC stuff.  For
some reason I thought sysconf(_SC_OPEN_MAX) would return the greatest open
file descriptor, oops.  BTW, this sysconf code is straight from
gnome-pty-helper, so I guess we need to fix that too :)  See my other
email for some more collected thoughts.
> Hope this helps,
> -- Elliot
> "In film you will find four basic story lines. Man versus man, man
>  versus nature, nature versus nature, and dog versus vampire."
>     - Steven Spielberg
> -- 
>         FAQ: Frequently-Asked Questions at
>          To unsubscribe: mail with 
>                        "unsubscribe" as the Subject.

Manish Vachharajani               Some Haiku: A crash reduces
<>                   your expensive computer
                                              to a simple stone - Unknown

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