X-Git-Url: http://rtime.felk.cvut.cz/gitweb/lincan.git/blobdiff_plain/d83586962b8801d011a8b75f7bf20a0aa251490a..HEAD:/lincan/src/kthread.c diff --git a/lincan/src/kthread.c b/lincan/src/kthread.c index 2d387d3..d92a1a9 100644 --- a/lincan/src/kthread.c +++ b/lincan/src/kthread.c @@ -21,9 +21,15 @@ #include #include +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)) + #include +#else + #include +#endif -#include -#include +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38)) + #include +#endif #include "../include/kthread.h" @@ -114,7 +120,13 @@ void stop_kthread(kthread_t *kthread) the flags are visible on all CPUs. */ mb(); +#warning The local code for kernel thread support is not more needed for recent 2.6 kernels +#warning and code should be modified to emulate same interface for older kernels +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)) kill_proc(kthread->thread->pid, SIGKILL, 1); +#else /* >= 2,6,20 */ + send_sig(SIGKILL, kthread->thread, 1); +#endif /* >= 2,6,20 */ /* block till thread terminated */ down(&kthread->startstop_sem); @@ -125,7 +137,9 @@ void stop_kthread(kthread_t *kthread) /* now we are sure the thread is in zombie state. We notify keventd to clean the process up. */ +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)) kill_proc(2, SIGCHLD, 1); +#endif /* >= 2,6,20 */ }