]>
Commit | Line | Data |
---|---|---|
60f067b4 | 1 | '\" t |
f47781d8 | 2 | .TH "SD_BUS_MESSAGE_GET_COOKIE" "3" "" "systemd 218" "sd_bus_message_get_cookie" |
60f067b4 JS |
3 | .\" ----------------------------------------------------------------- |
4 | .\" * Define some portability stuff | |
5 | .\" ----------------------------------------------------------------- | |
6 | .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
7 | .\" http://bugs.debian.org/507673 | |
8 | .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html | |
9 | .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
10 | .ie \n(.g .ds Aq \(aq | |
11 | .el .ds Aq ' | |
12 | .\" ----------------------------------------------------------------- | |
13 | .\" * set default formatting | |
14 | .\" ----------------------------------------------------------------- | |
15 | .\" disable hyphenation | |
16 | .nh | |
17 | .\" disable justification (adjust text to left margin only) | |
18 | .ad l | |
19 | .\" ----------------------------------------------------------------- | |
20 | .\" * MAIN CONTENT STARTS HERE * | |
21 | .\" ----------------------------------------------------------------- | |
22 | .SH "NAME" | |
23 | sd_bus_message_get_cookie, sd_bus_message_get_reply_cookie \- Returns the transaction cookie of a message | |
24 | .SH "SYNOPSIS" | |
25 | .sp | |
26 | .ft B | |
27 | .nf | |
28 | #include <systemd/sd\-bus\&.h> | |
29 | .fi | |
30 | .ft | |
31 | .HP \w'int\ sd_bus_message_get_cookie('u | |
32 | .BI "int sd_bus_message_get_cookie(sd_bus_message\ *" "message" ", uint64_t\ *" "cookie" ");" | |
33 | .HP \w'int\ sd_bus_message_get_reply_cookie('u | |
34 | .BI "int sd_bus_message_get_reply_cookie(sd_bus_message\ *" "message" ", uint64_t\ *" "cookie" ");" | |
35 | .SH "DESCRIPTION" | |
36 | .PP | |
37 | \fBsd_bus_message_get_cookie()\fR | |
38 | returns the transaction cookie of a message\&. The cookie uniquely identifies a message within each bus peer, but is not globally unique\&. It is assigned when a message is sent\&. | |
39 | .PP | |
40 | \fBsd_bus_message_get_reply_cookie()\fR | |
41 | returns the transaction cookie of the message the specified message is a response to\&. When a reply message is generated for a method call message, its cookie is copied over into this field\&. Note that while every message that is transferred is identified by a cookie, only response messages carry a reply cookie field\&. | |
42 | .PP | |
43 | Both functions take a message object as first parameter and a place to store the 64\-bit cookie in\&. | |
44 | .SH "RETURN VALUE" | |
45 | .PP | |
46 | On success, these calls return 0 or a positive integer\&. On failure, these calls return a negative errno\-style error code\&. | |
47 | .PP | |
48 | On success, the cookie/reply cookie is returned in the specified 64\-bit unsigned integer variable\&. | |
49 | .SH "ERRORS" | |
50 | .PP | |
51 | Returned errors may indicate the following problems: | |
52 | .PP | |
5eef597e | 53 | \fB\-EINVAL\fR |
60f067b4 JS |
54 | .RS 4 |
55 | A specified parameter is invalid\&. | |
56 | .RE | |
57 | .PP | |
5eef597e | 58 | \fB\-ENODATA\fR |
60f067b4 JS |
59 | .RS 4 |
60 | No cookie has been assigned to this message\&. This either indicates that the message has not been sent yet and hence has no cookie assigned, or that the message is not a method response message and hence carries a reply cookie field\&. | |
61 | .RE | |
62 | .SH "NOTES" | |
63 | .PP | |
64 | The | |
65 | \fBsd_bus_message_get_cookie()\fR | |
66 | and | |
67 | \fBsd_bus_message_get_reply_cookie()\fR | |
68 | interfaces are available as a shared library, which can be compiled and linked to with the | |
69 | \fBlibsystemd\fR\ \&\fBpkg-config\fR(1) | |
70 | file\&. | |
71 | .SH "SEE ALSO" | |
72 | .PP | |
73 | \fBsystemd\fR(1), | |
74 | \fBsd-bus\fR(3), | |
75 | \fBsd_bus_new\fR(3) |