From owner-freebsd-questions@FreeBSD.ORG Sun Nov 27 18:34:13 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 222D816A41F for ; Sun, 27 Nov 2005 18:34:13 +0000 (GMT) (envelope-from leblanc@keyslapper.net) Received: from english-breakfast.cloud9.net (english-breakfast.cloud9.net [168.100.1.9]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8446643D62 for ; Sun, 27 Nov 2005 18:34:12 +0000 (GMT) (envelope-from leblanc@keyslapper.net) Received: from english-breakfast.cloud9.net (localhost.cloud9.net [127.0.0.1]) by english-breakfast.cloud9.net (Postfix) with SMTP id 83C5917364; Sun, 27 Nov 2005 13:34:11 -0500 (EST) Received: from keyslapper.net (250-119.customer.cloud9.net [168.100.250.119]) by english-breakfast.cloud9.net (Postfix) with ESMTP id 1DA9917364; Sun, 27 Nov 2005 13:34:11 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by keyslapper.net (Postfix) with ESMTP id D999911AAA; Sun, 27 Nov 2005 13:30:25 -0500 (EST) Received: from keyslapper.net ([127.0.0.1]) by localhost (keyslapper.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 71444-02; Sun, 27 Nov 2005 13:30:25 -0500 (EST) Received: by keyslapper.net (Postfix, from userid 1001) id B233411AA9; Sun, 27 Nov 2005 13:30:25 -0500 (EST) Date: Sun, 27 Nov 2005 13:30:25 -0500 From: Louis LeBlanc To: freebsd-questions@freebsd.org Message-ID: <20051127183025.GA65134@keyslapper.net> Mail-Followup-To: freebsd-questions@freebsd.org, Javier Matos References: <002901c5f37e$ad060950$0301a8c0@mindcrash> <20051127182238.GA93184@slackbox.xs4all.nl> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="KsGdsel6WgEHnImy" Content-Disposition: inline In-Reply-To: <20051127182238.GA93184@slackbox.xs4all.nl> X-PGP-Key: http://www.keyslapper.net/~leblanc/leblanc-at-keyslapper-net.asc User-Agent: Mutt/1.5.11 X-Virus-Scanned: amavisd-new at keyslapper.net X-AntiVirus: Checked by Vexira Antivirus v1.5 Cc: Javier Matos Subject: Re: are there some function in C to notify about the OS used? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-questions@FreeBSD.org List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Nov 2005 18:34:13 -0000 --KsGdsel6WgEHnImy Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 11/27/05 07:22 PM, Roland Smith sat at the `puter and typed: > On Sun, Nov 27, 2005 at 07:16:21PM +0100, Javier Matos wrote: >=20 > > I was programming an application to work with system process that can > > be found in /proc path and now I must to migrate my application to a > > linux OS but the structure of status file is different. I made two > > procedures to take information about status files, one for FreeBSD and > > another for Linux... , now I need some function in C to notify about > > the OS used to run the application to select between two > > procedures... but I can?t find it, can anyone help me? >=20 > FILE *f =3D popen("uname", "r"); >=20 > Read the name from the pipe f, and then pclose(f); There's also the direct API: UNAME(3) (man 3 uname). Lou --=20 Louis LeBlanc FreeBSD-at-keyslapper-DOT-net Fully Funded Hobbyist, KeySlapper Extrordinaire :) Please send off-list email to: leblanc at keyslapper d.t net Key fingerprint =3D C5E7 4762 F071 CE3B ED51 4FB8 AF85 A2FE 80C8 D9A2 Two wrights don't make a rong, they make an airplane. Or bicycles. --KsGdsel6WgEHnImy Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (FreeBSD) iD8DBQFDiftBr4Wi/oDI2aIRAquGAJ93Xu/1+hSFO4na7NfJ8F/wJAjkzACgkfnL 6xW1C2kR2EMMqsx35ZomIjQ= =SQAr -----END PGP SIGNATURE----- --KsGdsel6WgEHnImy--