Re: Message queues (IPC)

Jens.Toerring_at_physik.fu-berlin.de
Date: 08/18/04


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


Relevant Pages

  • Re: What determine COM port number?
    ... have to do your work after the install happens, but your new port number ... Basic and Advanced Driver Programming Seminars ...
    (microsoft.public.development.device.drivers)
  • Re: Seagate Barracuda 160 GB IDE becomes corrupted. RMA?
    ... Operating System Microsoft Windows 2000 Professional ... System Memory 512 MB ... Communication Port Communications Port ... Driver Download http://www.viaarena.com/?PageID=2 ...
    (comp.sys.ibm.pc.hardware.storage)
  • soft lockup disease (2.6.14-rc1, x86_64)
    ... IA-32 Microcode Update Driver: v1 ... IO window: 1000-1fff] L ... ACPI: PM-Timer IO Port: 0x408 ACPI: Local APIC address 0xfee00000 ...
    (Linux-Kernel)
  • [PATCH]PCI Express Port Bus Driver
    ... A PCI Express Port is a logical PCI-PCI Bridge structure. ... physical device to be handled by only a single driver. ... service drivers will compete for a single PCI-PCI Bridge device. ...
    (Linux-Kernel)
  • Need pci=assign-busses for Acer Aspire 9410
    ... Using APIC driver default ... ACPI: Local APIC address 0xfee00000 ... SELinux: Initializing. ... cs: IO port probe 0x6000-0x6fff: clean. ...
    (Linux-Kernel)