diff options
Diffstat (limited to 'sys/kern/kern_event.c')
-rw-r--r-- | sys/kern/kern_event.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c index 5e7ea093237..1a854e3eb1d 100644 --- a/sys/kern/kern_event.c +++ b/sys/kern/kern_event.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_event.c,v 1.7 2001/03/01 20:54:33 provos Exp $ */ +/* $OpenBSD: kern_event.c,v 1.8 2001/05/14 12:38:46 art Exp $ */ /*- * Copyright (c) 1999,2000,2001 Jonathan Lemon <jlemon@FreeBSD.org> @@ -61,6 +61,7 @@ int kqueue_ioctl(struct file *fp, u_long com, caddr_t data, struct proc *p); int kqueue_select(struct file *fp, int which, struct proc *p); int kqueue_kqfilter(struct file *fp, struct knote *kn); +int kqueue_stat(struct file *fp, struct stat *st, struct proc *p); int kqueue_close(struct file *fp, struct proc *p); void kqueue_wakeup(struct kqueue *kq); @@ -70,6 +71,7 @@ struct fileops kqueueops = { kqueue_ioctl, kqueue_select, kqueue_kqfilter, + kqueue_stat, kqueue_close }; @@ -678,6 +680,19 @@ kqueue_select(struct file *fp, int which, struct proc *p) /*ARGSUSED*/ int +kqueue_stat(struct file *fp, struct stat *st, struct proc *p) +{ + struct kqueue *kq = (struct kqueue *)fp->f_data; + + bzero((void *)st, sizeof(*st)); + st->st_size = kq->kq_count; + st->st_blksize = sizeof(struct kevent); + st->st_mode = S_IFIFO; + return (0); +} + +/*ARGSUSED*/ +int kqueue_close(struct file *fp, struct proc *p) { struct kqueue *kq = (struct kqueue *)fp->f_data; |