summaryrefslogtreecommitdiff
path: root/sys/kern/kern_event.c
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2001-05-14 12:38:49 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2001-05-14 12:38:49 +0000
commit87302a0a3d2b0cb6b4a107263f308e43460c1152 (patch)
treebed603da211687fd208a1fce6dde81cdf0f7b0a9 /sys/kern/kern_event.c
parent003e5aab58f12d945ba58cb321b7853177978261 (diff)
Add a fo_stat member to struct fileops. Used soon.
Also add a stat function for kqueue from FreeBSD.
Diffstat (limited to 'sys/kern/kern_event.c')
-rw-r--r--sys/kern/kern_event.c17
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;