"Default" value for close on exec flag - Linux

This is a discussion on "Default" value for close on exec flag - Linux ; Hi! As far as I can see, all new descriptors have close on exec flag set to 0. Is there any way to change this without calling fcntl on each one of them? So that after the call "pipe(pipe_ends)" both ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: "Default" value for close on exec flag

  1. "Default" value for close on exec flag

    Hi!

    As far as I can see, all new descriptors have close on exec flag set to
    0. Is there any way to change this without calling fcntl on each one of
    them? So that after the call "pipe(pipe_ends)" both pipe_ends[0] and
    pipe_ends[1] have close on exec set to 1?

    --
    Minds, like parachutes, function best when open

  2. Re: "Default" value for close on exec flag

    Andrei Voropaev wrote:
    > Hi!
    >
    > As far as I can see, all new descriptors have close on exec flag set to
    > 0. Is there any way to change this without calling fcntl on each one of
    > them? So that after the call "pipe(pipe_ends)" both pipe_ends[0] and
    > pipe_ends[1] have close on exec set to 1?
    >

    Not at the moment, however there's currently a discussion on lkml
    about this and also providing a some type of "private" fd's for use by
    libraries.

    Jerry

+ Reply to Thread