Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

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

by jesuashok (Curate)
on May 25, 2007 at 09:03 UTC ( [id://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++

Replies are listed 'Best First'.
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 (Patriarch) 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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://617436]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2024-04-24 01:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found