summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-08-07 11:48:52 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-08-07 11:48:52 +0800
commit4fdf3aa0809915842f011a5347706d86c55e8e87 (patch)
tree6da8a363f7f15f7f58e6db7197b9b6176902d8a3
parent0db371af0fdde14ae22dcd72c2704c8afca13031 (diff)
downloadpttbbs-4fdf3aa0809915842f011a5347706d86c55e8e87.tar
pttbbs-4fdf3aa0809915842f011a5347706d86c55e8e87.tar.gz
pttbbs-4fdf3aa0809915842f011a5347706d86c55e8e87.tar.bz2
pttbbs-4fdf3aa0809915842f011a5347706d86c55e8e87.tar.lz
pttbbs-4fdf3aa0809915842f011a5347706d86c55e8e87.tar.xz
pttbbs-4fdf3aa0809915842f011a5347706d86c55e8e87.tar.zst
pttbbs-4fdf3aa0809915842f011a5347706d86c55e8e87.zip
listpid
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@459 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--util/shmctl.c12
1 files changed, 11 insertions, 1 deletions
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)