From owner-freebsd-questions Tue Oct 23 5:46: 4 2001 Delivered-To: freebsd-questions@freebsd.org Received: from post.mail.nl.demon.net (post-11.mail.nl.demon.net [194.159.73.21]) by hub.freebsd.org (Postfix) with ESMTP id A5EDD37B401 for ; Tue, 23 Oct 2001 05:45:55 -0700 (PDT) Received: from [195.11.243.26] (helo=Debug) by post.mail.nl.demon.net with smtp (Exim 3.22 #1) id 15w0wL-000MAg-00; Tue, 23 Oct 2001 12:45:53 +0000 To: Giorgos Keramidas , Matthew Blacklow , freebsd-questions From: Cliff Sarginson Subject: Re: C clue on FreeBSD again! Date: Tue, 23 Oct 2001 12:45:53 GMT X-Mailer: www.webmail.nl.demon.net X-Sender: postmaster@btvs.demon.nl X-Originating-IP: 192.250.25.251 Message-Id: Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > On Tue, Oct 23, 2001 at 02:50:21PM +1000, Matthew Blacklow wrote: > > Yesterday I made a post asking how to suppress the output of a program > > spawned in C using the System() function. > > The replies I had were very helpful and successfully supressed the output. > > However they worked a little too good and they even suppressed the return > > value of the program which i really need to capture. > > You are not giving enough details for anyone to be able to help you > with the specific problem. Show us the relevant source of your > program, and the exact commands that you are trying to system(). > > We can only guess what you are trying to do, and your `return value' > is not something you did mention in the original question. Give more > details, please, on: > > a) What exactly you are trying to do? > b) How are you trying to do it? > c) How does it fail to meet your requirements? > > -giorgos The return value from "system" won't be of much use to you, it will only indicate if the "system" call managed to successfully exec the program you asked it to. Actually, "system" is also a highly unportable thing to use, if that is of any importance to you. Having said that I am talking about most implementations of "system" .. someone will correct me if I am wrong about it on FreeBSD. Generally however If you want the return/exit value you will need to take a different approach, probably using fork/exec/wait calls. Or in some kludgy way have the return value from the program stored somehow. But as giorgos said if you perhaps sent some code fragments of what you are trying to do you may get some more specific suggestions. -- Regards Cliff To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message