aboutsummaryrefslogtreecommitdiffstats
path: root/system_cmds/lskq.tproj
diff options
context:
space:
mode:
Diffstat (limited to 'system_cmds/lskq.tproj')
-rw-r--r--system_cmds/lskq.tproj/Makefile3
-rw-r--r--system_cmds/lskq.tproj/common.h25
-rw-r--r--system_cmds/lskq.tproj/lskq.c9
3 files changed, 34 insertions, 3 deletions
diff --git a/system_cmds/lskq.tproj/Makefile b/system_cmds/lskq.tproj/Makefile
new file mode 100644
index 0000000..b034a0b
--- /dev/null
+++ b/system_cmds/lskq.tproj/Makefile
@@ -0,0 +1,3 @@
+PROG= lskq
+
+.include <bsd.prog.mk>
diff --git a/system_cmds/lskq.tproj/common.h b/system_cmds/lskq.tproj/common.h
index 959ac66..c01cff4 100644
--- a/system_cmds/lskq.tproj/common.h
+++ b/system_cmds/lskq.tproj/common.h
@@ -26,6 +26,31 @@
#include <stdint.h>
+#ifndef __enum_open
+#if __has_attribute(enum_extensibility)
+#define __enum_open __attribute__((__enum_extensibility__(open)))
+#define __enum_closed __attribute__((__enum_extensibility__(closed)))
+#else
+#define __enum_open
+#define __enum_closed
+#endif // __has_attribute(enum_extensibility)
+#endif
+
+#ifndef __enum_options
+#if __has_attribute(flag_enum)
+#define __enum_options __attribute__((__flag_enum__))
+#else
+#define __enum_options
+#endif
+#endif
+
+#ifndef __enum_decl
+#define __enum_decl(_name, _type, ...) \
+ typedef _type _name; enum __VA_ARGS__ __enum_open
+#define __options_decl(_name, _type, ...) \
+ typedef _type _name; enum __VA_ARGS__ __enum_open __enum_options
+#endif
+
/*
* This file must be kept in sync with xnu headers
*/
diff --git a/system_cmds/lskq.tproj/lskq.c b/system_cmds/lskq.tproj/lskq.c
index a48bb26..91f53c0 100644
--- a/system_cmds/lskq.tproj/lskq.c
+++ b/system_cmds/lskq.tproj/lskq.c
@@ -36,9 +36,7 @@
#include <sys/param.h>
#include <pthread/pthread.h>
#include <mach/message.h>
-#define PRIVATE
#include <libproc.h>
-#undef PRIVATE
#include <os/assumes.h>
#include <os/overflow.h>
@@ -155,10 +153,16 @@ fflags_build(struct kevent_extinfo *info, char *str, int len)
break;
case EVFILT_WORKLOOP:
+#ifdef NOTE_WL_SYNC_IPC
snprintf(str, len, "%c%c%c%c%c ",
+#else
+ snprintf(str, len, "%c%c%c%c ",
+#endif
(ff & NOTE_WL_THREAD_REQUEST) ? 't' :
(ff & NOTE_WL_SYNC_WAIT) ? 'w' :
+#ifdef NOTE_WL_SYNC_IPC
(ff & NOTE_WL_SYNC_IPC) ? 'i' : '-',
+#endif
(ff & NOTE_WL_SYNC_WAKE) ? 'W' : '-',
(ff & NOTE_WL_UPDATE_QOS) ? 'q' : '-',
(ff & NOTE_WL_DISCOVER_OWNER) ? 'o' : '-',
@@ -181,7 +185,6 @@ filter_is_fd_type(int filter)
switch (filter) {
case EVFILT_VNODE ... EVFILT_READ:
case EVFILT_SOCK:
- case EVFILT_NW_CHANNEL:
return 1;
default:
return 0;