-
Notifications
You must be signed in to change notification settings - Fork 11
Description
Debian's kFreeBSD port is the KfreeBSD kernel + GNU userland. It supports the kevent syscall the same as regular FreeBSD. I've tried to port kqueue to it, and got it to build fairly easily.
I had to adjust some types in data KEvent: ident needs to be a CUInt and data_ a CInt.
I also had to comment out the NOTE_SIGNAL and NOTE_REAP as they were not in the system's headers.
With those minor changes, I have a clean compile of your library.
But, examples don't work:
queue/0.1.2.3/kqueue-0.1.2.3$ touch foo; examples/MonitorFile
KQueueException
Since this could happen if there are too many events being returned, I also tried increasing the number of events to receive, which didn't help.
ktrace shows this happening:
37960 MonitorFile CALL kqueue
37960 MonitorFile RET kqueue 3
...
37960 MonitorFile CALL open(0x286fc050,0<><invalid>0,<unused>0)
37960 MonitorFile NAMI "foo"
37960 MonitorFile RET open 4
...
37960 MonitorFile CALL kevent(0x3,0x286fc098,0x1,0x286fc0d8,0x1,0)
37960 MonitorFile GIO fd 3 wrote 20 bytes
0x0000 0400 0000 fcff 1100 7f00 0000 0000 0000 |................|
0x0010 0000 0000 |....|
37960 MonitorFile RET kevent -1 errno 4 Interrupted system call
37960 MonitorFile PSIG SIGALRM caught handler=0x284ff7c0 mask=0x80000000 code= 0x0
37960 MonitorFile CALL sigreturn(0xbfbfc300)
As far as I can see, the parameters passed to kevent() look right.. kqueue 3, 0 timeout, 1 event watched, 1 buffer..
I guess this points to a problem in the KEvent data structure.