--- libaitsched/src/hooks.c 2022/11/28 23:06:06 1.37.2.1 +++ libaitsched/src/hooks.c 2022/11/28 23:48:33 1.37.2.3 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: hooks.c,v 1.37.2.1 2022/11/28 23:06:06 misho Exp $ +* $Id: hooks.c,v 1.37.2.3 2022/11/28 23:48:33 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -537,7 +537,7 @@ sched_hook_read(void *task, void *arg) { sched_task_t *t = task; sched_root_task_t *r = NULL; - intptr_t mask = (intptr_t) arg; + uintptr_t mask = (uintptr_t) arg; #if SUP_ENABLE == KQ_SUPPORT struct kevent chg[1]; struct timespec timeout = { 0, 0 }; @@ -553,9 +553,11 @@ sched_hook_read(void *task, void *arg) #if SUP_ENABLE == KQ_SUPPORT #ifdef __NetBSD__ - EV_SET(&chg[0], TASK_FD(t), EVFILT_READ, EV_ADD | EV_CLEAR, 0, 0, (intptr_t) TASK_FD(t)); + EV_SET(&chg[0], TASK_FD(t), EVFILT_READ, EV_ADD | EV_CLEAR | mask, + 0, 0, (intptr_t) TASK_FD(t)); #else - EV_SET(&chg[0], TASK_FD(t), EVFILT_READ, EV_ADD | EV_CLEAR, 0, 0, (void*) TASK_FD(t)); + EV_SET(&chg[0], TASK_FD(t), EVFILT_READ, EV_ADD | EV_CLEAR | mask, + 0, 0, (void*) TASK_FD(t)); #endif if (kevent(r->root_kq, chg, 1, NULL, 0, &timeout) == -1) { if (r->root_hooks.hook_exec.exception)