Date: Thu, 3 Jan 2008 16:46:47 +0100 From: "=?ISO-8859-1?Q?Fernando_Apestegu=EDa?=" <fernando.apesteguia@gmail.com> To: "Ivan Voras" <ivoras@freebsd.org> Cc: freebsd-questions@freebsd.org Subject: Re: Porting from linux to FreeBSD (procfs question) Message-ID: <1bd550a00801030746y29b2c028j9351b99e8684f66c@mail.gmail.com> In-Reply-To: <flip0s$du0$1@ger.gmane.org> References: <1bd550a00801030514i5007c67t509e05f08c820dd@mail.gmail.com> <flip0s$du0$1@ger.gmane.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Jan 3, 2008 2:47 PM, Ivan Voras <ivoras@freebsd.org> 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. > >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1bd550a00801030746y29b2c028j9351b99e8684f66c>