void *ubuf = xallocubuf (12); memcpy (ubuf, "Hello world!", 12); xsend (s, ubuf);
xallocubuf - allocate a message
#include <xio/socket.h>
void *xallocubuf (size_t size);
Allocate a message of the specified size to be sent in zero-copy fashion. The content of the message is undefined after allocation and it should be filled in by the user.
On success, xmsg pointer is returned. On error, 0 is returned, and errno is set appropriately.
Supplied allocation size is invalid.
Not enough memory to allocate the message.
void *ubuf = xallocubuf (12); memcpy (ubuf, "Hello world!", 12); xsend (s, ubuf);
Dong Fang <yp.fangdong@gmail.com> Martin Sustrik <sustrik@250bpm.com>