ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » User Exits » problem with system() function in API exit on Linux

Post new topic  Reply to topic
 problem with system() function in API exit on Linux « View previous topic :: View next topic » 
Author Message
ktg
PostPosted: Wed Nov 26, 2008 4:17 am    Post subject: problem with system() function in API exit on Linux Reply with quote

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
View user's profile Send private message AIM Address
mvic
PostPosted: Wed Nov 26, 2008 5:34 pm    Post subject: Re: problem with system() function in API exit on Linux Reply with quote

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
View user's profile Send private message
ktg
PostPosted: Wed Nov 26, 2008 10:20 pm    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » User Exits » problem with system() function in API exit on Linux
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.