|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
problem with system() function in API exit on Linux |
« View previous topic :: View next topic » |
Author |
Message
|
ktg |
Posted: Wed Nov 26, 2008 4:17 am Post subject: problem with system() function in API exit on Linux |
|
|
Centurion
Joined: 09 Jan 2006 Posts: 138 Location: India
|
Hi All,
We are porting one of our exit to Linux. Exit code uses system() function for some purpose. It works fine on Solaris but on Linux, the return status of system() is always -1 though, the command executed by system() is successfull.
I analysed the code but could not figure out the reason. Later added few statements in sample API code to counter check the behaviour. Its the same. Only, the first application which connects to the queue manager only, for the first time, get return status from system command as 0. All the remaining calls would get -1. Btw, for the sake of testing the command I used was system("ls > /dev/null 2>&1").
Could anyone please, help......
TIA,
Kalpana |
|
Back to top |
|
 |
mvic |
Posted: Wed Nov 26, 2008 5:34 pm Post subject: Re: problem with system() function in API exit on Linux |
|
|
 Jedi
Joined: 09 Mar 2004 Posts: 2080
|
It's normal on *ix to check the errno if a library or system call fails. What is the errno after the -1 return code?
Is -1 perhaps the return code from the program that system() runs via the shell? |
|
Back to top |
|
 |
ktg |
Posted: Wed Nov 26, 2008 10:20 pm Post subject: |
|
|
Centurion
Joined: 09 Jan 2006 Posts: 138 Location: India
|
Getting the errno as 10 and strerror(errno)=No child Processes
Thanks,
Kalpana |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|