nn_reallocmsg.adoc 982 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. nn_reallocmsg(3)
  2. ================
  3. NAME
  4. ----
  5. nn_reallocmsg - reallocate a message
  6. SYNOPSIS
  7. --------
  8. *#include <nanomsg/nn.h>*
  9. *void *nn_reallocmsg (void *'msg', size_t 'size');*
  10. DESCRIPTION
  11. -----------
  12. Reallocate a message previously allocated by <<nn_allocmsg#,nn_allocmsg(3)>> or
  13. received from a peer using NN_MSG mechanism.
  14. Note that as with the standard _realloc_, the operation may involve copying
  15. the data in the buffer.
  16. RETURN VALUE
  17. ------------
  18. If the function succeeds pointer to newly allocated buffer is returned.
  19. Otherwise, NULL is returned and 'errno' is set to to one of the values
  20. defined below.
  21. ERRORS
  22. ------
  23. *ENOMEM*::
  24. Not enough memory to allocate the message.
  25. EXAMPLE
  26. -------
  27. ----
  28. void *buf = nn_allocmsg (12, 0);
  29. void *newbuf = nn_reallocmsg (buf, 20);
  30. nn_freemsg (newbuf);
  31. ----
  32. SEE ALSO
  33. --------
  34. <<nn_allocmsg#,nn_allocmsg(3)>>
  35. <<nn_freemsg#,nn_freemsg(3)>>
  36. <<nanomsg#,nanomsg(7)>>
  37. AUTHORS
  38. -------
  39. link:mailto:sustrik@250bpm.com[Martin Sustrik]