--- libaitsched/src/hooks.c 2017/09/07 14:03:47 1.33 +++ libaitsched/src/hooks.c 2019/01/14 15:58:50 1.34 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: hooks.c,v 1.33 2017/09/07 14:03:47 misho Exp $ +* $Id: hooks.c,v 1.34 2019/01/14 15:58:50 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -12,7 +12,7 @@ terms: All of the documentation and software included in the ELWIX and AITNET Releases is copyrighted by ELWIX - Sofia/Bulgaria -Copyright 2004 - 2017 +Copyright 2004 - 2018 by Michael Pounov . All rights reserved. Redistribution and use in source and binary forms, with or without @@ -713,16 +713,17 @@ sched_hook_alarm(void *task, void *arg __unused) * sched_hook_node() - Default NODE hook * * @task = current task - * @arg = unused + * @arg = if arg == 42 then waiting for all events * return: <0 errors and 0 ok */ void * -sched_hook_node(void *task, void *arg __unused) +sched_hook_node(void *task, void *arg) { #if SUP_ENABLE == KQ_SUPPORT sched_task_t *t = task; struct kevent chg[1]; struct timespec timeout = { 0, 0 }; + u_int addflags = (u_int) arg; if (!t || !TASK_ROOT(t)) return (void*) -1; @@ -730,11 +731,11 @@ sched_hook_node(void *task, void *arg __unused) #ifdef __NetBSD__ EV_SET(&chg[0], TASK_FD(t), EVFILT_VNODE, EV_ADD | EV_CLEAR, NOTE_DELETE | NOTE_WRITE | NOTE_EXTEND | NOTE_ATTRIB | - NOTE_LINK | NOTE_RENAME | NOTE_REVOKE, 0, (intptr_t) TASK_FD(t)); + NOTE_LINK | NOTE_RENAME | NOTE_REVOKE | addflags, 0, (intptr_t) TASK_FD(t)); #else EV_SET(&chg[0], TASK_FD(t), EVFILT_VNODE, EV_ADD | EV_CLEAR, NOTE_DELETE | NOTE_WRITE | NOTE_EXTEND | NOTE_ATTRIB | - NOTE_LINK | NOTE_RENAME | NOTE_REVOKE, 0, (void*) TASK_FD(t)); + NOTE_LINK | NOTE_RENAME | NOTE_REVOKE | addflags, 0, (void*) TASK_FD(t)); #endif if (kevent(TASK_ROOT(t)->root_kq, chg, 1, NULL, 0, &timeout) == -1) { if (TASK_ROOT(t)->root_hooks.hook_exec.exception)