From 7d3a0bbb90305fdc1c68417a4db4773105af585f Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Tue, 3 Aug 2010 22:34:35 -0700 Subject: [PATCH] buildworld - Fix header file * struct kqinfo must be exposed for _KERNEL_STRUCTURES too. Fixes buildworld. * Attempt to limit the inclusion of sys/queue.h to builds with _KERNEL or _KERNEL_STRUCTURES. Reported-by: swildner --- sys/sys/event.h | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/sys/sys/event.h b/sys/sys/event.h index fc77ca95d9..f0d20b7411 100644 --- a/sys/sys/event.h +++ b/sys/sys/event.h @@ -36,6 +36,9 @@ #ifndef _NET_NETISR_H_ #include /* struct notifymsglist */ #endif +#if defined(_KERNEL) || defined(_KERNEL_STRUCTURES) +#include +#endif #define EVFILT_READ (-1) #define EVFILT_WRITE (-2) @@ -122,14 +125,22 @@ struct kevent { #define NOTE_TRACKERR 0x00000002 /* could not track child */ #define NOTE_CHILD 0x00000004 /* am a child process */ -/* - * This is currently visible to userland to work around broken - * programs which pull in or . - */ -#include +#if defined(_KERNEL) || defined(_KERNEL_STRUCTURES) + struct knote; SLIST_HEAD(klist, knote); +/* + * Used to maintain information about processes that wish to be + * notified when I/O becomes possible. + */ +struct kqinfo { + struct klist ki_note; /* kernel note list */ + struct notifymsglist ki_mlist; /* list of pending predicate messages */ +}; + +#endif + #ifdef _KERNEL /* @@ -192,15 +203,6 @@ struct knote { #define kn_fp kn_ptr.p_fp }; -/* - * Used to maintain information about processes that wish to be - * notified when I/O becomes possible. - */ -struct kqinfo { - struct klist ki_note; /* kernel note list */ - struct notifymsglist ki_mlist; /* list of pending predicate messages */ -}; - struct proc; struct thread; struct filedesc; -- 2.41.0