return type of mqueue functions are wrong

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

I think I've found a little error in the manpages of the mqueue functions 
(mq_close, mq_getattr, mq_setattr, mq_unlink, mq_notify, mq_send and 
mq_timedsend). In the linux manpages, all these functions are documented as 
returning an mqd_t whereas in the mqueue.h shipped with the glibc, these 
functions are returning an int.

This is not a big matter in Linux where mqd_t is a typedef for int, but the 
problem is that a programmer worried about the portability of his code might 
be tempted to write things like

  if( mq_getattr( _mqdes, &aMqAttr ) == (mqd_t)-1 )
    ...

And this is not portable. (For example, it won't compile on Solaris where 
mqd_t is a typedef for void * but where mq_getattr returns an int like on 
Linux.)

If the functions were documented as returning an int, one won't put the cast, 
and the code would be portable.

Kind regards,
Lénaïc.
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux