]> git.pld-linux.org Git - packages/util-linux.git/blame - util-linux-ipcs-shmax.patch
- fix compilation and linking problems with ncurses
[packages/util-linux.git] / util-linux-ipcs-shmax.patch
CommitLineData
5545a732
JR
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
3@@ -25,6 +25,7 @@
4 #include <time.h>
5 #include <pwd.h>
6 #include <grp.h>
7+#include <unistd.h>
8 #include "nls.h"
9
10 /* X/OPEN tells us to use <sys/{types,ipc,sem}.h> for semctl() */
11@@ -280,8 +280,14 @@
12 (unsigned long) shminfo.shmmni);
13 printf (_("max seg size (kbytes) = %lu\n"),
14 (unsigned long) (shminfo.shmmax >> 10));
15+
16+ /* max shmem = pagesize * shminfo.shmall / 1024
17+ *
18+ * note: that "shminfo.shmall * getpagesize()" is greater than ULONG_MAX (32bit)
19+ * it means that better is "/" before "*" or use "long long"
20+ */
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);
27 return;
This page took 0.028467 seconds and 4 git commands to generate.