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       These APIs are implemented as a shared library, which can be compiled
54       and linked to with the libsystemd pkg-config(1) file.
55

SEE ALSO

57       systemd(1), sd-bus(3), sd_bus_new(3)
58
59
60
61systemd 243                                       SD_BUS_MESSAGE_GET_COOKIE(3)
Impressum