1ZMQ_MSG_INIT_BUFFER(3) 0MQ Manual ZMQ_MSG_INIT_BUFFER(3)
2
3
4
6 zmq_msg_init_buffer - initialise 0MQ message with buffer copy
7
9 int zmq_msg_init_buffer (zmq_msg_t *msg, const void *buf, size_t size);
10
12 The zmq_msg_init_buffer() function shall allocate any resources
13 required to store a message size bytes long and initialise the message
14 object referenced by msg to represent a copy of the buffer referenced
15 by the buf and size arguments.
16
17 The implementation shall choose whether to store message content on the
18 stack (small messages) or on the heap (large messages).
19
20 Caution
21 Never access zmq_msg_t members directly, instead always use the
22 zmq_msg family of functions.
23
24 Caution
25 The functions zmq_msg_init(), zmq_msg_init_data(),
26 zmq_msg_init_buffer() and zmq_msg_init_buffer() are mutually
27 exclusive. Never initialise the same zmq_msg_t twice.
28
30 The zmq_msg_init_buffer() function shall return zero if successful.
31 Otherwise it shall return -1 and set errno to one of the values defined
32 below.
33
35 ENOMEM
36 Insufficient storage space is available.
37
39 zmq_msg_init_data(3) zmq_msg_init_size(3) zmq_msg_init(3)
40 zmq_msg_close(3) zmq_msg_data(3) zmq_msg_size(3) zmq(7)
41
43 This page was written by the 0MQ community. To make a change please
44 read the 0MQ Contribution Policy at
45 http://www.zeromq.org/docs:contributing.
46
47
48
490MQ 4.3.4 01/21/2023 ZMQ_MSG_INIT_BUFFER(3)