tk_ref_mbf
Get Message Buffer Status
See Also
ER ercd = tk_ref_mbf ( ID mbfid, T_RMBF *pk_rmbf ) ;
ID mbfid Message buffer ID
T_RMBF* pk_rmbf Address of packet for returning status information
ER ercd Error code
pk_rmbf detail:
VP exinf Extended information
ID wtsk Waiting task information
ID stsk Send task information
INT msgsz Size of the next message to be received (in bytes)
W frbufsz Free buffer size (in bytes)
INT maxmsz Maximum message size (in bytes)
(Other implementation-dependent parameters may be added beyond this point.)
E_OK Normal completion
E_ID Invalid ID number (mbfid is invalid or cannot be used)
E_NOEXS Object does not exist (the message buffer specified in mbfid does not exist)
E_PAR Parameter error (the address of the return parameter packet cannot be used)
References the status of the message buffer specified in mbfid, passing in the return parameters sending task information (stsk), the size of the next message to be received (msgsz), free buffer size (frbufsz), maximum message size (maxmsz), waiting task information (wtsk), and extended information (exinf).
wtsk indicates the ID of the first task waiting to receive a message from the message buffer. The ID of the first task waiting to send to the message buffer is indicated in stsk. If multiple tasks are waiting in the message buffer queues, the ID of the task at the head of the queue is returned. If no tasks are waiting, 0 is returned.
If the specified message buffer does not exist, error code E_NOEXS is returned.
The size of the message at the head of the queue (the next message to be received) is returned in msgsz.
If there are no queued messages, msgsz = 0 is returned. A message of size 0 cannot be sent. At least one of msgsz = 0 and wtsk = 0 is always true for this system call. frbufsz indicates the free space in the ring buffer of the message queue. This value indicates the approximate size of messages than can be sent. maxmsz returns the maximum message size as specified with tk_cre_mbf.
frbufsz, the member of T_RMBF, is of W type instead of INT type.

Comments
Click here to Post a Comment