On Mon, May 29, 2006 at 09:58:21AM +0100, Alex Bligh wrote: > Vasil Dimov wrote: > >I think it would be better not to test if it is linux or freebsd but > >rather if /proc/meminfo exists and whether contains the necessary > >information. > > That's in effect what it does. It tests it by trying to open the > file. If that fails, it defaults to the old behaviour. That's great! > > What I meant was it would be useful to get the information some > other way on FreeBSD etc if the proc file can't be read. Yeah, I will take a look at it. At a first glance the following sysctls are available under FreeBSD: hw.physmem: 1065152512 hw.usermem: 976523264 hw.realmem: 1073414144 > Also, I am not sure whether the proc file has the same format > on FreeBSD If the native FreeBSD /proc is mounted (e.g. mount_procfs procfs /proc) there will not be /proc/meminfo, but if a Linux /proc is mounted (e.g. mount_linprocfs linprocfs /proc) then /proc/meminfo will exist and contain the expected fields. Anyway none of these is mounted by default. > (it should also fail gracefully, but if /proc > is mounted on FreeBSD it could instead use whatever the > FreeBSD format is). I think that the FreeBSD's native /proc does not contain the information in question. -- Vasil Dimov gro.DSBeerF@dv Testing can show the presence of bugs, but not their absence. -- Edsger W. Dijkstra
Attachment:
pgpx41RLFTev8.pgp
Description: PGP signature