1 ! Copyright (C) 2008 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: alien.syntax system sequences vocabs.loader words
7 << "unix.kqueue." os name>> append require >>
9 FUNCTION: int kqueue ( ) ;
12 : EV_ADD HEX: 1 ; inline ! add event to kq (implies enable)
13 : EV_DELETE HEX: 2 ; inline ! delete event from kq
14 : EV_ENABLE HEX: 4 ; inline ! enable event
15 : EV_DISABLE HEX: 8 ; inline ! disable event (not reported)
18 : EV_ONESHOT HEX: 10 ; inline ! only report one occurrence
19 : EV_CLEAR HEX: 20 ; inline ! clear event state after reporting
21 : EV_SYSFLAGS HEX: f000 ; inline ! reserved by system
22 : EV_FLAG0 HEX: 1000 ; inline ! filter-specific flag
23 : EV_FLAG1 HEX: 2000 ; inline ! filter-specific flag
26 : EV_EOF HEX: 8000 ; inline ! EOF detected
27 : EV_ERROR HEX: 4000 ; inline ! error, data contains errno
29 : EV_POLL EV_FLAG0 ; inline
30 : EV_OOBAND EV_FLAG1 ; inline
32 : NOTE_LOWAT HEX: 00000001 ; inline ! low water mark
34 : NOTE_DELETE HEX: 00000001 ; inline ! vnode was removed
35 : NOTE_WRITE HEX: 00000002 ; inline ! data contents changed
36 : NOTE_EXTEND HEX: 00000004 ; inline ! size increased
37 : NOTE_ATTRIB HEX: 00000008 ; inline ! attributes changed
38 : NOTE_LINK HEX: 00000010 ; inline ! link count changed
39 : NOTE_RENAME HEX: 00000020 ; inline ! vnode was renamed
40 : NOTE_REVOKE HEX: 00000040 ; inline ! vnode access was revoked
42 : NOTE_EXIT HEX: 80000000 ; inline ! process exited
43 : NOTE_FORK HEX: 40000000 ; inline ! process forked
44 : NOTE_EXEC HEX: 20000000 ; inline ! process exec'd
45 : NOTE_PCTRLMASK HEX: f0000000 ; inline ! mask for hint bits
46 : NOTE_PDATAMASK HEX: 000fffff ; inline ! mask for pid
48 : NOTE_SECONDS HEX: 00000001 ; inline ! data is seconds
49 : NOTE_USECONDS HEX: 00000002 ; inline ! data is microseconds
50 : NOTE_NSECONDS HEX: 00000004 ; inline ! data is nanoseconds
51 : NOTE_ABSOLUTE HEX: 00000008 ; inline ! absolute timeout
53 : NOTE_TRACK HEX: 00000001 ; inline ! follow across forks
54 : NOTE_TRACKERR HEX: 00000002 ; inline ! could not track child
55 : NOTE_CHILD HEX: 00000004 ; inline ! am a child process