Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 27 Nov 2005 19:22:38 +0100
From:      Roland Smith <rsmith@xs4all.nl>
To:        Javier Matos <javierlu@gmail.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: are there some function in C to notify about the OS used?
Message-ID:  <20051127182238.GA93184@slackbox.xs4all.nl>
In-Reply-To: <002901c5f37e$ad060950$0301a8c0@mindcrash>

index | next in thread | previous in thread | raw e-mail

[-- Attachment #1 --]
On Sun, Nov 27, 2005 at 07:16:21PM +0100, Javier Matos wrote:

> 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?

FILE *f = popen("uname", "r");

Read the name from the pipe f, and then pclose(f);

-- 
R.F.Smith (http://www.xs4all.nl/~rsmith/) Please send e-mail as plain text.
public key: http://www.xs4all.nl/~rsmith/pubkey.txt

[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (FreeBSD)

iD8DBQFDifluEnfvsMMhpyURAj7gAKChI/7wPMkd8l7b1itB3soBaCCZsgCfSyQg
yhBQxVevWFRoYCNoiwk+/10=
=7xNp
-----END PGP SIGNATURE-----
home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20051127182238.GA93184>