Debian Codegraph @

upstream/debian-unstable/man3/sd_varlink_set_description.3

raw
1 '\" t
2 .TH "SD_VARLINK_SET_DESCRIPTION" "3" "" "systemd 261~rc3" "sd_varlink_set_description"
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_set_description, sd_varlink_get_description \- Set or query description of a Varlink connection object
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_set_description('u
32 .BI "int sd_varlink_set_description(sd_varlink\ *" "link" ", const\ char\ *" "description" ");"
33 .HP \w'const\ char*\ sd_varlink_get_description('u
34 .BI "const char* sd_varlink_get_description(sd_varlink\ *" "link" ");"
35 .SH "DESCRIPTION"
36 .PP
37 \fBsd_varlink_set_description()\fR
38 sets the description string that is used in logging to the specified string\&. The string is copied internally and freed when the Varlink connection object is deallocated\&. The
39 \fIdescription\fR
40 argument may be
41 \fBNULL\fR, in which case the description is unset\&.
42 .PP
43 \fBsd_varlink_get_description()\fR
44 returns a description string for the specified Varlink connection\&. This string may have been previously set with
45 \fBsd_varlink_set_description()\fR\&. If not set this way, a default string or
46 \fBNULL\fR
47 may be returned, depending how the connection was allocated and set up\&.
48 .SH "RETURN VALUE"
49 .PP
50 On success,
51 \fBsd_varlink_set_description()\fR
52 returns a non\-negative integer\&. On failure, it returns a negative errno\-style error code\&.
53 \fBsd_varlink_get_description()\fR
54 returns either
55 \fBNULL\fR
56 or a pointer to the description string\&.
57 .SS "Errors"
58 .PP
59 Returned errors may indicate the following problems:
60 .PP
61 \fB\-EINVAL\fR
62 .RS 4
63 An argument is invalid\&.
64 .RE
65 .PP
66 \fB\-ENOMEM\fR
67 .RS 4
68 Memory allocation failed\&.
69 .RE
70 .SH "NOTES"
71 .PP
72 Functions described here are available as a shared library, which can be compiled against and linked to with the
73 \fBlibsystemd\fR\ \&\fBpkg-config\fR(1)
74 file\&.
75 .PP
76 The code described here uses
77 \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
78 \fBsetenv\fR(3)
79 from a parallel thread\&. It is recommended to only do calls to
80 \fBsetenv()\fR
81 from an early phase of the program when no other threads have been started\&.
82 .SH "HISTORY"
83 .PP
84 \fBsd_varlink_set_description()\fR
85 was added in version 257\&.
86 .PP
87 \fBsd_varlink_get_description()\fR
88 was added in version 258\&.
89 .SH "SEE ALSO"
90 .PP
91 \fBsystemd\fR(1), \fBsd-varlink\fR(3)