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