Beefy Boxes and Bandwidth Generously Provided by pair Networks Joe
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Equivalence of System Call in C/C++

by jesuashok (Curate)
on May 25, 2007 at 09:03 UTC ( #617436=note: print w/ replies, xml ) Need Help??


in reply to Equivalence of System Call in C/C++

C and C++ also got 'system' function in it. you can also use execl* family functions which are available in stdlib.h


Comment on Re: Equivalence of System Call in C/C++
Re^2: Equivalence of System Call in C/C++
by Tanktalus (Canon) on May 28, 2007 at 20:27 UTC

    Note that the OP asked about system, which maps conveniently to C's system function (although the perl one may have more magic, I don't remember what it is offhand - looking for shell metacharacters, auto-splitting, etc., I believe). Not about exec, which maps to the exec* functions in C, which does something very, very different. So different, in fact, that bringing it up without extra qualifiers is tantamount to intentionally misleading the poor OP.

    In fact, I would even go as far as to say that the differences between system and exec are greater than their similarities, and that they're merely tangentially related. cf., for vs foreach or for/foreach vs map in void context (but some of us don't do that). Very similar (identical!) semantics for these, but system and exec are so completely different...

Re^2: Equivalence of System Call in C/C++
by ikegami (Pope) on May 29, 2007 at 00:09 UTC

    On some systems, system would be implemented using fork, exec* and waitpid. exec* alone would not be equivalent, and it wouldn't be as portable. (Windows can't fork and I think it can't exec.)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (8)
As of 2014-04-17 22:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (458 votes), past polls