In article <email@example.com>,
That should, in general, be possible.
>I have perl program which use system() to call another c program
>meanwhile the c program also use system() to execute a linux command
>line ....but not sure why it doesn't work.
>yes, the perl program can let c program execute what it wants, just There is no restriction against nesting in the definition of system(),
>the rear part that c program is trying to execute linux command line
>or go futher system call fails..
>anybody has any thought about that? does it say system call can not be
but there is also no restriction that would require it to work.
*Some* systems put limits on process children, settable by the
system administrators, but the limit is very seldom set quite that low.
In my experience, when system() fails from within a program, it is
usually because the program has played with the execution environment
in some way -- by setting resource limits, by setting the
execution path so that the program cannot be found, by setting up
a secure execution environemnt that doesn't account for the
required program, by playing with the operating system shell
variables that control how the command line is parsed.
Sometimes, though, the difficulty has to do with running system() from
a very large program (one that uses a lot of memory): on -some-
operating systems, the operating system has to temporarily duplicate
the entire memory allocation while it sets up to run the new system
The ways that system() can break are ... system dependant
(Sorry, couldn't resist the pun.) Often someone with a bit of
experience on that kind of system can chase down the problem
pretty quickly, given access to the program and the system
that there is the problem on. It's the sort of thing that you
would ask your systems administrator to look at. [Or
would that be "system()s administrator"? ;) ]
Programming is what happens while you're busy making other plans.