nn_allocmsg man page on DragonFly

Man page or keyword search:  
man Server   44335 pages
apropos Keyword Search (all sections)
Output format
DragonFly logo
[printable version]

NN_ALLOCMSG(3)			nanomsg manual			NN_ALLOCMSG(3)

NAME
       nn_allocmsg - allocate a message

SYNOPSIS
       #include <nanomsg/nn.h>

       void *nn_allocmsg (size_t size, int type);

DESCRIPTION
       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. While nn_send(3) and nn_sendmsg(3)
       allow to send arbitrary buffers, buffers allocated using nn_allocmsg()
       can be more efficient for large messages as they allow for using
       zero-copy techniques.

       type parameter specifies type of allocation mechanism to use. Zero is
       the default one, however, individual transport mechanisms may define
       their own allocation mechanisms, such as allocating in shared memory or
       allocating a memory block pinned down to a physical memory address.
       Such allocation, when used with the transport that defines them, should
       be more efficient than the default allocation mechanism.

RETURN VALUE
       If the function succeeds pointer to newly allocated buffer is returned.
       Otherwise, NULL is returned and errno is set to to one of the values
       defined below.

ERRORS
       EINVAL
	   Supplied allocation type is invalid.

       ENOMEM
	   Not enough memory to allocate the message.

EXAMPLE
	   void *buf = nn_allocmsg (12, 0);
	   memcpy (buf, "Hello world!", 12);
	   nn_send (s, &buf, NN_MSG, 0);

SEE ALSO
       nn_freemsg(3) nn_reallocmsg(3) nn_send(3) nn_sendmsg(3) nanomsg(7)

AUTHORS
       Martin Sustrik <sustrik@250bpm.com[1]>

NOTES
	1. sustrik@250bpm.com
	   mailto:sustrik@250bpm.com

nanomsg Unknown			  12/23/2015			NN_ALLOCMSG(3)
[top]

List of man pages available for DragonFly

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net