[Overview][Constants][Types][Procedures and functions] Reference for unit 'ipc' (#rtl)

msgrcv

Retrieve a message from the queue

Declaration

Source position: ipc.pp line 277

function msgrcv(

  msqid: cint;

  msgp: PMSGbuf;

  msgsz: size_t;

  msgtyp: cint;

  msgflg: cint

):cint;

Description

msgrcvretrieves a message of type msgtypfrom the message queue with ID msqid. msgtypcorresponds to the mtypefield of the TMSGbufrecord. The message is stored in the MSGbufstructure pointed to by msgp.

The msgflgparameter can be used to control the behaviour of the msgrcvcall. It consists of an ORed combination of the following flags:

0
No special meaning.
IPC_NOWAIT
if no messages are available, then the call returns immediatly, with the ENOMSGerror.
MSG_NOERROR
If the message size is wrong (too large), no error is generated, instead the message is truncated. Normally, in such cases, the call returns an error (E2BIG)

The function returns Trueif the message was received correctly, Falseotherwise.

For an example, see msgctl.

Errors

In case of error, Falseis returned, and IPCerroris set.

See also

msgget

  

Return message queue ID, possibly creating the queue

msgsnd

  

Send a message to the messague queue

msgctl

  

Perform various operations on a message queue