[PATCH] SHM: tweak /proc/sysvipc/shm banner

From: Alexey Dobriyan
Date: Tue Apr 22 2008 - 17:36:50 EST


"size" field and everything after in banner isn't aligned properly on 64-bit archs.

Before:
key shmid perms size cpid lpid nattch uid gid cuid cgid atime dtime ctime
0 0 0 4194304 4749 0 0 1000 1000 1000 1000 0 0 1208902917

After:
key shmid perms size cpid lpid nattch uid gid cuid cgid atime dtime ctime
0 0 0 4194304 4745 0 0 1000 1000 1000 1000 0 0 1208902637

Signed-off-by: Alexey Dobriyan <adobriyan@xxxxxxxxx>
---

ipc/shm.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)

--- a/ipc/shm.c
+++ b/ipc/shm.c
@@ -106,9 +106,14 @@ void shm_exit_ns(struct ipc_namespace *ns)

void __init shm_init (void)
{
+ char *banner;
+
shm_init_ns(&init_ipc_ns);
- ipc_init_proc_interface("sysvipc/shm",
- " key shmid perms size cpid lpid nattch uid gid cuid cgid atime dtime ctime\n",
+ if (sizeof(size_t) <= sizeof(int))
+ banner = " key shmid perms size cpid lpid nattch uid gid cuid cgid atime dtime ctime\n";
+ else
+ banner = " key shmid perms size cpid lpid nattch uid gid cuid cgid atime dtime ctime\n";
+ ipc_init_proc_interface("sysvipc/shm", banner,
IPC_SHM_IDS, sysvipc_shm_proc_show);
}


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/