Unix Programming - Re: fork/exec vs system

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > January 2007 > Re: fork/exec vs system





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Re: fork/exec vs system
Connie

2007-01-24, 7:19 pm

Hi Jens,
Thank you very much for your reply. I heard that PERL by deafult sets
close-on-exec for all descriptors except
STDIN STDOUT and STDERR. If that is true, I shouldn't worry about the
inherit handles since I use perl(Although I like C better.;-)

Thanks
-Connie


On Jan 24, 2:14 pm, j...@toerring.de (Jens Thoms Toerring) wrote:
> Connie <yecon...@gmail.com> wrote:
> exec()ing a shell that in turn tries to start the program
> specified as the argument of system).
>
> to safe-guard against possible problems resulting from the child
> process inheriting open files is to set the close-on-exec flag
> for all files the parent has open.
>
> If you need that it's probably better to use fork/exec instead of
> system().
> Regards, Jens
> --
> \ Jens Thoms Toerring ___ j...@toerring.de
> \__________________________ http://toerring.de


Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com