From owner-freebsd-questions@FreeBSD.ORG Thu Jan 3 15:46:48 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 BB43616A418 for ; Thu, 3 Jan 2008 15:46:48 +0000 (UTC) (envelope-from fernando.apesteguia@gmail.com) Received: from wr-out-0506.google.com (wr-out-0506.google.com [64.233.184.224]) by mx1.freebsd.org (Postfix) with ESMTP id 6495E13C478 for ; Thu, 3 Jan 2008 15:46:48 +0000 (UTC) (envelope-from fernando.apesteguia@gmail.com) Received: by wr-out-0506.google.com with SMTP id 68so164770wra.13 for ; Thu, 03 Jan 2008 07:46:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=yNhUJ28yicP5tFAUoTxCKuJRg8L8lzKFVDxrIWc3qZc=; b=cHQ3wbkcfgBbXFZ+bbOWx8KlUE9WGY2MCCxSQM1iFhmozqCcWbafYf9VBXxjtO5vqI4R/GJcluGXrS+RsCRBp8DuLZzUN9c2kkU3iTSgKvaREAu07qP6LWPkrielZf+3LjbcWXIP9v9oM8lCrEBSq5P5r6XB8bSmmvr0zE85wAc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=pa2tvDaPcXJfkuAf8bmK6WFkU1SUt9HxpOu6/C26HMsPoexOoDKEVs0Iyn1Qy9SOkK/csj+kInZO15qHRVIdOFYtHl6MDFY4PMPOU3O+cCrMj+owJ9dC1Lmh7RlyxHyrjBUmUf6wbgP4Wa7/CaJmQxogjCUV/IDwZ63auYICLVY= Received: by 10.150.149.19 with SMTP id w19mr4206013ybd.52.1199375207408; Thu, 03 Jan 2008 07:46:47 -0800 (PST) Received: by 10.150.178.13 with HTTP; Thu, 3 Jan 2008 07:46:47 -0800 (PST) Message-ID: <1bd550a00801030746y29b2c028j9351b99e8684f66c@mail.gmail.com> Date: Thu, 3 Jan 2008 16:46:47 +0100 From: "=?ISO-8859-1?Q?Fernando_Apestegu=EDa?=" To: "Ivan Voras" In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <1bd550a00801030514i5007c67t509e05f08c820dd@mail.gmail.com> Cc: freebsd-questions@freebsd.org 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 15:46:48 -0000 On Jan 3, 2008 2:47 PM, Ivan Voras wrote: > Fernando Apestegu=EDa 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?) > > > > 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). OK, the code is modular enough to separate the dependant code into different places. > > 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. Yes, that's my problem. In Linux I can get from /proc/cpuinfo for example: name, model, stepping, cache size, clock speed, supported extensions, etc... But using sysctl in FreeBSD (sysctl -a) I can only see name and vendor for the cpu and a few more things. Am I limited to the variables showed in sysctl -a? Thanks in advance. BTW if this is isn't the proper list to continue with this thread, let me k= now. Cheers. > >