Re: sys_sem* undefined

From: Paulo Marques
Date: Thu Aug 26 2004 - 09:20:45 EST


Arne Henrichsen wrote:
Hi Randy,

thanks for the help. I am very new to Linux
programming, and I do not understand what you mean
with 'syscalls are not called by name'.

I did find the header file syscalls.h, recompiled my
code but it still says the following:

*** Warning: "sys_semop"
[/prj/builds/host/linux/prj.ko] undefined!
*** Warning: "sys_semctl"
[/prj/builds/host/linux/prj.ko] undefined!
*** Warning: "sys_semget"
[/prj/builds/host/linux/prj.ko] undefined!

And when I load the module, then it tells me:

insmod: error inserting './prj.ko': -1 Unknown symbol
in module

So, I call sys_sem* functions from my code. What else
must I do?

Syscalls are supposed to be called from userspace, so that the kernel does something on behalf of an application.

Some syscalls have their do_<syscall name> equivalent because it makes sense to call them from inside the kernel, but others don't.

If you want to use semaphores inside the kernel I suggest you read the Rusty Rusell's Unreliable Guide to Kernel Locking first:

http://wwwos.inf.tu-dresden.de/~ch12/diplom/DocBook/kernel-locking/

I hope this helps,

--
Paulo Marques - www.grupopie.com
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/