[PATCH] Fix /proc/meminfo and /proc/swaps for >4GB

Yaakov (Cygwin/X) yselkowitz@users.sourceforge.net
Fri May 6 19:04:00 GMT 2011


As promised, this patch ports the /proc/meminfo code to use sysinfo(2),
and fixes the case where RAM or swap space totals more than 4GB.  It
also fixes the /proc/swaps code for paging files larger than 4GB.

For example:

$ cat /proc/meminfo
            total:         used:         free:
Mem:     4293058560    1828151296    2464907264
Swap:   12884901888      14680064   12870221824
MemTotal:        4192440 kB
MemFree:         2407136 kB
MemShared:             0 kB
HighTotal:             0 kB
HighFree:              0 kB
LowTotal:        4192440 kB
LowFree:         2407136 kB
SwapTotal:      12582912 kB
SwapFree:       12568576 kB

$ cat /proc/swaps
Filename				Type		Size	Used	Priority
/cygdrive/c/pagefile.sys                file            8388608 8192
0
/cygdrive/d/pagefile.sys                file            4194304 6144
0

Patch attached.


Yaakov

-------------- next part --------------
A non-text attachment was scrubbed...
Name: proc-largemem.patch
Type: text/x-patch
Size: 4680 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-patches/attachments/20110506/ffde8e36/attachment.bin>


More information about the Cygwin-patches mailing list