From owner-freebsd-questions Wed Jul 14 4: 7:20 1999 Delivered-To: freebsd-questions@freebsd.org Received: from smtp2.vnet.net (smtp2.vnet.net [166.82.1.32]) by hub.freebsd.org (Postfix) with ESMTP id 89AE414BC9 for ; Wed, 14 Jul 1999 04:07:18 -0700 (PDT) (envelope-from rivers@dignus.com) Received: from dignus.com (ponds.vnet.net [166.82.177.48]) by smtp2.vnet.net (8.9.1a/8.9.1) with ESMTP id HAA07381; Wed, 14 Jul 1999 07:06:52 -0400 (EDT) Received: from lakes.dignus.com (lakes.dignus.com [10.0.0.3]) by dignus.com (8.9.2/8.8.5) with ESMTP id HAA30154; Wed, 14 Jul 1999 07:06:50 -0400 (EDT) Received: (from rivers@localhost) by lakes.dignus.com (8.9.2/8.6.9) id HAA32400; Wed, 14 Jul 1999 07:06:49 -0400 (EDT) Date: Wed, 14 Jul 1999 07:06:49 -0400 (EDT) From: Thomas David Rivers Message-Id: <199907141106.HAA32400@lakes.dignus.com> To: mi@kot.ne.mediaone.net, questions@FreeBSD.ORG Subject: Re: result of pclose In-Reply-To: <199907140430.AAA30964@kot.ne.mediaone.net> Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > According to pclose(3), its result must be the exit code of the process. > Is this a bug, or do I misunderstand the manual? Thanks! > > -mi > That is the exit code of the process. The exit code returns is in a format called the `status area', and is exactly the same as that returned by the wait(2) system call. The wait(2) man page describes the macros you need to use to get the return code of the process. What you want to do is something like: rc = WEXITSTATUS(pclose(pipe)); - Dave Rivers - To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message