1 |
On Wednesday 07 February 2007 18:53, Iain Buchanan wrote: |
2 |
> Hi all, |
3 |
> |
4 |
> I'm trying to use: |
5 |
> |
6 |
> _syscall3(int, ioprio_set, int, which, int, who, int, ioprio); |
7 |
> _syscall2(int, ioprio_get, int, which, int, who); |
8 |
> |
9 |
> and supposedly I just |
10 |
> |
11 |
> #include <linux/unistd.h> |
12 |
> |
13 |
> but I'm getting these error from gcc: |
14 |
> |
15 |
> error: syntax error before "ioprio_set" |
16 |
> warning: data definition has no type or storage class |
17 |
> error: syntax error before "ioprio_get" |
18 |
> warning: data definition has no type or storage class |
19 |
> |
20 |
> so I had a look in /usr/include/linux/unistd.h and it doesn't even have |
21 |
> _syscall in there!! It's in /usr/src/linux though... |
22 |
|
23 |
That means that the kernel devs have decided that API is not userland safe. |
24 |
In recent kernels, there's a specific 'headers' (or somesuch) make target, |
25 |
that generates .h files that are appropriate to use in userland. |
26 |
|
27 |
If you need access to APIs that aren't in those headers, you should be |
28 |
writing |
29 |
a kernel module, or convincing the kernel developers to expose these APIs |
30 |
to |
31 |
userland. Your kernel module may need be only a tiny stub, just something |
32 |
to |
33 |
go between your userland and the non-userland-safe APIs. |
34 |
|
35 |
> Am I doing something wrong? |
36 |
|
37 |
It's possible you just need another header. It also possible that there's |
38 |
a |
39 |
different entry point now. I seem to remember the location of the syscall |
40 |
table is recently changed to something like randomized per-process at some |
41 |
point in the 2.6.1x line. That may have changed how you need to be calling |
42 |
things. |
43 |
|
44 |
-- |
45 |
Boyd Stephen Smith Jr. ,= ,-_-. =. |
46 |
bss03@××××××××××.net ((_/)o o(\_)) |
47 |
ICQ: 514984 YM/AIM: DaTwinkDaddy `-'(. .)`-' |
48 |
http://iguanasuicide.org/ \_/ |
49 |
New GPG Key! Old key expires 2007-03-25. Upgrade NOW! |