1NN_REALLOCMSG(3) nanomsg 1.1.5 NN_REALLOCMSG(3)
2
3
4
6 nn_reallocmsg - reallocate a message
7
9 #include <nanomsg/nn.h>
10
11 void *nn_reallocmsg (void *msg, size_t size);
12
14 Reallocate a message previously allocated by nn_allocmsg(3) or received
15 from a peer using NN_MSG mechanism.
16
17 Note that as with the standard realloc, the operation may involve
18 copying the data in the buffer.
19
21 If the function succeeds pointer to newly allocated buffer is returned.
22 Otherwise, NULL is returned and errno is set to to one of the values
23 defined below.
24
26 ENOMEM
27 Not enough memory to allocate the message.
28
30 void *buf = nn_allocmsg (12, 0);
31 void *newbuf = nn_reallocmsg (buf, 20);
32 nn_freemsg (newbuf);
33
35 nn_allocmsg(3) nn_freemsg(3) nanomsg(7)
36
38 Martin Sustrik <sustrik@250bpm.com>
39
40
41
42 2022-01-20 NN_REALLOCMSG(3)