/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1990-2011 AT&T Intellectual Property *
* and is licensed under the *
* Eclipse Public License, Version 1.0 *
* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
* *
* Information and Software Systems Research *
* AT&T Research *
* Florham Park NJ *
* *
* Glenn Fowler <gsf@research.att.com> *
* *
***********************************************************************/
#pragma prototyped
/*
* Glenn Fowler
* AT&T Bell Laboratories
*
* local pid monitor service
*/
#include <ast.h>
#include <cs.h>
#include <error.h>
#include <hash.h>
#include <sig.h>
{
};
typedef struct /* pid info */
{
} Pid_t;
typedef struct /* server state */
{
} State_t;
/*
* initialize the state
*/
static void*
{
if (!(state->pids = hashalloc(NiL, HASH_set, HASH_ALLOCATE, HASH_namesize, sizeof(pid_t), HASH_name, "pids", 0)))
return(handle);
}
/*
* service a request
*/
static int
{
char* m;
char* s;
char* e;
int n;
int c;
return(-1);
m[n] = 0;
do
{
if (!(e = strchr(m, '\n')))
return(-1);
n = ++e - m;
{
for (s = m; *s && (*s < '0' || *s > '9'); s++);
switch (*m)
{
case 'd':
break;
case 'e':
break;
case 's':
case '\n':
n = sfsprintf(m, sizeof(state->buf), "active=%d decay=%d expire=%d\n", state->active, state->decay, state->expire);
{
{
n += sfsprintf(m + n, sizeof(state->buf) - n, " %s/%lu", csname(np->addr.addr[0]), np->addr.addr[1]);
}
}
break;
case 'v':
break;
default:
if (*m < '0' || *m > '9')
{
if (n > 0) m[n - 1] = 0;
}
break;
}
}
{
{
while (np)
{
}
{
}
}
{
}
}
{
{
{
}
}
}
} while (*(m = e));
return(0);
}
/*
* poll expired pids
*/
static int
{
int n;
unsigned long wakeup;
exit(0);
wakeup = ~0;
{
{
{
{
while (np)
{
}
continue;
}
}
}
}
if (wakeup == ~0)
{
}
return(0);
}
int
{
exit(1);
}