diff options
author | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2002-08-07 11:48:52 +0800 |
---|---|---|
committer | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2002-08-07 11:48:52 +0800 |
commit | daabb5fb320b5d610b84f78607d602a9d9518bbe (patch) | |
tree | 7a171337d17edac95e16682172d4816f7969428c | |
parent | 683ab8dd4d5360f03c02c475f79a4490848c3792 (diff) | |
download | pttbbs-daabb5fb320b5d610b84f78607d602a9d9518bbe.tar pttbbs-daabb5fb320b5d610b84f78607d602a9d9518bbe.tar.gz pttbbs-daabb5fb320b5d610b84f78607d602a9d9518bbe.tar.bz2 pttbbs-daabb5fb320b5d610b84f78607d602a9d9518bbe.tar.lz pttbbs-daabb5fb320b5d610b84f78607d602a9d9518bbe.tar.xz pttbbs-daabb5fb320b5d610b84f78607d602a9d9518bbe.tar.zst pttbbs-daabb5fb320b5d610b84f78607d602a9d9518bbe.zip |
listpid
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk@459 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | pttbbs/util/shmctl.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/pttbbs/util/shmctl.c b/pttbbs/util/shmctl.c index 34276bb0..72d9b301 100644 --- a/pttbbs/util/shmctl.c +++ b/pttbbs/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) |