Debian Codegraph @

upstream/debian-unstable/man3/sd_varlink_send.3

raw
1 '\" t
2 .TH "SD_VARLINK_SEND" "3" "" "systemd 261~rc3" "sd_varlink_send"
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_varlink_send, sd_varlink_sendb, sd_varlink_sendbo \- Enqueues a Varlink method call, not expecting a reply
24 .SH "SYNOPSIS"
25 .sp
26 .ft B
27 .nf
28 #include <systemd/sd\-varlink\&.h>
29 .fi
30 .ft
31 .HP \w'int\ sd_varlink_send('u
32 .BI "int sd_varlink_send(sd_varlink\ *" "link" ", const\ char\ *" "method" ", sd_json_variant\ *" "parameters" ");"
33 .HP \w'int\ sd_varlink_sendb('u
34 .BI "int sd_varlink_sendb(sd_varlink\ *" "link" ", const\ char\ *" "method" ", \&...);"
35 .HP \w'int\ sd_varlink_sendbo('u
36 .BI "int sd_varlink_sendbo(sd_varlink\ *" "link" ", const\ char\ *" "method" ", \&...);"
37 .SH "DESCRIPTION"
38 .PP
39 \fBsd_varlink_send()\fR
40 submits a method call via a Varlink connection\&. It takes the Varlink connection object, a method name as string parameter, and a JSON object containing the parameters to pass as function parameters\&. This call is asynchronous: the message will not be delivered immediately but only once
41 \fBsd_varlink_process\fR(3)
42 is invoked (which will happen automatically in one of the following event loop iterations if the Varlink connection is attached to an even loop)\&.
43 .PP
44 \fBsd_varlink_sendb()\fR
45 is similar to
46 \fBsd_varlink_send()\fR, but instead of expecting a fully constructed
47 \fBsd_json_variant\fR
48 object carrying the parameters, this object is constructed on\-the\-fly directly from the parameter list, in a style identical to
49 \fBsd_json_build\fR(3)\&.
50 .PP
51 \fBsd_varlink_sendbo()\fR
52 is identical to
53 \fBsd_varlink_sendb()\fR, but an enclosing object is implicitly added, so that the parameter list is expected to consist of field pairs only\&. For details about the expected argument list, see
54 \fBsd_json_buildo\fR(3)\&.
55 .PP
56 Use
57 \fBsd_varlink_send()\fR,
58 \fBsd_varlink_sendb()\fR
59 and
60 \fBsd_varlink_sendbo()\fR
61 only if no method call results are required, as they neither provide return parameters nor success/failure information\&. Use
62 \fBsd_varlink_call\fR(3)
63 (and related calls) to submit a method call synchronously, returning the server\*(Aqs response\&.
64 .SH "RETURN VALUE"
65 .PP
66 On success,
67 \fBsd_varlink_send()\fR,
68 \fBsd_varlink_sendb()\fR
69 and
70 \fBsd_varlink_sendbo()\fR
71 return a non\-negative integer\&. On failure, they return a negative errno\-style error code\&.
72 .SS "Errors"
73 .PP
74 Returned errors may indicate the following problems:
75 .PP
76 \fB\-EINVAL\fR
77 .RS 4
78 An argument is invalid\&.
79 .RE
80 .PP
81 \fB\-ENOMEM\fR
82 .RS 4
83 Memory allocation failed\&.
84 .RE
85 .PP
86 \fB\-ENOTCONN\fR
87 .RS 4
88 The Varlink connection object is not connected\&.
89 .RE
90 .PP
91 \fB\-EBUSY\fR
92 .RS 4
93 The Varlink connection object is already used for other purposes, i\&.e\&. executing a method call or similar\&.
94 .RE
95 .PP
96 \fB\-ENOBUFS\fR
97 .RS 4
98 The internal limit of queued messages for the Varlink connection has been reached\&. This limit is set very high, and hitting it typically indicates that the Varlink connection object is stalled \(em possibly because
99 \fBsd_varlink_process()\fR
100 has not been called regularly enough, or because the peer is not processing any queued messages\&. This limit is a safety precaution to ensure a stalled peer will not result in unbounded memory allocations on the client side\&.
101 .RE
102 .SH "NOTES"
103 .PP
104 Functions described here are available as a shared library, which can be compiled against and linked to with the
105 \fBlibsystemd\fR\ \&\fBpkg-config\fR(1)
106 file\&.
107 .PP
108 The code described here uses
109 \fBgetenv\fR(3), which is declared to be not multi\-thread\-safe\&. This means that the code calling the functions described here must not call
110 \fBsetenv\fR(3)
111 from a parallel thread\&. It is recommended to only do calls to
112 \fBsetenv()\fR
113 from an early phase of the program when no other threads have been started\&.
114 .SH "HISTORY"
115 .PP
116 \fBsd_varlink_send()\fR,
117 \fBsd_varlink_sendb()\fR,
118 \fBsd_varlink_sendbo()\fR
119 were added in version 257\&.
120 .SH "SEE ALSO"
121 .PP
122 \fBsystemd\fR(1), \fBsd-varlink\fR(3), \fBsd_varlink_call\fR(3), \fBsd_varlink_build\fR(3)