[lkml]   [1999]   [May]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: sendmsg() arguments
On Mon, 17 May 1999 wrote:

> > The only problem I have with that, is that msg_name=NULL was used in
> > some my program to indicate that there is no name,
> Let's continue the analogy. Do you find useful to supply
> NULL buffer to write() and some not-zero length?

write() deals with data without assigning any meaning to its type and
structure -- the argument is void, and size does not specify anything but
the amount of data involved (and 0 is the special case). In the case of
message the pointer has specific meaning of address, and size is
secondary, derived from its type. If I know that the address is of
specific type, and it is NULL, it probably will make sense to put sizeof
if that type as the size.

> I do not. And I see no differences between data buffer,
> address buffer and ancillary data buffer

Address may have size even if it's NULL.

> and no reasons
> to introduce code lines considering unnatural special cases.
> > > BTW some time ago recvfrom() behaved in the same manner,
> > > but broken way appeared to be described as valid in UNIX98,
> > > so that it was changed.
> >
> > Maybe for consistency sake, sendmsg() can be made to match this?
> Maybe, yes. Though, to be honest, it is rather recvfrom()/sendto()
> should be fixed to be self-consistent 8)
> BTW for beginning fix your program. 8)

It's already fixed, I just don't think that there are no others that
behave the same way.


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:51    [from the cache]
©2003-2014 Jasper Spaans. hosted at Digital Ocean