1 --- util-linux-2.13-pre4/sys-utils/ipcs.c.shmax 2005-10-18 17:04:42.000000000 +0200
2 +++ util-linux-2.13-pre4/sys-utils/ipcs.c 2005-10-18 17:31:28.000000000 +0200
10 /* X/OPEN tells us to use <sys/{types,ipc,sem}.h> for semctl() */
12 (unsigned long) shminfo.shmmni);
13 printf (_("max seg size (kbytes) = %lu\n"),
14 (unsigned long) (shminfo.shmmax >> 10));
16 + /* max shmem = pagesize * shminfo.shmall / 1024
18 + * note: that "shminfo.shmall * getpagesize()" is greater than ULONG_MAX (32bit)
19 + * it means that better is "/" before "*" or use "long long"
21 - printf (_("max total shared memory (pages) = %lu\n"),
22 - (unsigned long) shminfo.shmall);
23 + printf (_("max total shared memory (kbytes) = %lu\n"),
24 + getpagesize()/1024 * (unsigned long) shminfo.shmall);
25 printf (_("min seg size (bytes) = %lu\n"),
26 (unsigned long) shminfo.shmmin);