File: sd_bus_set_watch_bind.3

package info (click to toggle)
manpages-de 2.12-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 71,404 kB
  • sloc: sh: 1,059; makefile: 71; python: 64; perl: 37; sed: 11
file content (89 lines) | stat: -rw-r--r-- 3,823 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
'\" t
.TH "SD_BUS_SET_WATCH_BIND" "3" "" "systemd 241" "sd_bus_set_watch_bind"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
sd_bus_set_watch_bind, sd_bus_get_watch_bind \- Control socket binding watching on bus connections
.SH "SYNOPSIS"
.sp
.ft B
.nf
#include <systemd/sd\-bus\&.h>
.fi
.ft
.HP \w'int\ sd_bus_set_watch_bind('u
.BI "int sd_bus_set_watch_bind(sd_bus\ *" "bus" ", int\ " "b" ");"
.HP \w'int\ sd_bus_get_watch_bind('u
.BI "int sd_bus_get_watch_bind(sd_bus\ *" "bus" ");"
.SH "DESCRIPTION"
.PP
\fBsd_bus_set_watch_bind()\fR
may be used to enable or disable client\-side watching of server socket binding for a bus connection object\&. If the
\fIb\fR
is true, the feature is enabled, otherwise disabled (which is the default)\&. When enabled, and the selected bus address refers to an
AF_UNIX
socket in the file system which does not exist while the connection attempt is made an
\fBinotify\fR(7)
watch is installed on it, waiting for the socket to appear\&. As soon as the socket appears the connection is made\&. This functionality is useful in particular in early\-boot programs that need to run before the system bus is available, but want to connect to it the instant it may be connected to\&.
.PP
\fBsd_bus_get_watch_bind()\fR
may be used to query the current setting of this feature\&. It returns zero when the feature is disabled, and positive if enabled\&.
.PP
Note that no timeout is applied while it is waited for the socket to appear\&. This means that any synchronous remote operation (such as
\fBsd_bus_call\fR(3),
\fBsd_bus_add_match\fR(3)
or
\fBsd_bus_request_name\fR(3)), that is used on a connection with this feature enabled that is not established yet might block unbounded if the socket is never created\&. However, asynchronous remote operations (such as
\fBsd_bus_send\fR(3),
\fBsd_bus_add_match_async\fR(3)
or
\fBsd_bus_request_match_async\fR(3)) do not block in this case, and safely enqueue the requested operations to be dispatched the instant the connection is set up\&.
.PP
Use
\fBsd_bus_is_ready\fR(3)
to determine whether the connection is fully established, i\&.e\&. whether the peer socket has been bound, connected to and authenticated\&. Use
\fBsd_bus_set_connected_signal\fR(3)
to be notified when the connection is fully established\&.
.SH "RETURN VALUE"
.PP
On success, these functions return 0 or a positive integer\&. On failure, they return a negative errno\-style error code\&.
.SH "ERRORS"
.PP
Returned errors may indicate the following problems:
.PP
\fB\-ECHILD\fR
.RS 4
The bus connection has been created in a different process\&.
.RE
.SH "NOTES"
.PP
These APIs are implemented as a shared library, which can be compiled and linked to with the
\fBlibsystemd\fR\ \&\fBpkg-config\fR(1)
file\&.
.SH "SEE ALSO"
.PP
\fBsystemd\fR(1),
\fBsd-bus\fR(3),
\fBinotify\fR(7),
\fBsd_bus_call\fR(3),
\fBsd_bus_add_match\fR(3),
\fBsd_bus_request_name\fR(3),
\fBsd_bus_is_ready\fR(3),
\fBsd_bus_set_connected_signal\fR(3)