Re: fork/exec vs system
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > Re: fork/exec vs system




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Re: fork/exec vs system  
Connie


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-25-07 12:19 AM

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






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 02:25 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register