diff options
author | delphij <delphij@FreeBSD.org> | 2006-01-18 07:47:46 +0000 |
---|---|---|
committer | delphij <delphij@FreeBSD.org> | 2006-01-18 07:47:46 +0000 |
commit | 55eb0335a6ca658635fcbceceb48c7173143e1cd (patch) | |
tree | 31d4251b33d21cb2fb315ba888e9965790a8a3cf /usr.sbin/inetd/inetd.h | |
parent | f99d64bc8026953fb7714cec81dd7bd7dcf66136 (diff) | |
download | FreeBSD-src-55eb0335a6ca658635fcbceceb48c7173143e1cd.zip FreeBSD-src-55eb0335a6ca658635fcbceceb48c7173143e1cd.tar.gz |
Improves and cleanups over inetd(8):
- Teach inetd(8) about kqueue, originally implemented by jmg@[1].
- Use new C99 style function prototypes instead of K&Rs.
- Raise WARNS from 2 to 6
Glanced at by: ru
MFC After: 2 weeks
[1] http://people.freebsd.org/~jmg/inetd.kq.patch,
http://people.freebsd.org/~jmg/inetd.kq.html
Diffstat (limited to 'usr.sbin/inetd/inetd.h')
-rw-r--r-- | usr.sbin/inetd/inetd.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/usr.sbin/inetd/inetd.h b/usr.sbin/inetd/inetd.h index 8c05ed9..e84547c 100644 --- a/usr.sbin/inetd/inetd.h +++ b/usr.sbin/inetd/inetd.h @@ -74,7 +74,10 @@ struct servtab { int se_maxchild; /* max number of children */ int se_maxcpm; /* max connects per IP per minute */ int se_numchild; /* current number of children */ + int se_free; /* free when numchild == 0 */ +#ifdef SANITY_CHECK pid_t *se_pids; /* array of child pids */ +#endif char *se_user; /* user name to run as */ char *se_group; /* group name to run as */ #ifdef LOGIN_CAP @@ -145,3 +148,14 @@ struct biltin { int bi_maxchild; /* max number of children, -1=default */ bi_fn_t *bi_fn; /* function which performs it */ }; + +void watch(short, uintptr_t, void *, u_int, int); +#define WATCH_SOCK(fd, data) watch(EVFILT_READ, fd, data, 0, 1) +#define UNWATCH_SOCK(fd, data) watch(EVFILT_READ, fd, data, 0, 0) +#define WATCH_SIG(sig, data) watch(EVFILT_SIGNAL, sig, data, 0, 1) +#define UNWATCH_SIG(sig, data) watch(EVFILT_SIGNAL, sig, data, 0, 0) +#define WATCH_PROC(proc, data) watch(EVFILT_PROC, proc, data, NOTE_EXIT, 1) +#define UNWATCH_PROC(proc, data) watch(EVFILT_PROC, proc, data, NOTE_EXIT, 0) +#define WATCH_FD(fd, data) watch(EVFILT_VNODE, fd, data, NOTE_DELETE|NOTE_WRITE|NOTE_EXTEND|NOTE_RENAME, 1) +#define UNWATCH_FD(fd, data) watch(EVFILT_VNODE, fd, data, NOTE_DELETE|NOTE_WRITE|NOTE_EXTEND|NOTE_RENAME, 0) + |