Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Re: Re: why does ignoring sigCHLD corrupt return value from system()?

by TheHobbit (Pilgrim)
on Nov 05, 2003 at 10:14 UTC ( [id://304664]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: why does ignoring sigCHLD corrupt return value from system()?
in thread why does ignoring sigCHLD corrupt return value from system()?

Hi,
The fact that $SIG{CHLD} is set to wichever value the user chose must not change the behavior of system as stated in perlfunc, expecially where it states that:

Does exactly the same thing as "exec LIST", except that a fork is done first, and the parent process waits for the child process to complete.

The parent process needs to intercept SIGCHLD in order to wait(2) for the child process to complete.

As I stated above, this implies that the value of $SIG{CHLD} must be localized to same value during the execution of system, and so the user value of it outside that execution is (or shuld be) irrelevant.

Just my 5 (euro) cents.


Leo TheHobbit

Replies are listed 'Best First'.
Re: Re: Re: Re: why does ignoring sigCHLD corrupt return value from system()?
by sauoq (Abbot) on Nov 05, 2003 at 11:11 UTC
    The fact that $SIG{CHLD} is set to wichever value the user chose must not change the behavior of system as stated in perlfunc

    Agreed. And the OP discusses a case in which it does change the behavior of system. This is a bug.

    The question I posed was whether we should recommend that people avoid ignoring SIGCHLD if they are going to call system. And, I think so. Nevermind how perl should behave. What matters here is how perl does behave. Even if this is fixed in the next release, it is still broken in many current installations.

    -sauoq
    "My two cents aren't worth a dime.";
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://304664]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (3)
As of 2024-04-25 19:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found