[Home]Rt Mbx Receive()

Last edit: Peter Favrholdt on July 31, 2005 10:17 (4852 days, 15 hours and 8 minutes ago) (diff)
Rtai.Dk | RecentChanges | Preferences | DIAPM RTAI

From the mailinglist:

Olivier Testa wrote:
> 
> Hi,
> 
> I continue exploring the mbx-related functions. Today: rt_mbx_receive
> 
> In the file $RTAI/Documentation/doc_rtai/mbox.html (and in the
> documentation 'A hard real-time support for linux'), I can read,
> concerning rt_mbx_receive:

The html stuff might be the oldest and wrongest. What is in the pdf is
more up todate.

> "On succes, the number of received bytes is returned.
> On failure, a negative value is returned as described below: -EINVAL..."

This is what somebody wrote, and I did not check, in the hope of forcing
me to adhere to Unix read/write return value.

> But in $RTAI/Documentation/README.MBX,
> it is written:
> rt_mbx_receive "...Returns the number of unsent bytes."
> 
> It is probably a typo, but I assume I should read "unreceived" instead
> of "unsent". Yet, the two are not consistent.

You are right and the typo in README.MBX, as it could be inferred from
the explanation to the following receive until. It is fixed in the CVS.
 
> In case of a succes in receiving an int, does it return 0 (0 unreceived bytes), or sizeof(int) ?
> 
> I rt_printked from the example $RTAI/example/mbx, and it seems to return 0 in case of a succes

What shown by printk is OK, with send/receives in MBXes you have an
accomplished mission with a 0 return, i.e. meaning nothing was left
behind.

Paolo.

Edit text of this page | View other revisions | Download Rtai.dk
Search: