1SD_BUS_MESSAGE_APPEND_SsTdR_IbNuGs__MmEeMsFsDa(g3e)_appenSdD__sBtUrSi_nMgE_SmSeAmGfEd_APPEND_STRING_MEMFD(3)
2
3
4

NAME

6       sd_bus_message_append_string_memfd, sd_bus_message_append_string_iovec,
7       sd_bus_message_append_string_space - Attach a string to a message
8

SYNOPSIS

10       #include <systemd/sd-bus.h>
11
12       int sd_bus_message_append_string_memfd(sd_bus_message *m, int memfd);
13
14       int sd_bus_message_append_string_iovec(sd_bus_message *m,
15                                              const struct iovec *iov,
16                                              unsigned n);
17
18       int sd_bus_message_append_string_space(sd_bus_message *m, size_t size,
19                                              char **s);
20

DESCRIPTION

22       The functions sd_bus_message_append_string_memfd() and
23       sd_bus_message_append_string_iovec() can be used to append a single
24       string (item of type "s") to message m.
25
26       In case of sd_bus_message_append_string_memfd(), the contents of memfd
27       are the string. They must satisfy the same constraints as described for
28       the "s" type in sd_bus_message_append_basic(3).
29
30       In case of sd_bus_message_append_string_iovec(), the payload of iov is
31       the string. It must satisfy the same constraints as described for the
32       "s" type in sd_bus_message_append_basic(3).
33
34       The iov argument must point to n struct iovec structures. Each
35       structure may have the iov_base field set, in which case the memory
36       pointed to will be copied into the message, or unset, in which case a
37       block of spaces (ASCII 32) of length iov_len will be inserted. The
38       memory pointed at by iov may be changed after this call.
39
40       The sd_bus_message_append_string_space() function appends space for a
41       string to message m. It behaves similar to
42       sd_bus_message_append_basic() with type "s", but instead of copying a
43       string into the message, it returns a pointer to the destination area
44       to the caller in pointer p. Space for the string of length size plus
45       the terminating NUL is allocated.
46

RETURN VALUE

48       On success, those calls return 0 or a positive integer. On failure,
49       they return a negative errno-style error code.
50
51   Errors
52       Returned errors may indicate the following problems:
53
54       -EINVAL
55           Specified parameter is invalid.
56
57       -EPERM
58           Message has been sealed.
59
60       -ESTALE
61           Message is in invalid state.
62
63       -ENXIO
64           Message cannot be appended to.
65
66       -ENOMEM
67           Memory allocation failed.
68

NOTES

70       Functions described here are available as a shared library, which can
71       be compiled against and linked to with the libsystemd pkg-config(1)
72       file.
73
74       The code described here uses getenv(3), which is declared to be not
75       multi-thread-safe. This means that the code calling the functions
76       described here must not call setenv(3) from a parallel thread. It is
77       recommended to only do calls to setenv() from an early phase of the
78       program when no other threads have been started.
79

SEE ALSO

81       systemd(1), sd-bus(3), sd_bus_message_append_basic(3), The D-Bus
82       specification[1]
83

NOTES

85        1. The D-Bus specification
86           https://dbus.freedesktop.org/doc/dbus-specification.html
87
88
89
90systemd 254                              SD_BUS_MESSAGE_APPEND_STRING_MEMFD(3)
Impressum