[KLUG Members] Laptop Linux users
Buist Justin
members@kalamazoolinux.org
Fri, 18 Oct 2002 12:47:07 -0400
> One thing I
> learned when doing the
> >ACPI stuff was that doing an open() call on
> /proc/acpi/battery/0/status or
> >whatever would cause a disk hit even though /proc is a
> non-disk directory.
> >Keeping the fd open though dup()ing it and seek()ing back to
> the beginning
> >would let you re-read the file though w/out that disk hit.
> Little tricks
> >like that scattered about the core gnome apps might do a lot
> to keep the
> >battery running a lot longer.
>
> Fascinating. Maybe open in glibc is checking xtab or some
> other status file?
Nah... it has to figure out how to open up proc first, so you have to open up a handle to / and then loop through it to find the 'proc' entry, which then begins your journey into memory-only space. / lives on the disk though, so to get that inode open you've got to ask the little magnetic platter.
Justin Buist