1SD_BUS_MESSAGE_GET_COOKIE(3)sd_bus_message_get_cookiSeD_BUS_MESSAGE_GET_COOKIE(3)
2
3
4

NAME

6       sd_bus_message_get_cookie, sd_bus_message_get_reply_cookie - Returns
7       the transaction cookie of a message
8

SYNOPSIS

10       #include <systemd/sd-bus.h>
11
12       int sd_bus_message_get_cookie(sd_bus_message *message,
13                                     uint64_t *cookie);
14
15       int sd_bus_message_get_reply_cookie(sd_bus_message *message,
16                                           uint64_t *cookie);
17

DESCRIPTION

19       sd_bus_message_get_cookie() returns the transaction cookie of a
20       message. The cookie uniquely identifies a message within each bus peer,
21       but is not globally unique. It is assigned when a message is sent.
22
23       sd_bus_message_get_reply_cookie() returns the transaction cookie of the
24       message the specified message is a response to. When a reply message is
25       generated for a method call message, its cookie is copied over into
26       this field. Note that while every message that is transferred is
27       identified by a cookie, only response messages carry a reply cookie
28       field.
29
30       Both functions take a message object as first parameter and a place to
31       store the 64-bit cookie in.
32

RETURN VALUE

34       On success, these calls return 0 or a positive integer. On failure,
35       they return a negative errno-style error code.
36
37       On success, the cookie/reply cookie is returned in the specified 64-bit
38       unsigned integer variable.
39
40   Errors
41       Returned errors may indicate the following problems:
42
43       -EINVAL
44           A specified parameter is invalid.
45
46       -ENODATA
47           No cookie has been assigned to this message. This either indicates
48           that the message has not been sent yet and hence has no cookie
49           assigned, or that the message is not a method response message and
50           hence carries a reply cookie field.
51

NOTES

53       Functions described here are available as a shared library, which can
54       be compiled against and linked to with the libsystemd pkg-config(1)
55       file.
56
57       The code described here uses getenv(3), which is declared to be not
58       multi-thread-safe. This means that the code calling the functions
59       described here must not call setenv(3) from a parallel thread. It is
60       recommended to only do calls to setenv() from an early phase of the
61       program when no other threads have been started.
62

SEE ALSO

64       systemd(1), sd-bus(3), sd_bus_new(3)
65
66
67
68systemd 254                                       SD_BUS_MESSAGE_GET_COOKIE(3)
Impressum