public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* /proc/kcore size incorrect ?
@ 2005-10-23 21:58 J.A. Magallon
  2005-10-23 23:13 ` Jon Masters
  0 siblings, 1 reply; 10+ messages in thread
From: J.A. Magallon @ 2005-10-23 21:58 UTC (permalink / raw)
  To: Linux-Kernel, 

[-- Attachment #1: Type: text/plain, Size: 873 bytes --]

Hi all...

Probably this is a stupid question, but anyways...

I'm trying to make a script to generate an /etc/motd, and I wanted to
include memory size of the box.

I tried:

	echo $(($(stat -c %s /proc/kcore) / 1024 / 1024)) "Mb"

but it gives 1022 for a 1Gb box.

In fact:

	werewolf:~# ll /proc/kcore
	-r--------  1 root root 1072566272 2005.10.23 23:53 /proc/kcore
	werewolf:~# stat -c %s /proc/kcore
	1072566272

	werewolf:~# echo $((1024*1024*1024))
	1073741824

Why that difference ?

TIA

BTW, any simple method to get the real mem of the box ?

--
J.A. Magallon <jamagallon()able!es>     \               Software is like sex:
werewolf!able!es                         \         It's better when it's free
Mandriva Linux release 2006.1 (Cooker) for i586
Linux 2.6.13-jam9 (gcc 4.0.1 (4.0.1-5mdk for Mandriva Linux release 2006.0))

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2005-10-25 18:04 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-23 21:58 /proc/kcore size incorrect ? J.A. Magallon
2005-10-23 23:13 ` Jon Masters
2005-10-23 23:57   ` J.A. Magallon
2005-10-24 12:02     ` Jon Masters
2005-10-24 14:19     ` Stefan Smietanowski
2005-10-25 12:04     ` Matan Peled
2005-10-25 13:37       ` Brian Waite
2005-10-25 16:02     ` /proc/kcore size incorrect ? (OT) Eric Piel
2005-10-25 16:06       ` J.A. Magallon
2005-10-25 18:04         ` Tony Luck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox