/*
- * Copyright (c) 2003-2005 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2003-2006 Apple Computer, Inc. All rights reserved.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
*
#define EV_DELETE 0x0002 /* delete event from kq */
#define EV_ENABLE 0x0004 /* enable event */
#define EV_DISABLE 0x0008 /* disable event (not reported) */
+#define EV_RECEIPT 0x0040 /* force EV_ERROR on success, data == 0 */
/* flags */
#define EV_ONESHOT 0x0010 /* only report one occurrence */
/*
* data/hint fflags for EVFILT_PROC, shared with userspace
+ *
+ * Please note that EVFILT_PROC and EVFILT_SIGNAL share the same knote list
+ * that hangs off the proc structure. They also both play games with the hint
+ * passed to KNOTE(). If NOTE_SIGNAL is passed as a hint, then the lower bits
+ * of the hint contain the signal. IF NOTE_FORK is passed, then the lower bits
+ * contain the PID of the child.
*/
#define NOTE_EXIT 0x80000000 /* process exited */
#define NOTE_FORK 0x40000000 /* process forked */
#define NOTE_EXEC 0x20000000 /* process exec'd */
-#define NOTE_PCTRLMASK 0xf0000000 /* mask for hint bits */
-#define NOTE_PDATAMASK 0x000fffff /* mask for pid */
+#define NOTE_REAP 0x10000000 /* process reaped */
+#define NOTE_SIGNAL 0x08000000 /* shared with EVFILT_SIGNAL */
+#define NOTE_PDATAMASK 0x000fffff /* mask for pid/signal */
+#define NOTE_PCTRLMASK (~NOTE_PDATAMASK)
/*
* data/hint fflags for EVFILT_TIMER, shared with userspace.
#define NOTE_ABSOLUTE 0x00000008 /* absolute timeout */
/* ... implicit EV_ONESHOT */
+/*
+ * DEPRECATED!!!!!!!!!
+ * NOTE_TRACK, NOTE_TRACKERR, and NOTE_CHILD are no longer supported as of 10.5
+ */
/* additional flags for EVFILT_PROC */
#define NOTE_TRACK 0x00000001 /* follow across forks */
#define NOTE_TRACKERR 0x00000002 /* could not track child */
MALLOC_DECLARE(M_KQUEUE);
#endif
-/*
- * Flag indicating hint is a signal. Used by EVFILT_SIGNAL, and also
- * shared by EVFILT_PROC (all knotes attached to p->p_klist)
- */
-#define NOTE_SIGNAL 0x08000000
-
TAILQ_HEAD(kqtailq, knote); /* a list of "queued" events */
struct knote {
struct proc;
SLIST_HEAD(klist, knote);
+extern void knote_init(void) __attribute__((section("__TEXT, initcode")));
extern void klist_init(struct klist *list);
#define KNOTE(list, hint) knote(list, hint)