_("max seg size"), lim.shmmax, "\n", 0);
ipc_print_size(unit == IPC_UNIT_DEFAULT ? IPC_UNIT_KB : unit,
_("max total shared memory"),
- lim.shmall * getpagesize(), "\n", 0);
+ (uint64_t) lim.shmall * getpagesize(), "\n", 0);
ipc_print_size(unit == IPC_UNIT_DEFAULT ? IPC_UNIT_BYTES : unit,
_("min seg size"), lim.shmmin, "\n", 0);
return;
fprintf(f, " %-10u\n", is->gid);
}
-void ipc_print_size(int unit, char *msg, size_t size, const char *end,
+void ipc_print_size(int unit, char *msg, uint64_t size, const char *end,
int width)
{
- char format[16];
+ char format[32];
if (!msg)
/* NULL */ ;
switch (unit) {
case IPC_UNIT_DEFAULT:
case IPC_UNIT_BYTES:
- sprintf(format, "%%%dzu", width);
+ sprintf(format, "%%%dju", width);
printf(format, size);
break;
case IPC_UNIT_KB:
- sprintf(format, "%%%dzu", width);
+ sprintf(format, "%%%dju", width);
printf(format, size / 1024);
break;
case IPC_UNIT_HUMAN:
#include <unistd.h>
#include <grp.h>
#include <pwd.h>
+#include <stdint.h>
/*
* SHM_DEST and SHM_LOCKED are defined in kernel headers, but inside
};
extern void ipc_print_perms(FILE *f, struct ipc_stat *is);
-extern void ipc_print_size(int unit, char *msg, size_t size, const char *end, int width);
+extern void ipc_print_size(int unit, char *msg, uint64_t size, const char *end, int width);
/* See 'struct shmid_kernel' in kernel sources
*/