port to openbsd

git-svn-id: svn://svn.code.sf.net/p/libkqueue/code/trunk@74 fb4e3144-bc1c-4b72-a658-5bcd248dd7f7
This commit is contained in:
mheily 2009-11-08 05:24:11 +00:00
parent 04e317624b
commit 417f3f4f2b
4 changed files with 11 additions and 7 deletions

View File

@ -16,8 +16,6 @@
include config.mk include config.mk
SOURCES=main.c read.c signal.c vnode.c timer.c user.c
check: check:
if [ ! -f /usr/include/sys/event.h ] ; then \ if [ ! -f /usr/include/sys/event.h ] ; then \
cd .. && ./configure --debug=yes && make build ; \ cd .. && ./configure --debug=yes && make build ; \

View File

@ -9,6 +9,7 @@ pre_configure_hook() {
check_header sys/event.h && { check_header sys/event.h && {
check_symbol sys/event.h EV_DISPATCH check_symbol sys/event.h EV_DISPATCH
check_symbol sys/event.h EV_RECEIPT check_symbol sys/event.h EV_RECEIPT
check_symbol sys/event.h NOTE_TRUNCATE
check_symbol sys/event.h EVFILT_USER && \ check_symbol sys/event.h EVFILT_USER && \
sources="$sources user.c" sources="$sources user.c"
check_symbol sys/event.h EVFILT_TIMER check_symbol sys/event.h EVFILT_TIMER

1
test/configure vendored Symbolic link
View File

@ -0,0 +1 @@
../configure

View File

@ -26,7 +26,9 @@ extern void test_evfilt_read();
extern void test_evfilt_signal(); extern void test_evfilt_signal();
extern void test_evfilt_vnode(); extern void test_evfilt_vnode();
extern void test_evfilt_timer(); extern void test_evfilt_timer();
#if HAVE_EVFILT_USER
extern void test_evfilt_user(); extern void test_evfilt_user();
#endif
/* Checks if any events are pending, which is an error. */ /* Checks if any events are pending, which is an error. */
void void
@ -70,18 +72,18 @@ kevent_fflags_dump(struct kevent *kev)
#define KEVFFL_DUMP(attrib) \ #define KEVFFL_DUMP(attrib) \
if (kev->fflags & attrib) \ if (kev->fflags & attrib) \
strcat(buf, #attrib" "); strncat(buf, #attrib" ", 64);
if ((buf = calloc(1, 1024)) == NULL) if ((buf = calloc(1, 1024)) == NULL)
abort(); abort();
/* Not every filter has meaningful fflags */ /* Not every filter has meaningful fflags */
if (kev->filter != EVFILT_VNODE) { if (kev->filter != EVFILT_VNODE) {
sprintf(buf, "fflags = %d", kev->flags); snprintf(buf, 1024, "fflags = %d", kev->flags);
return (buf); return (buf);
} }
sprintf(buf, "fflags = %d (", kev->fflags); snprintf(buf, 1024, "fflags = %d (", kev->fflags);
KEVFFL_DUMP(NOTE_DELETE); KEVFFL_DUMP(NOTE_DELETE);
KEVFFL_DUMP(NOTE_WRITE); KEVFFL_DUMP(NOTE_WRITE);
KEVFFL_DUMP(NOTE_EXTEND); KEVFFL_DUMP(NOTE_EXTEND);
@ -106,12 +108,12 @@ kevent_flags_dump(struct kevent *kev)
#define KEVFL_DUMP(attrib) \ #define KEVFL_DUMP(attrib) \
if (kev->flags & attrib) \ if (kev->flags & attrib) \
strcat(buf, #attrib" "); strncat(buf, #attrib" ", 64);
if ((buf = calloc(1, 1024)) == NULL) if ((buf = calloc(1, 1024)) == NULL)
abort(); abort();
sprintf(buf, "flags = %d (", kev->flags); snprintf(buf, 1024, "flags = %d (", kev->flags);
KEVFL_DUMP(EV_ADD); KEVFL_DUMP(EV_ADD);
KEVFL_DUMP(EV_ENABLE); KEVFL_DUMP(EV_ENABLE);
KEVFL_DUMP(EV_DISABLE); KEVFL_DUMP(EV_DISABLE);
@ -224,8 +226,10 @@ main(int argc, char **argv)
test_evfilt_signal(); test_evfilt_signal();
if (test_vnode) if (test_vnode)
test_evfilt_vnode(); test_evfilt_vnode();
#if HAVE_EVFILT_USER
if (test_user) if (test_user)
test_evfilt_user(); test_evfilt_user();
#endif
if (test_timer) if (test_timer)
test_evfilt_timer(); test_evfilt_timer();