From owner-p4-projects@FreeBSD.ORG Thu Nov 9 23:44:09 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 7959F16A416; Thu, 9 Nov 2006 23:44:09 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5309616A403 for ; Thu, 9 Nov 2006 23:44:09 +0000 (UTC) (envelope-from jkim@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id D9F5F43D55 for ; Thu, 9 Nov 2006 23:44:08 +0000 (GMT) (envelope-from jkim@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id kA9Ni8p8039938 for ; Thu, 9 Nov 2006 23:44:08 GMT (envelope-from jkim@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id kA9Ni8tL039928 for perforce@freebsd.org; Thu, 9 Nov 2006 23:44:08 GMT (envelope-from jkim@freebsd.org) Date: Thu, 9 Nov 2006 23:44:08 GMT Message-Id: <200611092344.kA9Ni8tL039928@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jkim@freebsd.org using -f From: Jung-uk Kim To: Perforce Change Reviews Cc: Subject: PERFORCE change 109654 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Nov 2006 23:44:09 -0000 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); }