[PATCH] sysinfo

Corinna Vinschen corinna-cygwin@cygwin.com
Fri May 6 10:44:00 GMT 2011


On May  6 03:51, Yaakov (Cygwin/X) wrote:
> On Fri, 2011-05-06 at 10:11 +0200, Corinna Vinschen wrote:
> > On May  6 00:09, Yaakov (Cygwin/X) wrote:
> > > This implements sysinfo(2), a GNU extension:
> > > 
> > > http://www.kernel.org/doc/man-pages/online/pages/man2/sysinfo.2.html
> > > 
> > > The code is partially based on our /proc/meminfo and /proc/uptime code.
> > > (My next patch will port the former to use sysinfo(2), but the latter
> > > cannot as it uses .01s resolution, more than sysinfo's 1s.  That patch
> > > will also fix /proc/meminfo and /proc/swaps for RAM and paging files
> > > larger than 4GB.)
> > > 
> > > Patches for winsup/cygwin and winsup/doc, plus a test program, attached.
> > > 
> > > 
> > > Yaakov
> > > 
> > 
> > > 2011-05-05  Yaakov Selkowitz  <yselkowitz@...>
> > > 
> > > 	* sysconf.cc (sysinfo): New function.
> > > 	* cygwin.din (sysinfo): Export.
> > > 	* posix.sgml (std-gnu): Add sysinfo.
> > > 	* include/sys/sysinfo.h (struct sysinfo): Define.
> > > 	(sysinfo): Declare.
> > > 	* include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
> > 
> > That looks good to me.  Just a question...
> > 
> > > +  /* FIXME: unsupported */
> > > +  info->loads[0] = 0UL;
> > > +  info->loads[1] = 0UL;
> > > +  info->loads[2] = 0UL;
> > > +  info->sharedram = 0UL;
> > > +  info->bufferram = 0UL;
> > 
> > Isn't bufferram the sum of paged and non-paged pool?
> 
> The comment alongside the bufferram member of struct sysinfo, as defined
> in the manpage above, says "Memory used by buffers".  A similar meaning
> is given for the Buffers: line of Linux's /proc/meminfo:
> 
> http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Deployment_Guide/s2-proc-meminfo.html
> 
> So IIUC, no.

I guess you're right.  The pools are used for everything, not only
buffers.

Please check in.


Thanks,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat



More information about the Cygwin-patches mailing list