From 4de2bb9c879fcc5a75d76dc922018b5b58356023 Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Thu, 1 Apr 2004 00:27:52 +0000 Subject: init kqueues normally, from pedro martelletto --- sys/kern/init_main.c | 10 ++++++++-- sys/kern/kern_event.c | 11 ++--------- 2 files changed, 10 insertions(+), 11 deletions(-) (limited to 'sys') diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index f3fed6fd0ac..f7d1e76fccf 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: init_main.c,v 1.112 2004/03/14 23:12:11 tedu Exp $ */ +/* $OpenBSD: init_main.c,v 1.113 2004/04/01 00:27:51 tedu Exp $ */ /* $NetBSD: init_main.c,v 1.84.4.1 1996/06/02 09:08:06 mrg Exp $ */ /* @@ -135,8 +135,9 @@ void start_init(void *); void start_cleaner(void *); void start_update(void *); void start_reaper(void *); -void start_crypto(void *); +void start_crypto(void *); void init_exec(void); +void kqueue_init(void); extern char sigcode[], esigcode[]; #ifdef SYSCALL_DEBUG @@ -242,6 +243,11 @@ main(framep) */ pipe_init(); + /* + * Initialize kqueues. + */ + kqueue_init(); + /* * Create process 0 (the swapper). */ diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c index caedf478e22..9d030f4f269 100644 --- a/sys/kern/kern_event.c +++ b/sys/kern/kern_event.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_event.c,v 1.22 2004/01/12 04:47:01 tedu Exp $ */ +/* $OpenBSD: kern_event.c,v 1.23 2004/04/01 00:27:51 tedu Exp $ */ /*- * Copyright (c) 1999,2000,2001 Jonathan Lemon @@ -127,20 +127,16 @@ struct filterops *sysfilt_ops[] = { &sig_filtops, /* EVFILT_SIGNAL */ }; -/* XXX - call this on startup instead. */ void kqueue_init(void); -int kqueue_initialized; - void kqueue_init(void) { + pool_init(&kqueue_pool, sizeof(struct kqueue), 0, 0, 0, "kqeuepl", &pool_allocator_nointr); pool_init(&knote_pool, sizeof(struct knote), 0, 0, 0, "knotepl", &pool_allocator_nointr); - - kqueue_initialized = 1; } int @@ -314,9 +310,6 @@ sys_kqueue(struct proc *p, void *v, register_t *retval) struct file *fp; int fd, error; - if (!kqueue_initialized) - kqueue_init(); - error = falloc(p, &fp, &fd); if (error) return (error); -- cgit v1.2.3