Date: Thu, 9 Nov 2006 23:44:08 GMT From: Jung-uk Kim <jkim@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 109654 for review Message-ID: <200611092344.kA9Ni8tL039928@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=109654 Change 109654 by jkim@jkim_hammer on 2006/11/09 23:43:53 Add two linprocfs entries for Linux IPC: /proc/sys/kernel/msgmni -> kern.ipc.msgmni /proc/sys/kernel/sem -> kern.ipc.semmsl kern.ipc.semmns kern.ipc.semopm kern.ipc.semmni This fixes LTP test case msgget03 and semget05 for now. msgctl08 and msgctl09 also use /proc/sys/kernel/msgmni but the tests fail because Linux's ipcs(1) fails with an unknown reason: %/usr/compat/linux/usr/bin/ipcs -q kernel not configured for message queues Affected files ... .. //depot/projects/linuxolator/src/sys/compat/linprocfs/linprocfs.c#6 edit Differences ... ==== //depot/projects/linuxolator/src/sys/compat/linprocfs/linprocfs.c#6 (text+ko) ==== @@ -925,6 +925,24 @@ } /* + * Filler function for proc/sys/kernel/msgmni + */ +static int +linprocfs_domsgmni(PFS_FILL_ARGS) +{ + int msgmni; + size_t size; + + size = sizeof(msgmni); + if (kernel_sysctlbyname(td, "kern.ipc.msgmni", &msgmni, &size, + 0, 0, 0, 0) != 0) + msgmni = 0; + sbuf_printf(sb, "%i\n", msgmni); + + return (0); +} + +/* * Filler function for proc/sys/kernel/pid_max */ static int @@ -937,6 +955,44 @@ } /* + * Filler function for proc/sys/kernel/sem + */ +static int +linprocfs_dosem(PFS_FILL_ARGS) +{ + int semmsl, semmns, semopm, semmni; + size_t size; + + /* Field 1: SEMMSL */ + size = sizeof(semmsl); + if (kernel_sysctlbyname(td, "kern.ipc.semmsl", &semmsl, &size, + 0, 0, 0, 0) != 0) + semmsl = 0; + + /* Field 2: SEMMNS */ + size = sizeof(semmns); + if (kernel_sysctlbyname(td, "kern.ipc.semmns", &semmns, &size, + 0, 0, 0, 0) != 0) + semmns = 0; + + /* Field 3: SEMOPM */ + size = sizeof(semopm); + if (kernel_sysctlbyname(td, "kern.ipc.semopm", &semopm, &size, + 0, 0, 0, 0) != 0) + semopm = 0; + + /* Field 4: SEMMNI */ + size = sizeof(semmni); + if (kernel_sysctlbyname(td, "kern.ipc.semmni", &semmni, &size, + 0, 0, 0, 0) != 0) + semmni = 0; + + sbuf_printf(sb, "%i %i %i %i\n", semmsl, semmns, semopm, semmni); + + return (0); +} + +/* * Filler function for proc/scsi/device_info */ static int @@ -1080,8 +1136,12 @@ dir = pfs_create_dir(root, "sys", NULL, NULL, 0); /* /proc/sys/kernel/... */ dir = pfs_create_dir(dir, "kernel", NULL, NULL, 0); + pfs_create_file(dir, "msgmni", &linprocfs_domsgmni, + NULL, NULL, PFS_RD); pfs_create_file(dir, "pid_max", &linprocfs_dopid_max, NULL, NULL, PFS_RD); + pfs_create_file(dir, "sem", &linprocfs_dosem, + NULL, NULL, PFS_RD); return (0); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200611092344.kA9Ni8tL039928>