- 论坛徽章:
- 0
|
I want to use "sigqueue" in the module to send signal to a user process .
(1)if not "#include <signal.h>"
compilation ok, but when insert module:
[root ]# /sbin/insmod ./syscall.o
./syscall.o: unresolved symbol sigqueue
./syscall.o:
Hint: You are trying to load a module without a GPL compatible license
and it has unresolved symbols. Contact the module supplier for
assistance, only they can help you.
(2)if "#include <signal.h>", compilation error:
[root ]# make
gcc -O2 -DMODULE -D__KERNEL__ -W -Wall -Wstrict-prototypes -Wmissing-prototypes -isystem /lib/modules/`uname -r`/build/include -c -o syscall.o syscall.c
In file included from syscall.c:21:
/usr/include/signal.h:50: error: conflicting types for `sigset_t'
/lib/modules/2.4.22-1.2199.nptl/build/include/asm/signal.h:21: error: previous declaration of `sigset_t'
In file included from /usr/include/signal.h:205,
from syscall.c:21:
/usr/include/time.h:119: error: redefinition of `struct timespec'
In file included from /usr/include/signal.h:208,
from syscall.c:21:
/usr/include/bits/siginfo.h:34: error: redefinition of `union sigval'
/usr/include/bits/siginfo.h:52: error: redefinition of `struct siginfo'
/usr/include/bits/siginfo.h:65: error: syntax error before '.' token
/usr/include/bits/siginfo.h:66: error: syntax error before '.' token
/usr/include/bits/siginfo.h:80: error: syntax error before '.' token
/usr/include/bits/siginfo.h:81: error: syntax error before '.' token
/usr/include/bits/siginfo.h:83: error: syntax error before '}' token
/usr/include/bits/siginfo.h:88: error: syntax error before '.' token
/usr/include/bits/siginfo.h:89: error: syntax error before '.' token
/usr/include/bits/siginfo.h:90: error: syntax error before '.' token
/usr/include/bits/siginfo.h:91: error: syntax error before '.' token
/usr/include/bits/siginfo.h:92: error: syntax error before '.' token
/usr/include/bits/siginfo.h:98: error: syntax error before '.' token
/usr/include/bits/siginfo.h:104: error: syntax error before '.' token
/usr/include/bits/siginfo.h:105: error: syntax error before '.' token
/usr/include/bits/siginfo.h:107: error: syntax error before '}' token
/usr/include/bits/siginfo.h:108: error: syntax error before '}' token
/usr/include/bits/siginfo.h:133: error: syntax error before '-' token
/usr/include/bits/siginfo.h:155: error: syntax error before '(' token
/usr/include/bits/siginfo.h:176: error: syntax error before '(' token
/usr/include/bits/siginfo.h:197: error: syntax error before '(' token
/usr/include/bits/siginfo.h:206: error: syntax error before '(' token
/usr/include/bits/siginfo.h:217: error: syntax error before '(' token
/usr/include/bits/siginfo.h:226: error: syntax error before '(' token
/usr/include/bits/siginfo.h:243: error: syntax error before '(' token
/usr/include/bits/siginfo.h:274: error: redefinition of `struct sigevent'
/usr/include/bits/siginfo.h:302: error: syntax error before numeric constant
In file included from syscall.c:21:
/usr/include/signal.h:212: error: conflicting types for `sigemptyset'
/lib/modules/2.4.22-1.2199.nptl/build/include/linux/signal.h:146: error: previous declaration of `sigemptyset'
/usr/include/signal.h:215: error: conflicting types for `sigfillset'
/lib/modules/2.4.22-1.2199.nptl/build/include/linux/signal.h:158: error: previous declaration of `sigfillset'
/usr/include/signal.h:218: error: conflicting types for `sigaddset'
/lib/modules/2.4.22-1.2199.nptl/build/include/asm/signal.h:183: error: previous declaration of `sigaddset'
/usr/include/signal.h:221: error: conflicting types for `sigdelset'
/lib/modules/2.4.22-1.2199.nptl/build/include/asm/signal.h:188: error: previous declaration of `sigdelset'
/usr/include/signal.h:224: error: syntax error before '?' token
In file included from /usr/include/signal.h:241,
from syscall.c:21:
/usr/include/bits/sigaction.h:26: error: redefinition of `struct sigaction'
In file included from /usr/include/signal.h:341,
from syscall.c:21:
/usr/include/bits/sigstack.h:36: error: syntax error before numeric constant
/usr/include/bits/sigstack.h:51: error: redefinition of `struct sigaltstack'
syscall.c:42: warning: initialization makes pointer from integer without a cast
syscall.c:52: warning: no previous prototype for `my_clone_call'
syscall.c: In function `my_clone_call':
syscall.c:66: warning: implicit declaration of function `printk_R1b7d4074'
syscall.c:69: error: incompatible type for argument 3 of `sigqueue'
syscall.c: At top level:
syscall.c:78: warning: function declaration isn't a prototype
syscall.c: In function `my_init_intercept_module':
syscall.c:87: warning: assignment makes pointer from integer without a cast
syscall.c:88: warning: assignment makes integer from pointer without a cast
syscall.c:79: warning: unused variable `i'
syscall.c:81: warning: statement with no effect
syscall.c: At top level:
syscall.c:95: warning: function declaration isn't a prototype
syscall.c: In function `my_cleanup_intercept_module':
syscall.c:96: warning: assignment makes integer from pointer without a cast
/lib/modules/2.4.22-1.2199.nptl/build/include/asm/processor.h: In function `copy_segments':
/lib/modules/2.4.22-1.2199.nptl/build/include/asm/processor.h:453: warning: unused parameter `p'
/lib/modules/2.4.22-1.2199.nptl/build/include/asm/processor.h:453: warning: unused parameter `mm'
/lib/modules/2.4.22-1.2199.nptl/build/include/asm/processor.h: In function `release_segments':
/lib/modules/2.4.22-1.2199.nptl/build/include/asm/processor.h:454: warning: unused parameter `mm'
/lib/modules/2.4.22-1.2199.nptl/build/include/linux/prefetch.h: In function `prefetch':
/lib/modules/2.4.22-1.2199.nptl/build/include/linux/prefetch.h:43: warning: unused parameter `x'
/lib/modules/2.4.22-1.2199.nptl/build/include/linux/prefetch.h: In function `prefetchw':
/lib/modules/2.4.22-1.2199.nptl/build/include/linux/prefetch.h:48: warning: unused parameter `x'
/lib/modules/2.4.22-1.2199.nptl/build/include/linux/wait.h: In function `__remove_wait_queue':
/lib/modules/2.4.22-1.2199.nptl/build/include/linux/wait.h:227: warning: unused parameter `head'
/lib/modules/2.4.22-1.2199.nptl/build/include/linux/smp.h: In function `smp_send_reschedule':
/lib/modules/2.4.22-1.2199.nptl/build/include/linux/smp.h:113: warning: unused parameter `cpu'
/lib/modules/2.4.22-1.2199.nptl/build/include/linux/sched.h: In function `task_cpu':
/lib/modules/2.4.22-1.2199.nptl/build/include/linux/sched.h:640: warning: unused parameter `p'
/lib/modules/2.4.22-1.2199.nptl/build/include/linux/sched.h: In function `set_task_cpu':
/lib/modules/2.4.22-1.2199.nptl/build/include/linux/sched.h:645: warning: unused parameter `p'
/lib/modules/2.4.22-1.2199.nptl/build/include/linux/sched.h:645: warning: unused parameter `cpu'
/lib/modules/2.4.22-1.2199.nptl/build/include/linux/sched.h: In function `task_unlock':
/lib/modules/2.4.22-1.2199.nptl/build/include/linux/sched.h:1097: warning: unused parameter `p'
/lib/modules/2.4.22-1.2199.nptl/build/include/asm/uaccess.h: In function `verify_area':
/lib/modules/2.4.22-1.2199.nptl/build/include/asm/uaccess.h:104: warning: unused parameter `type'
make: *** [syscall.o] Error 1
Please help me .
Thanks! |
|