This is the mail archive of the cygwin-patches@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Patch for /proc/meminfo handler


On Mar 12 15:14, Andrew Klopper wrote:
> With the Cygwin 1.5.7-1 DLL, 'cat /proc/meminfo' returns an incorrect
> value for free swap space. This is most noticeable when the free virtual
> memory is less than the total physical memory, in which case the
> calculated free swap space is a negative value. This value is then
> converted to an unsigned int for display purposes, resulting in a very
> large positive number which is greater than the total amount of swap
> space.
> 
> A patch to correct this problem is attached.

Well, that doesn't look right after applying your patch:

  $ cat /proc/meminfo
	   total:      used:      free:
  Mem:   536330240  230658048  305672192
  Swap:  770961408 4245790720  820137984
  MemTotal:         523760 kB
  MemFree:          298508 kB
  [...]
  SwapTotal:        752892 kB
  SwapFree:         800916 kB

The result using the original version looks much better:

  $ cat /proc/meminfo
	   total:      used:      free:
  Mem:   536330240  231788544  304541696
  Swap:  770961408  182104064  588857344
  MemTotal:         523760 kB
  MemFree:          297404 kB
  [...]
  SwapTotal:        752892 kB
  SwapFree:         575056 kB

So, perhaps both are wrong?

Please don't send patches uuencoded or in any other encoded or compressed
way.  Just add it as plain text, inline or attached.  And all patches
need a ChangeLog entry.  Have a look onto http://cygwin.com/contrib.html
which explains it thoroughly.


Thanks,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                                mailto:cygwin@cygwin.com
Red Hat, Inc.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]