version 1.28, 2015/05/17 01:22:01 |
version 1.29, 2016/01/14 05:27:42 |
|
|
cat <<_EOF_ |
cat <<_EOF_ |
#include <stdio.h> |
#include <stdio.h> |
#include <sys/param.h> |
#include <sys/param.h> |
|
#include <sys/event.h> |
#include <sys/fcntl.h> |
#include <sys/fcntl.h> |
#include <sys/stat.h> |
#include <sys/stat.h> |
#include <sys/unistd.h> |
#include <sys/unistd.h> |
|
|
auto_if_type "sockipprotoname" "IPPROTO_[[:alnum:]]+[[:space:]]+" "netinet/in.h" |
auto_if_type "sockipprotoname" "IPPROTO_[[:alnum:]]+[[:space:]]+" "netinet/in.h" |
auto_switch_type "sockoptname" "SO_[A-Z]+[[:space:]]+0x[0-9]+" "sys/socket.h" |
auto_switch_type "sockoptname" "SO_[A-Z]+[[:space:]]+0x[0-9]+" "sys/socket.h" |
#auto_switch_type "ptraceopname" "PT_[[:alnum:]_]+[[:space:]]+[0-9]+" "sys/ptrace.h" |
#auto_switch_type "ptraceopname" "PT_[[:alnum:]_]+[[:space:]]+[0-9]+" "sys/ptrace.h" |
|
# exclude KTRFAC_MASK |
auto_orz_type "ktracefacname" "KTRFAC_[^M][[:alnum:]_]+" "sys/ktrace.h" |
auto_orz_type "ktracefacname" "KTRFAC_[^M][[:alnum:]_]+" "sys/ktrace.h" |
auto_switch_type "itimername" "ITIMER_[[:alnum:]_]+" "sys/time.h" |
auto_switch_type "itimername" "ITIMER_[[:alnum:]_]+" "sys/time.h" |
|
auto_switch_type "evfiltername" "EVFILT_[[:alnum:]_]+[[:space:]]+[(]" "sys/event.h" |
|
# exclude EV_{SYSFLAGS,FLAG1} |
|
auto_orz_type "evflagsname" "EV_[^S][A-Z]+[[:space:]]+0x" "sys/event.h" |
|
|
cat <<_EOF_ |
cat <<_EOF_ |
/* |
/* |
|
|
printf(",<invalid>%#x)>", cmd & SUBCMDMASK); |
printf(",<invalid>%#x)>", cmd & SUBCMDMASK); |
break; |
break; |
} |
} |
|
} |
|
|
|
/* |
|
* AUTO - Special |
|
* |
|
* kevent() NOTE_* interpretation depends on the filter type |
|
*/ |
|
void |
|
evfflagsname (int filter, int fflags) |
|
{ |
|
int or = 0; |
|
|
|
if (fflags == 0) { |
|
printf("0<>"); |
|
return; |
|
} |
|
printf("%#x<", fflags); |
|
switch (filter) { |
|
case EVFILT_READ: |
|
case EVFILT_WRITE: |
|
if_print_or(fflags, NOTE_LOWAT, or); |
|
if_print_or(fflags, NOTE_EOF, or); |
|
break; |
|
case EVFILT_VNODE: |
|
_EOF_ |
|
egrep "^#[[:space:]]*define[[:space:]]+NOTE_.[^O][A-Z]+[[:space:]]+0x[01248]{4}[^[:alnum:]]" \ |
|
$include_dir/sys/event.h | \ |
|
awk '{ for (i = 1; i <= NF; i++) \ |
|
if ($i ~ /define/) \ |
|
break; \ |
|
++i; \ |
|
printf "\t\tif_print_or(fflags, %s, or);\n", $i }' |
|
cat <<_EOF_ |
|
break; |
|
case EVFILT_PROC: |
|
_EOF_ |
|
egrep "^#[[:space:]]*define[[:space:]]+NOTE_[^S][A-Z]+[[:space:]]+0x[01248]{8}" \ |
|
$include_dir/sys/event.h | \ |
|
awk '{ for (i = 1; i <= NF; i++) \ |
|
if ($i ~ /define/) \ |
|
break; \ |
|
++i; \ |
|
printf "\t\tif_print_or(fflags, %s, or);\n", $i }' |
|
cat <<_EOF_ |
|
break; |
|
} |
|
printf(">"); |
} |
} |
|
|
_EOF_ |
_EOF_ |