Date: Thu, 28 Sep 2006 01:00:34 +0400 (MSD) From: Igor Sysoev <is@rambler-co.ru> To: John-Mark Gurney <gurney_j@resnet.uoregon.edu> Cc: freebsd-current@FreeBSD.org, freebsd-arch@FreeBSD.org Subject: Re: kqueue disable on delivery... Message-ID: <20060928005941.O4722@is.park.rambler.ru> In-Reply-To: <20060927232543.D4722@is.park.rambler.ru> References: <20060917210426.GI9421@funkthat.com> <20060922171542.G17859@is.park.rambler.ru> <20060922165848.GS23915@funkthat.com> <20060923105426.B20782@is.park.rambler.ru> <20060923185727.GW23915@funkthat.com> <20060927200042.N4274@is.park.rambler.ru> <20060927232543.D4722@is.park.rambler.ru>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
On Wed, 27 Sep 2006, Igor Sysoev wrote:
> On Wed, 27 Sep 2006, Igor Sysoev wrote:
>
>> Here is patch and test program. The patch is against 6.2-PRERELEASE.
>> On 7.0 the EVFILT_LIO should be taked into account.
>>
>> test program should show oneshot user event:
>>> ./t
>> n: 1, id: 0x55, filt: -10, fl: 0x0010, ff:0, data:0x0, udata: 0x5678
>> n: 0, id: 0x0, filt: 0, fl: 0x0000, ff:0, data:0x0, udata: 0x0
>
> Sorry, I missed to attach the test program.
Sorry, the pine ignored my attach again.
Igor Sysoev
http://sysoev.ru/en/
[-- Attachment #2 --]
#include <sys/types.h>
#include <sys/event.h>
#include <sys/time.h>
#include <unistd.h>
#include <errno.h>
int
main()
{
int kq, n;
struct kevent kev;
struct timespec to;
kq = kqueue();
if (kq == -1) {
printf("kqueue() failed: (%d)%s\n", errno, strerror(errno));
exit(1);
}
EV_SET(&kev, 0x55, EVFILT_USER, EV_ADD, 0, 0x1234, (void *) 0x5678);
to.tv_sec = 0;
to.tv_nsec = 0;
if (kevent(kq, &kev, 1, NULL, 0, &to) == -1) {
printf("1st kevent() failed: (%d)%s\n", errno, strerror(errno));
exit(1);
}
memset(&kev, 0, sizeof(struct kevent));
if ((n = kevent(kq, NULL, 0, &kev, 1, &to)) == -1) {
printf("2nd kevent() failed: (%d)%s\n", errno, strerror(errno));
exit(1);
}
printf("n: %d, id: %p, filt: %d, fl: 0x%04X, ff:%u, data:%p, udata: %p\n",
n, kev.ident, kev.filter, kev.flags, kev.fflags, kev.data, kev.udata);
memset(&kev, 0, sizeof(struct kevent));
if ((n = kevent(kq, NULL, 0, &kev, 1, &to)) == -1) {
printf("3rd kevent() failed: (%d)%s\n", errno, strerror(errno));
exit(1);
}
printf("n: %d, id: %p, filt: %d, fl: 0x%04X, ff:%u, data:%p, udata: %p\n",
n, kev.ident, kev.filter, kev.flags, kev.fflags, kev.data, kev.udata);
return 0;
}
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060928005941.O4722>
