From 4fdf3aa0809915842f011a5347706d86c55e8e87 Mon Sep 17 00:00:00 2001 From: in2 Date: Wed, 7 Aug 2002 03:48:52 +0000 Subject: listpid git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@459 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- util/shmctl.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/util/shmctl.c b/util/shmctl.c index 34276bb0..72d9b301 100644 --- a/util/shmctl.c +++ b/util/shmctl.c @@ -1,4 +1,4 @@ -/* $Id: shmctl.c,v 1.25 2002/07/22 16:50:36 in2 Exp $ */ +/* $Id: shmctl.c,v 1.26 2002/08/07 03:48:52 in2 Exp $ */ #include "bbs.h" extern SHM_t *SHM; @@ -280,6 +280,15 @@ int setglobal(int argc, char **argv) return 0; } +int listpid(int argc, char **argv) +{ + int i; + for( i = 0 ; i < USHM_SIZE ; ++i ) + if( SHM->uinfo[i].pid > 0 ) + printf("%d\n", SHM->uinfo[i].pid); + return 0; +} + struct { int (*func)(int, char **); char *cmd, *descript; @@ -292,6 +301,7 @@ struct { {utmpnum, "utmpnum", "print SHM->number for snmpd"}, {showglobal, "showglobal", "show GLOBALVAR[]"}, {setglobal, "setglobal", "set GLOBALVAR[]"}, + {listpid, "listpid", "list all pids of mbbsd"}, {NULL, NULL, NULL} }; int main(int argc, char **argv) -- cgit v1.2.3