From owner-freebsd-questions@FreeBSD.ORG Thu Jan 3 13:47:29 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE2AD16A4F5 for ; Thu, 3 Jan 2008 13:47:29 +0000 (UTC) (envelope-from freebsd-questions@m.gmane.org) Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by mx1.freebsd.org (Postfix) with ESMTP id 7523613C448 for ; Thu, 3 Jan 2008 13:47:29 +0000 (UTC) (envelope-from freebsd-questions@m.gmane.org) Received: from list by ciao.gmane.org with local (Exim 4.43) id 1JAQPr-0000dZ-1y for freebsd-questions@freebsd.org; Thu, 03 Jan 2008 13:47:23 +0000 Received: from lara.cc.fer.hr ([161.53.72.113]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 03 Jan 2008 13:47:23 +0000 Received: from ivoras by lara.cc.fer.hr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 03 Jan 2008 13:47:23 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-questions@freebsd.org From: Ivan Voras Date: Thu, 03 Jan 2008 14:47:08 +0100 Lines: 37 Message-ID: References: <1bd550a00801030514i5007c67t509e05f08c820dd@mail.gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigC0D893DFC3BDCD3722E4B324" X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: lara.cc.fer.hr User-Agent: Thunderbird 2.0.0.9 (X11/20070801) In-Reply-To: <1bd550a00801030514i5007c67t509e05f08c820dd@mail.gmail.com> X-Enigmail-Version: 0.95.5 Sender: news Subject: Re: Porting from linux to FreeBSD (procfs question) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jan 2008 13:47:29 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigC0D893DFC3BDCD3722E4B324 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Fernando Apestegu=C3=ADa wrote: > 1 - Try to rely the porting on the compatibility procfs from FreeBSD > 2 - Do the things in a completely different way (which one is this? > Invoking sysctl system call?) >=20 > I would like to know from you which one is the best approach. The best way to do it is to abstract the OS-dependant stuff from the application into separate modules / classes / libraries / etc. and then proceed by the second approach (use procfs on linux, use sysctl on FreeBS= D). The first approach would probably be tedious if the application is non-trivial but there's also linprocfs which behaves more like the linux procfs but it's also incomplete. --------------enigC0D893DFC3BDCD3722E4B324 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4-svn0 (GNU/Linux) iD8DBQFHfOdcldnAQVacBcgRAiJBAKDTY5qKRBBvMshtIYFc6OYO2buPzQCg3Xev kd1Jrf6nbFKCDaaKM4diWSY= =I2Ml -----END PGP SIGNATURE----- --------------enigC0D893DFC3BDCD3722E4B324--