--- libaitsched/src/hooks.c 2012/05/31 14:17:59 1.7.2.1 +++ libaitsched/src/hooks.c 2012/05/31 14:45:10 1.7.2.2 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: hooks.c,v 1.7.2.1 2012/05/31 14:17:59 misho Exp $ +* $Id: hooks.c,v 1.7.2.2 2012/05/31 14:45:10 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -397,9 +397,11 @@ sched_hook_user(void *task, void *arg __unused) return (void*) -1; #ifdef __NetBSD__ - EV_SET(&chg[0], TASK_VAL(t), EVFILT_USER, EV_ADD | EV_CLEAR, NOTE_FFNOP, 0, (intptr_t) TASK_VAL(t)); + EV_SET(&chg[0], TASK_VAL(t), EVFILT_USER, EV_ADD | EV_CLEAR, TASK_DATLEN(t), + 0, (intptr_t) TASK_VAL(t)); #else - EV_SET(&chg[0], TASK_VAL(t), EVFILT_USER, EV_ADD | EV_CLEAR, NOTE_FFNOP, 0, (void*) TASK_VAL(t)); + EV_SET(&chg[0], TASK_VAL(t), EVFILT_USER, EV_ADD | EV_CLEAR, TASK_DATLEN(t), + 0, (void*) TASK_VAL(t)); #endif if (kevent(TASK_ROOT(t)->root_kq, chg, 1, NULL, 0, &timeout) == -1) { if (TASK_ROOT(t)->root_hooks.hook_exec.exception) @@ -645,6 +647,10 @@ sched_hook_fetch(void *root, void *arg __unused) TAILQ_FOREACH_SAFE(task, &r->root_node, task_node, tmp) { if (TASK_FD(task) != ((intptr_t) res[i].udata)) continue; + else { + TASK_DATA(task) = (void*) res[i].data; + TASK_DATLEN(task) = res[i].fflags; + } /* remove node handle */ #ifdef HAVE_LIBPTHREAD pthread_mutex_lock(&r->root_mtx[taskNODE]); @@ -668,6 +674,10 @@ sched_hook_fetch(void *root, void *arg __unused) TAILQ_FOREACH_SAFE(task, &r->root_proc, task_node, tmp) { if (TASK_VAL(task) != ((uintptr_t) res[i].udata)) continue; + else { + TASK_DATA(task) = (void*) res[i].data; + TASK_DATLEN(task) = res[i].fflags; + } /* remove proc handle */ #ifdef HAVE_LIBPTHREAD pthread_mutex_lock(&r->root_mtx[taskPROC]); @@ -714,6 +724,10 @@ sched_hook_fetch(void *root, void *arg __unused) TAILQ_FOREACH_SAFE(task, &r->root_user, task_node, tmp) { if (TASK_VAL(task) != ((uintptr_t) res[i].udata)) continue; + else { + TASK_DATA(task) = (void*) res[i].data; + TASK_DATLEN(task) = res[i].fflags; + } /* remove user handle */ #ifdef HAVE_LIBPTHREAD pthread_mutex_lock(&r->root_mtx[taskUSER]);