Index: cpukit/libcsupport/include/sys/event.h
===================================================================
--- cpukit/libcsupport/include/sys/event.h	(revision a7cfb4bda0a3f3cb2ccecbade43cd87d681dae4f)
+++ cpukit/libcsupport/include/sys/event.h	(revision 45ae4a89e7e404b93a603c572e73061d88dc63f7)
@@ -24,5 +24,5 @@
  * SUCH DAMAGE.
  *
- * $FreeBSD: head/sys/sys/event.h 302242 2016-06-27 23:34:53Z kib $
+ * $FreeBSD: head/sys/sys/event.h 311055 2017-01-02 09:02:39Z kib $
  */
 
@@ -203,6 +203,9 @@
 
 /*
- * Setting the KN_INFLUX flag enables you to unlock the kq that this knote
- * is on, and modify kn_status as if you had the KQ lock.
+ * An in-flux knote cannot be dropped from its kq while the kq is
+ * unlocked.  If the KN_SCAN flag is not set, a thread can only set
+ * kn_influx when it is exclusive owner of the knote state, and can
+ * modify kn_status as if it had the KQ lock.  KN_SCAN must not be set
+ * on a knote which is already in flux.
  *
  * kn_sfflags, kn_sdata, and kn_kevent are protected by the knlist lock.
@@ -215,4 +218,6 @@
 	struct			kqueue *kn_kq;	/* which queue we are on */
 	struct 			kevent kn_kevent;
+	void			*kn_hook;
+	int			kn_hookid;
 	int			kn_status;	/* protected by kq lock */
 #define KN_ACTIVE	0x01			/* event has been triggered */
@@ -220,9 +225,9 @@
 #define KN_DISABLED	0x04			/* event is disabled */
 #define KN_DETACHED	0x08			/* knote is detached */
-#define KN_INFLUX	0x10			/* knote is in flux */
 #define KN_MARKER	0x20			/* ignore this knote */
 #define KN_KQUEUE	0x40			/* this knote belongs to a kq */
 #define KN_HASKQLOCK	0x80			/* for _inevent */
 #define	KN_SCAN		0x100			/* flux set in kqueue_scan() */
+	int			kn_influx;
 	int			kn_sfflags;	/* saved filter flags */
 	intptr_t		kn_sdata;	/* saved data field */
@@ -232,10 +237,7 @@
 		struct		kaiocb *p_aio;	/* AIO job pointer */
 		struct		aioliojob *p_lio;	/* LIO job pointer */
-		sbintime_t	*p_nexttime;	/* next timer event fires at */
 		void		*p_v;		/* generic other pointer */
 	} kn_ptr;
 	struct			filterops *kn_fop;
-	void			*kn_hook;
-	int			kn_hookid;
 
 #define kn_id		kn_kevent.ident
@@ -258,28 +260,28 @@
 struct rwlock;
 
-extern void	knote(struct knlist *list, long hint, int lockflags);
-extern void	knote_fork(struct knlist *list, int pid);
-extern struct knlist *knlist_alloc(struct mtx *lock);
-extern void	knlist_detach(struct knlist *knl);
-extern void	knlist_add(struct knlist *knl, struct knote *kn, int islocked);
-extern void	knlist_remove(struct knlist *knl, struct knote *kn, int islocked);
-extern int	knlist_empty(struct knlist *knl);
-extern void	knlist_init(struct knlist *knl, void *lock,
-    void (*kl_lock)(void *), void (*kl_unlock)(void *),
-    void (*kl_assert_locked)(void *), void (*kl_assert_unlocked)(void *));
-extern void	knlist_init_mtx(struct knlist *knl, struct mtx *lock);
-extern void	knlist_init_rw_reader(struct knlist *knl, struct rwlock *lock);
-extern void	knlist_destroy(struct knlist *knl);
-extern void	knlist_cleardel(struct knlist *knl, struct thread *td,
-	int islocked, int killkn);
+void	knote(struct knlist *list, long hint, int lockflags);
+void	knote_fork(struct knlist *list, int pid);
+struct knlist *knlist_alloc(struct mtx *lock);
+void	knlist_detach(struct knlist *knl);
+void	knlist_add(struct knlist *knl, struct knote *kn, int islocked);
+void	knlist_remove(struct knlist *knl, struct knote *kn, int islocked);
+int	knlist_empty(struct knlist *knl);
+void	knlist_init(struct knlist *knl, void *lock, void (*kl_lock)(void *),
+	    void (*kl_unlock)(void *), void (*kl_assert_locked)(void *),
+	    void (*kl_assert_unlocked)(void *));
+void	knlist_init_mtx(struct knlist *knl, struct mtx *lock);
+void	knlist_init_rw_reader(struct knlist *knl, struct rwlock *lock);
+void	knlist_destroy(struct knlist *knl);
+void	knlist_cleardel(struct knlist *knl, struct thread *td,
+	    int islocked, int killkn);
 #define knlist_clear(knl, islocked)				\
-		knlist_cleardel((knl), NULL, (islocked), 0)
+	knlist_cleardel((knl), NULL, (islocked), 0)
 #define knlist_delete(knl, td, islocked)			\
-		knlist_cleardel((knl), (td), (islocked), 1)
-extern void	knote_fdclose(struct thread *p, int fd);
-extern int 	kqfd_register(int fd, struct kevent *kev, struct thread *p,
-		    int waitok);
-extern int	kqueue_add_filteropts(int filt, struct filterops *filtops);
-extern int	kqueue_del_filteropts(int filt);
+	knlist_cleardel((knl), (td), (islocked), 1)
+void	knote_fdclose(struct thread *p, int fd);
+int 	kqfd_register(int fd, struct kevent *kev, struct thread *p,
+	    int waitok);
+int	kqueue_add_filteropts(int filt, struct filterops *filtops);
+int	kqueue_del_filteropts(int filt);
 
 #else 	/* !_KERNEL */
