Date: Wed, 2 May 2001 14:33:41 -0700 From: Alfred Perlstein <bright@wintelcom.net> To: Dominic Marks <dominic_marks@hotmail.com> Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: KEvent doesnt return and KEvent sample troubles Message-ID: <20010502143340.U18676@fw.wintelcom.net> In-Reply-To: <F45sAitVGeSJIEoPXCF00000265@hotmail.com>; from dominic_marks@hotmail.com on Wed, May 02, 2001 at 09:24:42PM -0000 References: <F45sAitVGeSJIEoPXCF00000265@hotmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
* Dominic Marks <dominic_marks@hotmail.com> [010502 14:29] wrote: > I've been looking to start using the KEvent system and I've been > experimenting with it. However I've been having several problems, with my > own code as well as samples from http://www.flugsvamp.org. www.flugsvamp.org doesn't seem to resolve. > > It appears I am able to create the correct structure's and register the > events. However the event never returns and never responds to any action. > For example if I use a sample which monitors the actions on a file I can > read from, and write to the file and it shows no sign of noticing. > > I was wondering if it's simply a mistake of my own, however the failure for > the samples I've found has puzzled my further. I'm working on a 4.3-STABLE > machine using GCC version 2.95.3. > > Here is an example of code that I am using which doesn't seem to catch any > events. Its a slightly modified version of read_test.c from flugsvamp.com > which I edit so it would compile happily. > > It doesn't seem to work however. > [snip..] > kq = syscall(SYS_kqueue); > if (kq < 0) > err(1, "kqueue"); > > event[0].ident = fd; > event[0].filter = EVFILT_READ; > event[0].flags = EV_ADD | EV_ENABLE; > evp[0] = &event[0]; > n = syscall(SYS_kevent, kq, 1, evp, 0, NULL, 0); uh, what the heck? Why not just use the kqueue call directly like the manpage explains? I think you have the arguments to kevent() wrong. -- -Alfred Perlstein - [alfred@freebsd.org] Instead of asking why a piece of software is using "1970s technology," start asking why software is ignoring 30 years of accumulated wisdom. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010502143340.U18676>