Home     |     .Net Programming    |     cSharp Home    |     Sql Server Home    |     Javascript / Client Side Development     |     Ajax Programming

Ruby on Rails Development     |     Perl Programming     |     C Programming Language     |     C++ Programming     |     IT Jobs

Python Programming Language     |     Laptop Suggestions?    |     TCL Scripting     |     Fortran Programming     |     Scheme Programming Language


 
 
Cervo Technologies
The Right Source to Outsource

MS Dynamics CRM 3.0

C Programming Language

system call


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
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
nesting?

thanks

In article <1181175372.482785.317@z28g2000prd.googlegroups.com>,

qilin  <gded@gmail.com> wrote:
>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.

That should, in general, be possible.

>yes, the perl program can let c program execute what it wants, just
>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
>nesting?

There is no restriction against nesting in the definition of system(),
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
shell.

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.

Add to del.icio.us | Digg this | Stumble it | Powered by Megasolutions Inc