135 lines
3.7 KiB
HTML
135 lines
3.7 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of SD_BUS_CLOSE</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>SD_BUS_CLOSE</H1>
|
|
Section: sd_bus_close (3)<BR>Updated: <BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
sd_bus_close, sd_bus_flush - Close and flush a bus connection
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
<P>
|
|
<B>
|
|
</B><PRE>
|
|
#include <<A HREF="file:///usr/include/systemd/sd-bus.h">systemd/sd-bus.h</A>>
|
|
</PRE>
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="1">
|
|
<B>void sd_bus_close(sd_bus *</B><I>bus</I><B>);</B>
|
|
|
|
<DT id="2">
|
|
<B>int sd_bus_flush(sd_bus *</B><I>bus</I><B>);</B>
|
|
|
|
</DL>
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
<P>
|
|
|
|
<B>sd_bus_close()</B>
|
|
<DD>disconnects the specified bus connection. When this call is invoked and the specified bus object refers to an active connection it is immediately terminated. No further messages may be sent or received on it. Any messages queued in the bus object (both incoming and outgoing) are released. If invoked on
|
|
<B>NULL</B>
|
|
bus object or when the bus connection is already closed this function executes no operation. This call does not free or unreference the bus object itself. Use
|
|
<B><A HREF="/cgi-bin/man/man2html?3+sd_bus_unref">sd_bus_unref</A></B>(3)
|
|
for that.
|
|
<P>
|
|
|
|
<B>sd_bus_flush()</B>
|
|
synchronously writes out all outgoing queued message on a bus connection if there are any. This function call may block if the peer is not processing bus messages quickly.
|
|
<P>
|
|
|
|
Before a program exits it is usually a good idea to flush any pending messages with
|
|
<B>sd_bus_flush()</B>
|
|
and then close connections with
|
|
<B>sd_bus_close()</B>
|
|
to ensure that no unwritten messages are lost, no further messages may be queued and all incoming but unprocessed messages are released. After both operations have been done, it is a good idea to also drop any remaining references to the bus object so that it may be freed. Since these three operations are frequently done together a helper call
|
|
<B><A HREF="/cgi-bin/man/man2html?3+sd_bus_flush_close_unref">sd_bus_flush_close_unref</A></B>(3)
|
|
is provided that combines them into one.
|
|
<A NAME="lbAE"> </A>
|
|
<H2>RETURN VALUE</H2>
|
|
|
|
<P>
|
|
|
|
On success,
|
|
<B>sd_bus_flush()</B>
|
|
returns 0 or a positive integer. On failure, it returns a negative errno-style error code.
|
|
<A NAME="lbAF"> </A>
|
|
<H3>Errors</H3>
|
|
|
|
<P>
|
|
|
|
Returned errors may indicate the following problems:
|
|
<P>
|
|
|
|
<B>-ECHILD</B>
|
|
<DL COMPACT><DT id="3"><DD>
|
|
The bus connection has been created in a different process.
|
|
</DL>
|
|
|
|
<A NAME="lbAG"> </A>
|
|
<H2>NOTES</H2>
|
|
|
|
<P>
|
|
|
|
These APIs are implemented as a shared library, which can be compiled and linked to with the
|
|
<B>libsystemd</B> <B><A HREF="/cgi-bin/man/man2html?1+pkg-config">pkg-config</A></B>(1)
|
|
file.
|
|
<A NAME="lbAH"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
<P>
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?1+systemd">systemd</A></B>(1),
|
|
<B><A HREF="/cgi-bin/man/man2html?3+sd-bus">sd-bus</A></B>(3),
|
|
<B><A HREF="/cgi-bin/man/man2html?3+sd_bus_unref">sd_bus_unref</A></B>(3),
|
|
<B><A HREF="/cgi-bin/man/man2html?3+sd_bus_set_close_on_exit">sd_bus_set_close_on_exit</A></B>(3)
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="4"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="5"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="6"><A HREF="#lbAD">DESCRIPTION</A><DD>
|
|
<DT id="7"><A HREF="#lbAE">RETURN VALUE</A><DD>
|
|
<DL>
|
|
<DT id="8"><A HREF="#lbAF">Errors</A><DD>
|
|
</DL>
|
|
<DT id="9"><A HREF="#lbAG">NOTES</A><DD>
|
|
<DT id="10"><A HREF="#lbAH">SEE ALSO</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:05:54 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|