Skip to contentSkip to conversation

Adding a system call to kernel

DISCUSSION jensen galan 1 participant 1 message May 10, 2005

lore
Share & tools
lore
#0 lore raw

Thanks Geert.

You know, I knew I had to do include this, and spent all weekend trying to figure out where to include <errno.h>.

But, for some reason, after reading your reply, the simplicity dawned on me - include it in the user-space program dummy.

That's what you should have written ;)

Thanks again - it worked!

Jensen

Quoted 33 lines · --- Geert Uytterhoeven
Quoted 4 lines · jensen galan

I am trying to add a system call to a 2.4 kernel. It's a simple system call which merely prints the value of xtime. The kernel recompiles OK, and my user-space program (p5_a.c) actually works using

the

Quoted 3 lines

added system call when I use syscall() and do not generate a stub. (The 2 versions of my user-space programs are included below). However, when I try

to

Quoted 6 lines

generate a stub in my user-space program using _syscall2(), I receive the following compilation error:

# gcc -Wall -D__KERNEL__ -I
/lib/modules/2.4.28-gentoo-r5/build/include -o

p5_b

Quoted 5 lines

p5_b.c
/tmp/cc5nBrjZ.o(.text+0x23): In function 'pedagogictime':
: undefined reference to 'errno'
collect2: ld returned 1 exit status

Please include <errno.h>

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

Quoted 13 lines

In personal conversations with technical people, I
call myself a hacker. But
when I'm talking to journalists I just say
"programmer" or something like that.
-- Linus Torvalds
-
To unsubscribe from this list: send the line
"unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

__________________________________
Do you Yahoo!?
Yahoo! Mail - Helps protect you from nasty viruses.
http://promotions.yahoo.com/new_mail