mirror of
https://github.com/darlinghq/darling-libkqueue.git
synced 2024-11-23 03:39:51 +00:00
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:
parent
04e317624b
commit
417f3f4f2b
@ -16,8 +16,6 @@
|
||||
|
||||
include config.mk
|
||||
|
||||
SOURCES=main.c read.c signal.c vnode.c timer.c user.c
|
||||
|
||||
check:
|
||||
if [ ! -f /usr/include/sys/event.h ] ; then \
|
||||
cd .. && ./configure --debug=yes && make build ; \
|
||||
|
@ -9,6 +9,7 @@ pre_configure_hook() {
|
||||
check_header sys/event.h && {
|
||||
check_symbol sys/event.h EV_DISPATCH
|
||||
check_symbol sys/event.h EV_RECEIPT
|
||||
check_symbol sys/event.h NOTE_TRUNCATE
|
||||
check_symbol sys/event.h EVFILT_USER && \
|
||||
sources="$sources user.c"
|
||||
check_symbol sys/event.h EVFILT_TIMER
|
||||
|
1
test/configure
vendored
Symbolic link
1
test/configure
vendored
Symbolic link
@ -0,0 +1 @@
|
||||
../configure
|
14
test/main.c
14
test/main.c
@ -26,7 +26,9 @@ extern void test_evfilt_read();
|
||||
extern void test_evfilt_signal();
|
||||
extern void test_evfilt_vnode();
|
||||
extern void test_evfilt_timer();
|
||||
#if HAVE_EVFILT_USER
|
||||
extern void test_evfilt_user();
|
||||
#endif
|
||||
|
||||
/* Checks if any events are pending, which is an error. */
|
||||
void
|
||||
@ -70,18 +72,18 @@ kevent_fflags_dump(struct kevent *kev)
|
||||
|
||||
#define KEVFFL_DUMP(attrib) \
|
||||
if (kev->fflags & attrib) \
|
||||
strcat(buf, #attrib" ");
|
||||
strncat(buf, #attrib" ", 64);
|
||||
|
||||
if ((buf = calloc(1, 1024)) == NULL)
|
||||
abort();
|
||||
|
||||
/* Not every filter has meaningful fflags */
|
||||
if (kev->filter != EVFILT_VNODE) {
|
||||
sprintf(buf, "fflags = %d", kev->flags);
|
||||
snprintf(buf, 1024, "fflags = %d", kev->flags);
|
||||
return (buf);
|
||||
}
|
||||
|
||||
sprintf(buf, "fflags = %d (", kev->fflags);
|
||||
snprintf(buf, 1024, "fflags = %d (", kev->fflags);
|
||||
KEVFFL_DUMP(NOTE_DELETE);
|
||||
KEVFFL_DUMP(NOTE_WRITE);
|
||||
KEVFFL_DUMP(NOTE_EXTEND);
|
||||
@ -106,12 +108,12 @@ kevent_flags_dump(struct kevent *kev)
|
||||
|
||||
#define KEVFL_DUMP(attrib) \
|
||||
if (kev->flags & attrib) \
|
||||
strcat(buf, #attrib" ");
|
||||
strncat(buf, #attrib" ", 64);
|
||||
|
||||
if ((buf = calloc(1, 1024)) == NULL)
|
||||
abort();
|
||||
|
||||
sprintf(buf, "flags = %d (", kev->flags);
|
||||
snprintf(buf, 1024, "flags = %d (", kev->flags);
|
||||
KEVFL_DUMP(EV_ADD);
|
||||
KEVFL_DUMP(EV_ENABLE);
|
||||
KEVFL_DUMP(EV_DISABLE);
|
||||
@ -224,8 +226,10 @@ main(int argc, char **argv)
|
||||
test_evfilt_signal();
|
||||
if (test_vnode)
|
||||
test_evfilt_vnode();
|
||||
#if HAVE_EVFILT_USER
|
||||
if (test_user)
|
||||
test_evfilt_user();
|
||||
#endif
|
||||
if (test_timer)
|
||||
test_evfilt_timer();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user