Re: Message queues (IPC)
Jens.Toerring_at_physik.fu-berlin.de
Date: 08/18/04
- Next message: Adam: "Libraries for only a single program"
- Previous message: silverdr: "Re: insmod: unresolved symbols"
- In reply to: Arne: "Message queues (IPC)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 17 Aug 2004 23:40:25 GMT
Arne <ahenric@ccii.co.za> wrote:
> I am very new to Linux programming. My task is to port a vxWorks
> driver to Linux, hence some questions regarding message queues:
> 1: The sys_msgget() function, to create a new message queue, one has
> to use IPC_PRIVATE for the key value. Will this particular message
> queue then always sit at key 0? Or will it be assigned to another key
> value, and if so, how does one get it?
Since you're writing that you want to port a driver I don't know
how message queues get into that. sys_msgget() seems (as far as I
can see) some function internal to the kernel for dealing SysV
IPC and I can't see how this would get involved in a driver. And
what do you mean by "always sit at key 0"? IPC_PRIVATE could be 0
(that's what it's defined as in the kernel header files I have here)
but I don't think you should rely on that. If you want a key that
can be used by unrelated programs the ftok() function with an
existing file as the first argument is typically used to create
a common key.
> 2: Is there something similar to a timeout value for the sys_msgrcv()
> function? A way to wait for a specific number of ticks before
> returning?
If you mean the msgrcv() (userland) function there's no way to
give it a timeout value, you can only tell it not to wait for a
message but to return immediately if there's none using the
IPC_NOWAIT flag.
> 3: Where is the System V IPC described in detail? There doesn't seem
> to be much on the web.
If you don't mean something on the web I would go for W. Richard Stevens
"UNIX Network Programming", Vol. 2.
Regards, Jens
-- \ Jens Thoms Toerring ___ Jens.Toerring@physik.fu-berlin.de \__________________________ http://www.toerring.de
- Next message: Adam: "Libraries for only a single program"
- Previous message: silverdr: "Re: insmod: unresolved symbols"
- In reply to: Arne: "Message queues (IPC)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|