summaryrefslogtreecommitdiffstats
path: root/util/shmsweep.c
diff options
context:
space:
mode:
Diffstat (limited to 'util/shmsweep.c')
-rw-r--r--util/shmsweep.c38
1 files changed, 0 insertions, 38 deletions
diff --git a/util/shmsweep.c b/util/shmsweep.c
deleted file mode 100644
index b448270f..00000000
--- a/util/shmsweep.c
+++ /dev/null
@@ -1,38 +0,0 @@
-#include "bbs.h"
-
-int main() {
-#if 0
- int i, shm, counter;
- struct utmpfile_t *utmpshm;
-
-
- shm = shmget(UTMPSHM_KEY, USHM_SIZE, SHM_R | SHM_W);
- if(shm == -1) {
- perror("shmget");
- exit(0);
- }
-
- utmpshm = shmat(shm, NULL, 0);
- if(utmpshm == (struct utmpfile_t *)-1) {
- perror("shmat");
- exit(0);
- }
-
- for(i = counter = 0; i < USHM_SIZE; i++)
- if(SHM->uinfo[i].pid) {
- char buf[256];
- userinfo_t *f;
- struct stat sb;
-
- f = &utmpshm->uinfo[i];
- sprintf(buf, "/proc/%d", f->pid);
- if(stat(buf, &sb)) {
- f->pid = 0;
- utmpshm->number--;
- counter++;
- }
- }
- printf("clear %d slots\n", counter);
-#endif
- return 0;
-}