[systemd-commits] 12 commits - Makefile.am Makefile-man.am man/sd_bus_creds_get_pid.xml man/sd_bus_creds_new_from_pid.xml man/sd_bus_error.xml man/sd_bus_message_append_basic.xml man/sd_bus_message_get_cookie.xml man/sd_bus_message_get_monotonic_usec.xml man/sd_bus_negotiate_fds.xml man/sd_bus_new.xml man/sd_bus_open_user.xml man/sd_bus_request_name.xml man/sd_event_add_child.xml man/sd_event_add_defer.xml man/sd_event_add_signal.xml man/sd_event_add_time.xml man/sd_event_new.xml src/journal src/journal-remote
Zbigniew JÄdrzejewski-Szmek
zbyszek at kemper.freedesktop.org
Thu Sep 25 15:19:21 PDT 2014
Makefile-man.am | 31 ++++
Makefile.am | 9 -
man/sd_bus_creds_get_pid.xml | 10 -
man/sd_bus_creds_new_from_pid.xml | 6
man/sd_bus_error.xml | 4
man/sd_bus_message_append_basic.xml | 10 -
man/sd_bus_message_get_cookie.xml | 4
man/sd_bus_message_get_monotonic_usec.xml | 4
man/sd_bus_negotiate_fds.xml | 2
man/sd_bus_new.xml | 2
man/sd_bus_open_user.xml | 4
man/sd_bus_request_name.xml | 14 +-
man/sd_event_add_child.xml | 206 ++++++++++++++++++++++++++++++
man/sd_event_add_defer.xml | 191 +++++++++++++++++++++++++++
man/sd_event_add_signal.xml | 198 ++++++++++++++++++++++++++++
man/sd_event_add_time.xml | 36 +++--
man/sd_event_new.xml | 24 +--
src/journal-remote/journal-remote-parse.c | 6
src/journal-remote/journal-remote-write.c | 44 +++---
src/journal-remote/journal-remote.c | 8 -
src/journal/journal-file.h | 2
21 files changed, 731 insertions(+), 84 deletions(-)
New commits:
commit 2f88c8583aea6626c5f0a84cfc6de4b0a17f2d1c
Author: Gustavo Sverzut Barbieri <gustavo.barbieri at intel.com>
Date: Thu Sep 25 18:12:03 2014 -0300
do not install factory/etc/pam.d if --disable-pam
diff --git a/Makefile.am b/Makefile.am
index bf860cd..1bdc91c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -2048,9 +2048,11 @@ endif
dist_factory_etc_DATA = \
factory/etc/nsswitch.conf
+if HAVE_PAM
dist_factory_pam_DATA = \
factory/etc/pam.d/system-auth \
factory/etc/pam.d/other
+endif
# ------------------------------------------------------------------------------
if ENABLE_FIRSTBOOT
commit 0b094b10b4268383c836fa4f285e02ba25ed3ad0
Author: Zbigniew JÄdrzejewski-Szmek <zbyszek at in.waw.pl>
Date: Thu Sep 25 17:39:56 2014 -0400
build-sys: do not distribute make-man-rules.py
It was added to EXTRA_DIST in 3c3e5f4276a893791110b03984735654372aa33a,
but this script only makes sense for developers.
diff --git a/Makefile.am b/Makefile.am
index 065d688..bf860cd 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -720,7 +720,6 @@ EXTRA_DIST += \
$(man_MANS) \
tools/make-man-index.py \
tools/make-directive-index.py \
- tools/make-man-rules.py \
tools/xml_helper.py
# ------------------------------------------------------------------------------
commit ef99aec4d25087dec995b3f00b6957dcee6b13e9
Author: Gustavo Sverzut Barbieri <gustavo.barbieri at intel.com>
Date: Thu Sep 25 18:13:19 2014 -0300
only build and install systemd-bus-proxyd if --enable-kdbus
diff --git a/Makefile.am b/Makefile.am
index 5312851..065d688 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -387,7 +387,6 @@ rootlibexec_PROGRAMS = \
systemd-ac-power \
systemd-sysctl \
systemd-sleep \
- systemd-bus-proxyd \
systemd-socket-proxyd \
systemd-update-done
@@ -2428,6 +2427,10 @@ systemd_run_LDADD = \
libsystemd-shared.la
# ------------------------------------------------------------------------------
+if ENABLE_KDBUS
+rootlibexec_PROGRAMS += \
+ systemd-bus-proxyd
+
systemd_bus_proxyd_SOURCES = \
src/bus-proxyd/bus-proxyd.c \
src/bus-proxyd/bus-policy.c \
@@ -2449,7 +2452,6 @@ bus-proxyd-uninstall-hook:
INSTALL_EXEC_HOOKS += bus-proxyd-install-hook
UNINSTALL_EXEC_HOOKS += bus-proxyd-uninstall-hook
-if ENABLE_KDBUS
nodist_systemunit_DATA += \
units/systemd-bus-proxyd at .service
commit 8474b70c3a3842cdf3d51f331dd117ab6421f6d0
Author: Zbigniew JÄdrzejewski-Szmek <zbyszek at in.waw.pl>
Date: Thu Sep 25 17:27:46 2014 -0400
man: use <constant> markup for errno value
We were inconsistent, but marking them up as constants makes more
sense then as variables.
diff --git a/man/sd_bus_creds_get_pid.xml b/man/sd_bus_creds_get_pid.xml
index 40ed81e..6358762 100644
--- a/man/sd_bus_creds_get_pid.xml
+++ b/man/sd_bus_creds_get_pid.xml
@@ -381,7 +381,7 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
<variablelist>
<varlistentry>
- <term><varname>-ENODATA</varname></term>
+ <term><constant>-ENODATA</constant></term>
<listitem><para>Given field is not available in
<parameter>c</parameter>.</para>
@@ -389,7 +389,7 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
</varlistentry>
<varlistentry>
- <term><varname>-ENOENT</varname></term>
+ <term><constant>-ENOENT</constant></term>
<listitem><para>Given field is not specified for the sender.
This will be returned by <function>sd_bus_get_unit</function>,
@@ -403,7 +403,7 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
</varlistentry>
<varlistentry>
- <term><varname>-ENXIO</varname></term>
+ <term><constant>-ENXIO</constant></term>
<listitem><para>An error occurred in parsing cgroup paths.
<filename>libsystemd</filename> might be out of sync with
@@ -411,14 +411,14 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
</varlistentry>
<varlistentry>
- <term><varname>-EINVAL</varname></term>
+ <term><constant>-EINVAL</constant></term>
<listitem><para>Specified pointer parameter is <constant>NULL</constant>.
</para></listitem>
</varlistentry>
<varlistentry>
- <term><varname>-ENOMEM</varname></term>
+ <term><constant>-ENOMEM</constant></term>
<listitem><para>Memory allocation failed.</para></listitem>
</varlistentry>
diff --git a/man/sd_bus_creds_new_from_pid.xml b/man/sd_bus_creds_new_from_pid.xml
index bc94c44..f3ea1de 100644
--- a/man/sd_bus_creds_new_from_pid.xml
+++ b/man/sd_bus_creds_new_from_pid.xml
@@ -205,14 +205,14 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
<variablelist>
<varlistentry>
- <term><varname>-ESRCH</varname></term>
+ <term><constant>-ESRCH</constant></term>
<listitem><para>Specified <parameter>pid</parameter> could not
be found.</para></listitem>
</varlistentry>
<varlistentry>
- <term><varname>-EINVAL</varname></term>
+ <term><constant>-EINVAL</constant></term>
<listitem><para>Specified parameter is invalid
(<constant>NULL</constant> in case of output
@@ -220,7 +220,7 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
</varlistentry>
<varlistentry>
- <term><varname>-ENOMEM</varname></term>
+ <term><constant>-ENOMEM</constant></term>
<listitem><para>Memory allocation failed.</para></listitem>
</varlistentry>
diff --git a/man/sd_bus_error.xml b/man/sd_bus_error.xml
index 7144f4b..aba8083 100644
--- a/man/sd_bus_error.xml
+++ b/man/sd_bus_error.xml
@@ -376,7 +376,7 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
<variablelist>
<varlistentry>
- <term><varname>-EINVAL</varname></term>
+ <term><constant>-EINVAL</constant></term>
<listitem><para>Error was already set in
<structname>sd_bus_error</structname> structure when one the
@@ -384,7 +384,7 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
</varlistentry>
<varlistentry>
- <term><varname>-ENOMEM</varname></term>
+ <term><constant>-ENOMEM</constant></term>
<listitem><para>Memory allocation failed.</para></listitem>
</varlistentry>
diff --git a/man/sd_bus_message_append_basic.xml b/man/sd_bus_message_append_basic.xml
index 7c5f1e9..2594134 100644
--- a/man/sd_bus_message_append_basic.xml
+++ b/man/sd_bus_message_append_basic.xml
@@ -219,35 +219,35 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
<variablelist>
<varlistentry>
- <term><varname>-EINVAL</varname></term>
+ <term><constant>-EINVAL</constant></term>
<listitem><para>Specified parameter is invalid.
</para></listitem>
</varlistentry>
<varlistentry>
- <term><varname>-EPERM</varname></term>
+ <term><constant>-EPERM</constant></term>
<listitem><para>Message has been sealed.
</para></listitem>
</varlistentry>
<varlistentry>
- <term><varname>-ESTALE</varname></term>
+ <term><constant>-ESTALE</constant></term>
<listitem><para>Message is in invalid state.
</para></listitem>
</varlistentry>
<varlistentry>
- <term><varname>-ENXIO</varname></term>
+ <term><constant>-ENXIO</constant></term>
<listitem><para>Message cannot be appended to.
</para></listitem>
</varlistentry>
<varlistentry>
- <term><varname>-ENOMEM</varname></term>
+ <term><constant>-ENOMEM</constant></term>
<listitem><para>Memory allocation failed.</para></listitem>
</varlistentry>
diff --git a/man/sd_bus_message_get_cookie.xml b/man/sd_bus_message_get_cookie.xml
index 641ecec..3e3f9bd 100644
--- a/man/sd_bus_message_get_cookie.xml
+++ b/man/sd_bus_message_get_cookie.xml
@@ -107,14 +107,14 @@
<variablelist>
<varlistentry>
- <term><varname>-EINVAL</varname></term>
+ <term><constant>-EINVAL</constant></term>
<listitem><para>A specified parameter
is invalid.</para></listitem>
</varlistentry>
<varlistentry>
- <term><varname>-ENODATA</varname></term>
+ <term><constant>-ENODATA</constant></term>
<listitem><para>No cookie has been
assigned to this message. This either
diff --git a/man/sd_bus_message_get_monotonic_usec.xml b/man/sd_bus_message_get_monotonic_usec.xml
index 311ba55..290faf2 100644
--- a/man/sd_bus_message_get_monotonic_usec.xml
+++ b/man/sd_bus_message_get_monotonic_usec.xml
@@ -139,14 +139,14 @@
<variablelist>
<varlistentry>
- <term><varname>-EINVAL</varname></term>
+ <term><constant>-EINVAL</constant></term>
<listitem><para>A specified parameter
is invalid.</para></listitem>
</varlistentry>
<varlistentry>
- <term><varname>-ENODATA</varname></term>
+ <term><constant>-ENODATA</constant></term>
<listitem><para>No timestamp or
sequence number information is
diff --git a/man/sd_bus_negotiate_fds.xml b/man/sd_bus_negotiate_fds.xml
index c91318c..fb313e3 100644
--- a/man/sd_bus_negotiate_fds.xml
+++ b/man/sd_bus_negotiate_fds.xml
@@ -143,7 +143,7 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
<variablelist>
<varlistentry>
- <term><varname>-EPERM</varname></term>
+ <term><constant>-EPERM</constant></term>
<listitem><para>The bus connection has already been started.</para></listitem>
</varlistentry>
diff --git a/man/sd_bus_new.xml b/man/sd_bus_new.xml
index 1f8d787..8c56dc0 100644
--- a/man/sd_bus_new.xml
+++ b/man/sd_bus_new.xml
@@ -112,7 +112,7 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
<variablelist>
<varlistentry>
- <term><varname>-ENOMEM</varname></term>
+ <term><constant>-ENOMEM</constant></term>
<listitem><para>Memory allocation failed.</para></listitem>
</varlistentry>
diff --git a/man/sd_bus_open_user.xml b/man/sd_bus_open_user.xml
index 6cb4a31..47f8361 100644
--- a/man/sd_bus_open_user.xml
+++ b/man/sd_bus_open_user.xml
@@ -171,7 +171,7 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
<variablelist>
<varlistentry>
- <term><varname>-EINVAL</varname></term>
+ <term><constant>-EINVAL</constant></term>
<listitem><para>Specified parameter is invalid
(<constant>NULL</constant> in case of output
@@ -179,7 +179,7 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
</varlistentry>
<varlistentry>
- <term><varname>-ENOMEM</varname></term>
+ <term><constant>-ENOMEM</constant></term>
<listitem><para>Memory allocation failed.</para></listitem>
</varlistentry>
diff --git a/man/sd_bus_request_name.xml b/man/sd_bus_request_name.xml
index c23bbb3..ca08218 100644
--- a/man/sd_bus_request_name.xml
+++ b/man/sd_bus_request_name.xml
@@ -143,7 +143,7 @@
<variablelist>
<varlistentry>
- <term><varname>-EALREADY</varname></term>
+ <term><constant>-EALREADY</constant></term>
<listitem><para>The caller already is
the owner of the specified
@@ -151,7 +151,7 @@
</varlistentry>
<varlistentry>
- <term><varname>-EEXIST</varname></term>
+ <term><constant>-EEXIST</constant></term>
<listitem><para>The name has already
been acquired by a different peer, and
@@ -163,7 +163,7 @@
</varlistentry>
<varlistentry>
- <term><varname>-ESRCH</varname></term>
+ <term><constant>-ESRCH</constant></term>
<listitem><para>It was attempted to
release a name that is currently not
@@ -172,7 +172,7 @@
</varlistentry>
<varlistentry>
- <term><varname>-EADDRINUSE</varname></term>
+ <term><constant>-EADDRINUSE</constant></term>
<listitem><para>It was attempted to
release a name that is owned by a
@@ -181,21 +181,21 @@
</varlistentry>
<varlistentry>
- <term><varname>-EINVAL</varname></term>
+ <term><constant>-EINVAL</constant></term>
<listitem><para>A specified parameter
is invalid.</para></listitem>
</varlistentry>
<varlistentry>
- <term><varname>-ENOTCONN</varname></term>
+ <term><constant>-ENOTCONN</constant></term>
<listitem><para>The bus connection has
been disconnected.</para></listitem>
</varlistentry>
<varlistentry>
- <term><varname>-ECHILD</varname></term>
+ <term><constant>-ECHILD</constant></term>
<listitem><para>The bus connection has
been created in a different process
diff --git a/man/sd_event_add_child.xml b/man/sd_event_add_child.xml
index f282a50..012fdb6 100644
--- a/man/sd_event_add_child.xml
+++ b/man/sd_event_add_child.xml
@@ -137,13 +137,13 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
<variablelist>
<varlistentry>
- <term><varname>-ENOMEM</varname></term>
+ <term><constant>-ENOMEM</constant></term>
<listitem><para>Not enough memory to allocate an object.</para></listitem>
</varlistentry>
<varlistentry>
- <term><varname>-EINVAL</varname></term>
+ <term><constant>-EINVAL</constant></term>
<listitem><para>An invalid argument has been passed. This includes
specyfing an empty mask in <parameter>options</parameter> or a mask
@@ -155,7 +155,7 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
</varlistentry>
<varlistentry>
- <term><varname>-EBUSY</varname></term>
+ <term><constant>-EBUSY</constant></term>
<listitem><para>An handler is already installed for this
child.</para></listitem>
@@ -163,14 +163,14 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
</varlistentry>
<varlistentry>
- <term><varname>-ESTALE</varname></term>
+ <term><constant>-ESTALE</constant></term>
<listitem><para>The event loop is already terminated.</para></listitem>
</varlistentry>
<varlistentry>
- <term><varname>-ECHILD</varname></term>
+ <term><constant>-ECHILD</constant></term>
<listitem><para>The event loop has been created in a different process.</para></listitem>
diff --git a/man/sd_event_add_defer.xml b/man/sd_event_add_defer.xml
index 6c93709..442600a 100644
--- a/man/sd_event_add_defer.xml
+++ b/man/sd_event_add_defer.xml
@@ -138,25 +138,25 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
<variablelist>
<varlistentry>
- <term><varname>-ENOMEM</varname></term>
+ <term><constant>-ENOMEM</constant></term>
<listitem><para>Not enough memory to allocate an object.</para></listitem>
</varlistentry>
<varlistentry>
- <term><varname>-EINVAL</varname></term>
+ <term><constant>-EINVAL</constant></term>
<listitem><para>An invalid argument has been passed.</para></listitem>
</varlistentry>
<varlistentry>
- <term><varname>-ESTALE</varname></term>
+ <term><constant>-ESTALE</constant></term>
<listitem><para>The event loop is already terminated.</para></listitem>
</varlistentry>
<varlistentry>
- <term><varname>-ECHILD</varname></term>
+ <term><constant>-ECHILD</constant></term>
<listitem><para>The event loop has been created in a different process.</para></listitem>
</varlistentry>
diff --git a/man/sd_event_add_signal.xml b/man/sd_event_add_signal.xml
index 1517c10..6584268 100644
--- a/man/sd_event_add_signal.xml
+++ b/man/sd_event_add_signal.xml
@@ -134,20 +134,20 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
<variablelist>
<varlistentry>
- <term><varname>-ENOMEM</varname></term>
+ <term><constant>-ENOMEM</constant></term>
<listitem><para>Not enough memory to allocate an object.</para></listitem>
</varlistentry>
<varlistentry>
- <term><varname>-EINVAL</varname></term>
+ <term><constant>-EINVAL</constant></term>
<listitem><para>An invalid argument has been passed.</para></listitem>
</varlistentry>
<varlistentry>
- <term><varname>-EBUSY</varname></term>
+ <term><constant>-EBUSY</constant></term>
<listitem><para>An handler is already installed for this
signal or the signal was not blocked previously.</para></listitem>
@@ -155,14 +155,14 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
</varlistentry>
<varlistentry>
- <term><varname>-ESTALE</varname></term>
+ <term><constant>-ESTALE</constant></term>
<listitem><para>The event loop is already terminated.</para></listitem>
</varlistentry>
<varlistentry>
- <term><varname>-ECHILD</varname></term>
+ <term><constant>-ECHILD</constant></term>
<listitem><para>The event loop has been created in a different process.</para></listitem>
diff --git a/man/sd_event_add_time.xml b/man/sd_event_add_time.xml
index f16b84f..77b8828 100644
--- a/man/sd_event_add_time.xml
+++ b/man/sd_event_add_time.xml
@@ -196,34 +196,34 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
<variablelist>
<varlistentry>
- <term><varname>-ENOMEM</varname></term>
+ <term><constant>-ENOMEM</constant></term>
<listitem><para>Not enough memory to allocate an object.</para></listitem>
</varlistentry>
<varlistentry>
- <term><varname>-EINVAL</varname></term>
+ <term><constant>-EINVAL</constant></term>
<listitem><para>An invalid argument has been passed.</para></listitem>
</varlistentry>
<varlistentry>
- <term><varname>-ESTALE</varname></term>
+ <term><constant>-ESTALE</constant></term>
<listitem><para>The event loop is already terminated.</para></listitem>
</varlistentry>
<varlistentry>
- <term><varname>-ECHILD</varname></term>
+ <term><constant>-ECHILD</constant></term>
<listitem><para>The event loop has been created in a different process.</para></listitem>
</varlistentry>
<varlistentry>
- <term><varname>-ENOTSUP</varname></term>
+ <term><constant>-ENOTSUP</constant></term>
<listitem><para>The selected clock is not supported by the event loop implementation.</para></listitem>
diff --git a/man/sd_event_new.xml b/man/sd_event_new.xml
index 3062f43..d392ed3 100644
--- a/man/sd_event_new.xml
+++ b/man/sd_event_new.xml
@@ -138,13 +138,13 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
<variablelist>
<varlistentry>
- <term><varname>-ENOMEM</varname></term>
+ <term><constant>-ENOMEM</constant></term>
<listitem><para>Not enough memory to allocate the object.</para></listitem>
</varlistentry>
<varlistentry>
- <term><varname>-EMFILE</varname></term>
+ <term><constant>-EMFILE</constant></term>
<listitem><para>The maximum number of event loops has been allocated.</para></listitem>
commit 4dfefc1914bad6a025e2d6738999e45b74715002
Author: Zbigniew JÄdrzejewski-Szmek <zbyszek at in.waw.pl>
Date: Thu Sep 25 17:27:40 2014 -0400
man: document sd_event_add_{defer,post,exit}
diff --git a/Makefile-man.am b/Makefile-man.am
index 53e2f2c..bd5306e 100644
--- a/Makefile-man.am
+++ b/Makefile-man.am
@@ -742,6 +742,7 @@ MANPAGES += \
man/sd_bus_path_encode.3 \
man/sd_bus_request_name.3 \
man/sd_event_add_child.3 \
+ man/sd_event_add_defer.3 \
man/sd_event_add_signal.3 \
man/sd_event_add_time.3 \
man/sd_event_new.3 \
@@ -802,6 +803,8 @@ MANPAGES_ALIAS += \
man/sd_bus_ref.3 \
man/sd_bus_release_name.3 \
man/sd_bus_unref.3 \
+ man/sd_event_add_exit.3 \
+ man/sd_event_add_post.3 \
man/sd_event_default.3 \
man/sd_event_ref.3 \
man/sd_event_source_get_child_pid.3 \
@@ -867,6 +870,8 @@ man/sd_bus_path_decode.3: man/sd_bus_path_encode.3
man/sd_bus_ref.3: man/sd_bus_new.3
man/sd_bus_release_name.3: man/sd_bus_request_name.3
man/sd_bus_unref.3: man/sd_bus_new.3
+man/sd_event_add_exit.3: man/sd_event_add_defer.3
+man/sd_event_add_post.3: man/sd_event_add_defer.3
man/sd_event_default.3: man/sd_event_new.3
man/sd_event_ref.3: man/sd_event_new.3
man/sd_event_source_get_child_pid.3: man/sd_event_add_child.3
@@ -1040,6 +1045,12 @@ man/sd_bus_release_name.html: man/sd_bus_request_name.html
man/sd_bus_unref.html: man/sd_bus_new.html
$(html-alias)
+man/sd_event_add_exit.html: man/sd_event_add_defer.html
+ $(html-alias)
+
+man/sd_event_add_post.html: man/sd_event_add_defer.html
+ $(html-alias)
+
man/sd_event_default.html: man/sd_event_new.html
$(html-alias)
@@ -1555,6 +1566,7 @@ EXTRA_DIST += \
man/sd_bus_path_encode.xml \
man/sd_bus_request_name.xml \
man/sd_event_add_child.xml \
+ man/sd_event_add_defer.xml \
man/sd_event_add_signal.xml \
man/sd_event_add_time.xml \
man/sd_event_new.xml \
diff --git a/man/sd_event_add_child.xml b/man/sd_event_add_child.xml
index a3b4d85..f282a50 100644
--- a/man/sd_event_add_child.xml
+++ b/man/sd_event_add_child.xml
@@ -198,6 +198,7 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
<citerefentry><refentrytitle>sd_event_new</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_time</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_signal</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
+ <citerefentry><refentrytitle>sd_event_add_defer</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_source_set_enabled</refentrytitle><manvolnum>3</manvolnum></citerefentry>
</para>
</refsect1>
diff --git a/man/sd_event_add_defer.xml b/man/sd_event_add_defer.xml
new file mode 100644
index 0000000..6c93709
--- /dev/null
+++ b/man/sd_event_add_defer.xml
@@ -0,0 +1,191 @@
+<?xml version='1.0'?> <!--*-nxml-*-->
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
+
+<!--
+This file is part of systemd.
+
+Copyright 2014 Zbigniew JÄdrzejewski-Szmek
+
+systemd is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation; either version 2.1 of the License, or
+(at your option) any later version.
+
+systemd is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with systemd; If not, see <http://www.gnu.org/licenses/>.
+-->
+
+<refentry id="sd_event_add_defer" conditional="ENABLE_KDBUS">
+
+ <refentryinfo>
+ <title>sd_event_add_defer</title>
+ <productname>systemd</productname>
+
+ <authorgroup>
+ <author>
+ <contrib>More text</contrib>
+ <firstname>Zbigniew</firstname>
+ <surname>JÄdrzejewski-Szmek</surname>
+ <email>zbyszek at in.waw.pl</email>
+ </author>
+ </authorgroup>
+ </refentryinfo>
+
+ <refmeta>
+ <refentrytitle>sd_event_add_defer</refentrytitle>
+ <manvolnum>3</manvolnum>
+ </refmeta>
+
+ <refnamediv>
+ <refname>sd_event_add_defer</refname>
+ <refname>sd_event_add_post</refname>
+ <refname>sd_event_add_exit</refname>
+
+ <refpurpose>Add static event sources to an event loop</refpurpose>
+ </refnamediv>
+
+ <refsynopsisdiv>
+ <funcsynopsis>
+ <funcsynopsisinfo>#include <systemd/sd-bus.h></funcsynopsisinfo>
+
+ <funcprototype>
+ <funcdef>int <function>sd_event_add_defer</function></funcdef>
+ <paramdef>sd_event *<parameter>event</parameter></paramdef>
+ <paramdef>sd_event_source **<parameter>source</parameter></paramdef>
+ <paramdef>sd_event_handler_t <parameter>handler</parameter></paramdef>
+ <paramdef>void *<parameter>userdata</parameter></paramdef>
+ </funcprototype>
+
+ <funcprototype>
+ <funcdef>int <function>sd_event_add_post</function></funcdef>
+ <paramdef>sd_event *<parameter>event</parameter></paramdef>
+ <paramdef>sd_event_source **<parameter>source</parameter></paramdef>
+ <paramdef>sd_event_handler_t <parameter>handler</parameter></paramdef>
+ <paramdef>void *<parameter>userdata</parameter></paramdef>
+ </funcprototype>
+
+ <funcprototype>
+ <funcdef>int <function>sd_event_add_exit</function></funcdef>
+ <paramdef>sd_event *<parameter>event</parameter></paramdef>
+ <paramdef>sd_event_source **<parameter>source</parameter></paramdef>
+ <paramdef>sd_event_handler_t <parameter>handler</parameter></paramdef>
+ <paramdef>void *<parameter>userdata</parameter></paramdef>
+ </funcprototype>
+
+ <funcprototype>
+ <funcdef>typedef int (*<function>sd_event_handler_t</function>)</funcdef>
+ <paramdef>sd_event_source *<parameter>s</parameter></paramdef>
+ <paramdef>void *<parameter>userdata</parameter></paramdef>
+ </funcprototype>
+
+ </funcsynopsis>
+ </refsynopsisdiv>
+
+ <refsect1>
+ <title>Description</title>
+
+ <para>Those three functions add new event sources to an event loop
+ object. The event loop is specified in
+ <parameter>event</parameter>, the event source is returned in the
+ <parameter>source</parameter> parameter. The event sources are
+ enabled statically and will "fire" when the event loop is run and
+ the conditions described below are met. The handler function will
+ be passed the <parameter>userdata</parameter> pointer, which may
+ be chosen freely by the caller.</para>
+
+ <para><function>sd_event_add_defer()</function> adds a new event
+ source that will "fire" the next time the event loop is run. By
+ default, the handler will be called once
+ (<constant>SD_EVENT_ONESHOT</constant>).</para>
+
+ <para><function>sd_event_add_defer()</function> adds a new event
+ source that will "fire" if any event handlers are invoked whenever
+ the event loop is run. By default, the source is enabled
+ permanently (<constant>SD_EVENT_ON</constant>).</para>
+
+ <para><function>sd_event_add_exit()</function> adds a new event
+ source that will "fire" when the event loop is terminated
+ with <function>sd_event_exit()</function>.</para>
+
+ <para>The
+ <citerefentry><refentrytitle>sd_event_source_set_enabled</refentrytitle><manvolnum>3</manvolnum></citerefentry>
+ function may be used to enable the event source permanently
+ (<constant>SD_EVENT_ON</constant>) or to make it fire just once
+ (<constant>SD_EVENT_ONESHOT</constant>). If the handler function
+ returns a negative error code, it will be disabled after the
+ invocation, even if <constant>SD_EVENT_ON</constant> mode is
+ set.</para>
+ </refsect1>
+
+ <refsect1>
+ <title>Return Value</title>
+
+ <para>On success, this functions return 0 or a positive
+ integer. On failure, they return a negative errno-style error
+ code.</para>
+ </refsect1>
+
+ <refsect1>
+ <title>Errors</title>
+
+ <para>Returned errors may indicate the following problems:</para>
+
+ <variablelist>
+ <varlistentry>
+ <term><varname>-ENOMEM</varname></term>
+
+ <listitem><para>Not enough memory to allocate an object.</para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><varname>-EINVAL</varname></term>
+
+ <listitem><para>An invalid argument has been passed.</para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><varname>-ESTALE</varname></term>
+
+ <listitem><para>The event loop is already terminated.</para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><varname>-ECHILD</varname></term>
+
+ <listitem><para>The event loop has been created in a different process.</para></listitem>
+ </varlistentry>
+
+ </variablelist>
+ </refsect1>
+
+ <refsect1>
+ <title>Notes</title>
+
+ <para>Functions described here are available as a shared library,
+ which can be compiled and linked to with the
+ <constant>libsystemd</constant>Â <citerefentry
+ project='die-net'><refentrytitle>pkg-config</refentrytitle><manvolnum>1</manvolnum></citerefentry>
+ file.</para>
+ </refsect1>
+
+ <refsect1>
+ <title>See Also</title>
+
+ <para>
+ <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
+ <citerefentry><refentrytitle>sd-event</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
+ <citerefentry><refentrytitle>sd_event_new</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
+ <citerefentry><refentrytitle>sd_event_add_time</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
+ <citerefentry><refentrytitle>sd_event_add_signal</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
+ <citerefentry><refentrytitle>sd_event_add_child</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
+ <citerefentry><refentrytitle>sd_event_source_set_enabled</refentrytitle><manvolnum>3</manvolnum></citerefentry>
+ </para>
+ </refsect1>
+
+</refentry>
diff --git a/man/sd_event_add_signal.xml b/man/sd_event_add_signal.xml
index 2b656b6..1517c10 100644
--- a/man/sd_event_add_signal.xml
+++ b/man/sd_event_add_signal.xml
@@ -190,6 +190,7 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
<citerefentry><refentrytitle>sd_event_new</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_time</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_child</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
+ <citerefentry><refentrytitle>sd_event_add_defer</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_source_set_enabled</refentrytitle><manvolnum>3</manvolnum></citerefentry>
</para>
</refsect1>
diff --git a/man/sd_event_add_time.xml b/man/sd_event_add_time.xml
index e64ed8e..f16b84f 100644
--- a/man/sd_event_add_time.xml
+++ b/man/sd_event_add_time.xml
@@ -250,6 +250,7 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
<citerefentry><refentrytitle>sd_event_new</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_signal</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_child</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
+ <citerefentry><refentrytitle>sd_event_add_defer</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>clock_gettime</refentrytitle><manvolnum>2</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_source_set_enabled</refentrytitle><manvolnum>3</manvolnum></citerefentry>
</para>
commit edf2573743b25273bee020230a60f1a054b8ec60
Author: Zbigniew JÄdrzejewski-Szmek <zbyszek at in.waw.pl>
Date: Thu Sep 25 17:27:33 2014 -0400
man: add sd_event_add_child(3)
diff --git a/Makefile-man.am b/Makefile-man.am
index 85a3612..53e2f2c 100644
--- a/Makefile-man.am
+++ b/Makefile-man.am
@@ -741,6 +741,7 @@ MANPAGES += \
man/sd_bus_open_user.3 \
man/sd_bus_path_encode.3 \
man/sd_bus_request_name.3 \
+ man/sd_event_add_child.3 \
man/sd_event_add_signal.3 \
man/sd_event_add_time.3 \
man/sd_event_new.3 \
@@ -803,6 +804,7 @@ MANPAGES_ALIAS += \
man/sd_bus_unref.3 \
man/sd_event_default.3 \
man/sd_event_ref.3 \
+ man/sd_event_source_get_child_pid.3 \
man/sd_event_source_get_signal.3 \
man/sd_event_source_get_time.3 \
man/sd_event_source_get_time_accuracy.3 \
@@ -867,6 +869,7 @@ man/sd_bus_release_name.3: man/sd_bus_request_name.3
man/sd_bus_unref.3: man/sd_bus_new.3
man/sd_event_default.3: man/sd_event_new.3
man/sd_event_ref.3: man/sd_event_new.3
+man/sd_event_source_get_child_pid.3: man/sd_event_add_child.3
man/sd_event_source_get_signal.3: man/sd_event_add_signal.3
man/sd_event_source_get_time.3: man/sd_event_add_time.3
man/sd_event_source_get_time_accuracy.3: man/sd_event_add_time.3
@@ -1043,6 +1046,9 @@ man/sd_event_default.html: man/sd_event_new.html
man/sd_event_ref.html: man/sd_event_new.html
$(html-alias)
+man/sd_event_source_get_child_pid.html: man/sd_event_add_child.html
+ $(html-alias)
+
man/sd_event_source_get_signal.html: man/sd_event_add_signal.html
$(html-alias)
@@ -1548,6 +1554,7 @@ EXTRA_DIST += \
man/sd_bus_open_user.xml \
man/sd_bus_path_encode.xml \
man/sd_bus_request_name.xml \
+ man/sd_event_add_child.xml \
man/sd_event_add_signal.xml \
man/sd_event_add_time.xml \
man/sd_event_new.xml \
diff --git a/man/sd_event_add_child.xml b/man/sd_event_add_child.xml
new file mode 100644
index 0000000..a3b4d85
--- /dev/null
+++ b/man/sd_event_add_child.xml
@@ -0,0 +1,205 @@
+<?xml version='1.0'?> <!--*-nxml-*-->
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
+
+<!--
+This file is part of systemd.
+
+Copyright 2014 Zbigniew JÄdrzejewski-Szmek
+
+systemd is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation; either version 2.1 of the License, or
+(at your option) any later version.
+
+systemd is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with systemd; If not, see <http://www.gnu.org/licenses/>.
+-->
+
+<refentry id="sd_event_add_child" conditional="ENABLE_KDBUS">
+
+ <refentryinfo>
+ <title>sd_event_add_child</title>
+ <productname>systemd</productname>
+
+ <authorgroup>
+ <author>
+ <contrib>More text</contrib>
+ <firstname>Zbigniew</firstname>
+ <surname>JÄdrzejewski-Szmek</surname>
+ <email>zbyszek at in.waw.pl</email>
+ </author>
+ </authorgroup>
+ </refentryinfo>
+
+ <refmeta>
+ <refentrytitle>sd_event_add_child</refentrytitle>
+ <manvolnum>3</manvolnum>
+ </refmeta>
+
+ <refnamediv>
+ <refname>sd_event_add_child</refname>
+ <refname>sd_event_source_get_child_pid</refname>
+
+ <refpurpose>Add a child state change event source to an event loop</refpurpose>
+ </refnamediv>
+
+ <refsynopsisdiv>
+ <funcsynopsis>
+ <funcsynopsisinfo>#include <systemd/sd-bus.h></funcsynopsisinfo>
+
+ <funcprototype>
+ <funcdef>int <function>sd_event_add_child</function></funcdef>
+ <paramdef>sd_event *<parameter>event</parameter></paramdef>
+ <paramdef>sd_event_source **<parameter>source</parameter></paramdef>
+ <paramdef>pid_t <parameter>pid</parameter></paramdef>
+ <paramdef>int <parameter>options</parameter></paramdef>
+ <paramdef>sd_event_child_handler_t <parameter>handler</parameter></paramdef>
+ <paramdef>void *<parameter>userdata</parameter></paramdef>
+ </funcprototype>
+
+ <funcprototype>
+ <funcdef>typedef int (*<function>sd_event_child_handler_t</function>)</funcdef>
+ <paramdef>sd_event_source *<parameter>s</parameter></paramdef>
+ <paramdef>const siginfo_t *<parameter>si</parameter></paramdef>
+ <paramdef>void *<parameter>userdata</parameter></paramdef>
+ </funcprototype>
+
+ <funcprototype>
+ <funcdef>int <function>sd_event_source_get_child_pid</function></funcdef>
+ <paramdef>sd_event_source *<parameter>source</parameter></paramdef>
+ <paramdef>pid_t *<parameter>pid</parameter></paramdef>
+ </funcprototype>
+
+ </funcsynopsis>
+ </refsynopsisdiv>
+
+ <refsect1>
+ <title>Description</title>
+
+ <para><function>sd_event_add_child()</function> adds a new child
+ state change event source to an event loop object. The event loop
+ is specified in <parameter>event</parameter>, the event source is
+ returned in the <parameter>source</parameter> parameter. The
+ <parameter>pid</parameter> parameter specifies the process to
+ watch. The <parameter>handler</parameter> must reference a
+ function to call when the process changes state. The handler
+ function will be passed the <parameter>userdata</parameter>
+ pointer, which may be chosen freely by the caller. The handler
+ also receives a pointer to a <structname>const
+ siginfo_t</structname> structure containing the information about
+ the event. The <parameter>options</parameter> parameter determines
+ which state changes will be watched for. It must contain an OR-ed
+ mask of <constant>WEXITED</constant> (watch for the child
+ terminating), <constant>WSTOPPED</constant> (watch for the child
+ being stopped by a signal), and <constant>WCONTINUED</constant>
+ (watch for the child being resumed by a signal). See
+ <citerefentry><refentrytitle>waitid</refentrytitle><manvolnum>2</manvolnum></citerefentry>
+ for futher information.</para>
+
+ <para>Only a single handler may be installed for a specific
+ child. The handler is enabled
+ for a single event (<constant>SD_EVENT_ONESHOT</constant>),
+ but this may be
+ changed with
+ <citerefentry><refentrytitle>sd_event_source_set_enabled</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
+ If the handler function returns a negative error code, it will be
+ disabled after the invocation, even if
+ <constant>SD_EVENT_ON</constant> mode is set.
+ </para>
+
+ <para><function>sd_event_source_get_child_pid()</function>
+ retrieves the configured <parameter>pid</parameter> of a child
+ state change event source created previously with
+ <function>sd_event_add_child()</function>. It takes the event
+ source object as the <parameter>source</parameter> parameter and a
+ pointer to <type>pid_t</type> to return the result in.
+ </para>
+ </refsect1>
+
+ <refsect1>
+ <title>Return Value</title>
+
+ <para>On success, these functions return 0 or a positive
+ integer. On failure, they return a negative errno-style error
+ code.</para>
+ </refsect1>
+
+ <refsect1>
+ <title>Errors</title>
+
+ <para>Returned errors may indicate the following problems:</para>
+
+ <variablelist>
+ <varlistentry>
+ <term><varname>-ENOMEM</varname></term>
+
+ <listitem><para>Not enough memory to allocate an object.</para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><varname>-EINVAL</varname></term>
+
+ <listitem><para>An invalid argument has been passed. This includes
+ specyfing an empty mask in <parameter>options</parameter> or a mask
+ which constains values different than a combination of
+ <constant>WEXITED</constant>, <constant>WSTOPPED</constant>, and
+ <constant>WCONTINUED</constant>.
+ </para></listitem>
+
+ </varlistentry>
+
+ <varlistentry>
+ <term><varname>-EBUSY</varname></term>
+
+ <listitem><para>An handler is already installed for this
+ child.</para></listitem>
+
+ </varlistentry>
+
+ <varlistentry>
+ <term><varname>-ESTALE</varname></term>
+
+ <listitem><para>The event loop is already terminated.</para></listitem>
+
+ </varlistentry>
+
+ <varlistentry>
+ <term><varname>-ECHILD</varname></term>
+
+ <listitem><para>The event loop has been created in a different process.</para></listitem>
+
+ </varlistentry>
+
+ </variablelist>
+ </refsect1>
+
+ <refsect1>
+ <title>Notes</title>
+
+ <para><function>sd_event_add_child()</function> and the other functions
+ described here are available as a shared library, which can be
+ compiled and linked to with the
+ <constant>libsystemd</constant>Â <citerefentry project='die-net'><refentrytitle>pkg-config</refentrytitle><manvolnum>1</manvolnum></citerefentry>
+ file.</para>
+ </refsect1>
+
+ <refsect1>
+ <title>See Also</title>
+
+ <para>
+ <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
+ <citerefentry><refentrytitle>sd-event</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
+ <citerefentry><refentrytitle>sd_event_new</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
+ <citerefentry><refentrytitle>sd_event_add_time</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
+ <citerefentry><refentrytitle>sd_event_add_signal</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
+ <citerefentry><refentrytitle>sd_event_source_set_enabled</refentrytitle><manvolnum>3</manvolnum></citerefentry>
+ </para>
+ </refsect1>
+
+</refentry>
diff --git a/man/sd_event_add_signal.xml b/man/sd_event_add_signal.xml
index 2344fb3..2b656b6 100644
--- a/man/sd_event_add_signal.xml
+++ b/man/sd_event_add_signal.xml
@@ -189,6 +189,7 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
<citerefentry><refentrytitle>sd-event</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_new</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_time</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
+ <citerefentry><refentrytitle>sd_event_add_child</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_source_set_enabled</refentrytitle><manvolnum>3</manvolnum></citerefentry>
</para>
</refsect1>
diff --git a/man/sd_event_add_time.xml b/man/sd_event_add_time.xml
index d3775e5..e64ed8e 100644
--- a/man/sd_event_add_time.xml
+++ b/man/sd_event_add_time.xml
@@ -249,6 +249,7 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
<citerefentry><refentrytitle>sd-event</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_new</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_add_signal</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
+ <citerefentry><refentrytitle>sd_event_add_child</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>clock_gettime</refentrytitle><manvolnum>2</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_source_set_enabled</refentrytitle><manvolnum>3</manvolnum></citerefentry>
</para>
commit 3144ebcad37422dd85220915d37e7e9eea36564a
Author: Zbigniew JÄdrzejewski-Szmek <zbyszek at in.waw.pl>
Date: Thu Sep 25 17:27:27 2014 -0400
man: add sd_event_add_signal(3)
diff --git a/Makefile-man.am b/Makefile-man.am
index 199c731..85a3612 100644
--- a/Makefile-man.am
+++ b/Makefile-man.am
@@ -741,6 +741,7 @@ MANPAGES += \
man/sd_bus_open_user.3 \
man/sd_bus_path_encode.3 \
man/sd_bus_request_name.3 \
+ man/sd_event_add_signal.3 \
man/sd_event_add_time.3 \
man/sd_event_new.3 \
man/systemd-bus-proxyd.8 \
@@ -802,6 +803,7 @@ MANPAGES_ALIAS += \
man/sd_bus_unref.3 \
man/sd_event_default.3 \
man/sd_event_ref.3 \
+ man/sd_event_source_get_signal.3 \
man/sd_event_source_get_time.3 \
man/sd_event_source_get_time_accuracy.3 \
man/sd_event_source_get_time_clock.3 \
@@ -865,6 +867,7 @@ man/sd_bus_release_name.3: man/sd_bus_request_name.3
man/sd_bus_unref.3: man/sd_bus_new.3
man/sd_event_default.3: man/sd_event_new.3
man/sd_event_ref.3: man/sd_event_new.3
+man/sd_event_source_get_signal.3: man/sd_event_add_signal.3
man/sd_event_source_get_time.3: man/sd_event_add_time.3
man/sd_event_source_get_time_accuracy.3: man/sd_event_add_time.3
man/sd_event_source_get_time_clock.3: man/sd_event_add_time.3
@@ -1040,6 +1043,9 @@ man/sd_event_default.html: man/sd_event_new.html
man/sd_event_ref.html: man/sd_event_new.html
$(html-alias)
+man/sd_event_source_get_signal.html: man/sd_event_add_signal.html
+ $(html-alias)
+
man/sd_event_source_get_time.html: man/sd_event_add_time.html
$(html-alias)
@@ -1542,6 +1548,7 @@ EXTRA_DIST += \
man/sd_bus_open_user.xml \
man/sd_bus_path_encode.xml \
man/sd_bus_request_name.xml \
+ man/sd_event_add_signal.xml \
man/sd_event_add_time.xml \
man/sd_event_new.xml \
man/sd_get_seats.xml \
diff --git a/man/sd_event_add_signal.xml b/man/sd_event_add_signal.xml
new file mode 100644
index 0000000..2344fb3
--- /dev/null
+++ b/man/sd_event_add_signal.xml
@@ -0,0 +1,196 @@
+<?xml version='1.0'?> <!--*-nxml-*-->
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
+
+<!--
+This file is part of systemd.
+
+Copyright 2014 Zbigniew JÄdrzejewski-Szmek
+
+systemd is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation; either version 2.1 of the License, or
+(at your option) any later version.
+
+systemd is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with systemd; If not, see <http://www.gnu.org/licenses/>.
+-->
+
+<refentry id="sd_event_add_signal" conditional="ENABLE_KDBUS">
+
+ <refentryinfo>
+ <title>sd_event_add_signal</title>
+ <productname>systemd</productname>
+
+ <authorgroup>
+ <author>
+ <contrib>More text</contrib>
+ <firstname>Zbigniew</firstname>
+ <surname>JÄdrzejewski-Szmek</surname>
+ <email>zbyszek at in.waw.pl</email>
+ </author>
+ </authorgroup>
+ </refentryinfo>
+
+ <refmeta>
+ <refentrytitle>sd_event_add_signal</refentrytitle>
+ <manvolnum>3</manvolnum>
+ </refmeta>
+
+ <refnamediv>
+ <refname>sd_event_add_signal</refname>
+ <refname>sd_event_source_get_signal</refname>
+
+ <refpurpose>Add a signal event source to an event loop</refpurpose>
+ </refnamediv>
+
+ <refsynopsisdiv>
+ <funcsynopsis>
+ <funcsynopsisinfo>#include <systemd/sd-bus.h></funcsynopsisinfo>
+
+ <funcprototype>
+ <funcdef>int <function>sd_event_add_signal</function></funcdef>
+ <paramdef>sd_event *<parameter>event</parameter></paramdef>
+ <paramdef>sd_event_source **<parameter>source</parameter></paramdef>
+ <paramdef>int <parameter>signal</parameter></paramdef>
+ <paramdef>sd_event_signal_handler_t <parameter>handler</parameter></paramdef>
+ <paramdef>void *<parameter>userdata</parameter></paramdef>
+ </funcprototype>
+
+ <funcprototype>
+ <funcdef>typedef int (*<function>sd_event_signal_handler_t</function>)</funcdef>
+ <paramdef>sd_event_source *<parameter>s</parameter></paramdef>
+ <paramdef>const struct signalfd_siginfo *<parameter>si</parameter></paramdef>
+ <paramdef>void *<parameter>userdata</parameter></paramdef>
+ </funcprototype>
+
+ <funcprototype>
+ <funcdef>int <function>sd_event_source_get_signal</function></funcdef>
+ <paramdef>sd_event_source *<parameter>source</parameter></paramdef>
+ </funcprototype>
+
+ </funcsynopsis>
+ </refsynopsisdiv>
+
+ <refsect1>
+ <title>Description</title>
+
+ <para><function>sd_event_add_signal()</function> adds a new signal
+ event source to an event loop object. The event loop is specified
+ in <parameter>event</parameter>, the event source is returned in
+ the <parameter>source</parameter> parameter. The
+ <parameter>signal</parameter> parameter specifies the signal to be handled
+ (see
+ <citerefentry><refentrytitle>signal</refentrytitle><manvolnum>7</manvolnum></citerefentry>).
+ The <parameter>handler</parameter> must reference a function to
+ call when the signal is delivered or be <constant>NULL</constant>.
+ The handler function will be passed the
+ <parameter>userdata</parameter> pointer, which may be chosen
+ freely by the caller. The handler also receives a pointer to a
+ <structname>const struct signalfd_siginfo</structname> containing
+ the information about the received signal. See
+ <citerefentry><refentrytitle>signalfd</refentrytitle><manvolnum>2</manvolnum></citerefentry>
+ for futher information.</para>
+
+ <para>Only a single handler may be installed for a specific
+ signal. The signal will be unblocked, and must be
+ blocked when the function is called. If the handler is not
+ specified (<parameter>handler</parameter> is
+ <constant>NULL</constant>), a default handler which causes the
+ program to exit will be used. By default, the handler is enabled
+ permanently (<constant>SD_EVENT_ON</constant>), but this may be
+ changed with
+ <citerefentry><refentrytitle>sd_event_source_set_enabled</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
+ If the handler function returns a negative error code, it will be
+ disabled after the invocation, even if
+ <constant>SD_EVENT_ON</constant> mode is set.
+ </para>
+
+ <para><function>sd_event_source_get_signal()</function> retrieves
+ the configured signal number of a signal event source created
+ previously with <function>sd_event_add_signal()</function>. It
+ takes the event source object as the <parameter>source</parameter>
+ parameter.</para>
+
+ </refsect1>
+
+ <refsect1>
+ <title>Return Value</title>
+
+ <para>On success, these functions return 0 or a positive
+ integer. On failure, they return a negative errno-style error
+ code. </para>
+ </refsect1>
+
+ <refsect1>
+ <title>Errors</title>
+
+ <para>Returned errors may indicate the following problems:</para>
+
+ <variablelist>
+ <varlistentry>
+ <term><varname>-ENOMEM</varname></term>
+
+ <listitem><para>Not enough memory to allocate an object.</para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><varname>-EINVAL</varname></term>
+
+ <listitem><para>An invalid argument has been passed.</para></listitem>
+
+ </varlistentry>
+
+ <varlistentry>
+ <term><varname>-EBUSY</varname></term>
+
+ <listitem><para>An handler is already installed for this
+ signal or the signal was not blocked previously.</para></listitem>
+
+ </varlistentry>
+
+ <varlistentry>
+ <term><varname>-ESTALE</varname></term>
+
+ <listitem><para>The event loop is already terminated.</para></listitem>
+
+ </varlistentry>
+
+ <varlistentry>
+ <term><varname>-ECHILD</varname></term>
+
+ <listitem><para>The event loop has been created in a different process.</para></listitem>
+
+ </varlistentry>
+
+ </variablelist>
+ </refsect1>
+
+ <refsect1>
+ <title>Notes</title>
+
+ <para><function>sd_event_add_signal()</function> and the other functions
+ described here are available as a shared library, which can be
+ compiled and linked to with the
+ <constant>libsystemd</constant>Â <citerefentry project='die-net'><refentrytitle>pkg-config</refentrytitle><manvolnum>1</manvolnum></citerefentry>
+ file.</para>
+ </refsect1>
+
+ <refsect1>
+ <title>See Also</title>
+
+ <para>
+ <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
+ <citerefentry><refentrytitle>sd-event</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
+ <citerefentry><refentrytitle>sd_event_new</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
+ <citerefentry><refentrytitle>sd_event_add_time</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
+ <citerefentry><refentrytitle>sd_event_source_set_enabled</refentrytitle><manvolnum>3</manvolnum></citerefentry>
+ </para>
+ </refsect1>
+
+</refentry>
diff --git a/man/sd_event_add_time.xml b/man/sd_event_add_time.xml
index a3304f7..d3775e5 100644
--- a/man/sd_event_add_time.xml
+++ b/man/sd_event_add_time.xml
@@ -69,6 +69,13 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
</funcprototype>
<funcprototype>
+ <funcdef>typedef int (*<function>sd_event_time_handler_t</function>)</funcdef>
+ <paramdef>sd_event_source *<parameter>s</parameter></paramdef>
+ <paramdef>uint64_t <parameter>usec</parameter></paramdef>
+ <paramdef>void *<parameter>userdata</parameter></paramdef>
+ </funcprototype>
+
+ <funcprototype>
<funcdef>int <function>sd_event_source_get_time</function></funcdef>
<paramdef>sd_event_source *<parameter>source</parameter></paramdef>
<paramdef>usec_t *<parameter>usec</parameter></paramdef>
@@ -132,11 +139,15 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
actually have been called at a slightly later time, subject to the
specified accuracy value, the kernel timer slack (see
<citerefentry><refentrytitle>prctl</refentrytitle><manvolnum>2</manvolnum></citerefentry>)
- and additional scheduling latencies. By default, the timer will
- elapse once (SD_EVENT_ONESHOT), but this may be changed with
- <citerefentry><refentrytitle>sd_event_source_set_enabled</refentrytitle><manvolnum>3</manvolnum></citerefentry>. If
- the handler function returns a negative error code, it will be
- disabled after the invocation, even if SD_EVENT_ON mode is set.
+ and additional scheduling latencies.</para>
+
+ <para>By default, the timer will elapse once
+ (<constant>SD_EVENT_ONESHOT</constant>), but this may be changed
+ with
+ <citerefentry><refentrytitle>sd_event_source_set_enabled</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
+ If the handler function returns a negative error code, it will be
+ disabled after the invocation, even if
+ <constant>SD_EVENT_ON</constant> mode is set.
</para>
<para><function>sd_event_source_get_time()</function> retrieves
@@ -187,7 +198,7 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
<varlistentry>
<term><varname>-ENOMEM</varname></term>
- <listitem><para>Not enough memory to allocate object.</para></listitem>
+ <listitem><para>Not enough memory to allocate an object.</para></listitem>
</varlistentry>
<varlistentry>
@@ -237,6 +248,7 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
<citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd-event</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_new</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
+ <citerefentry><refentrytitle>sd_event_add_signal</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>clock_gettime</refentrytitle><manvolnum>2</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_event_source_set_enabled</refentrytitle><manvolnum>3</manvolnum></citerefentry>
</para>
commit 3a17521f5906b8028d6f01da99f0d84e442b02bc
Author: Zbigniew JÄdrzejewski-Szmek <zbyszek at in.waw.pl>
Date: Thu Sep 25 17:27:21 2014 -0400
build-sys: add sd_session_get_desktop to Makefile-man.am
Fixup for c72d5456e2d.
diff --git a/Makefile-man.am b/Makefile-man.am
index 1be6d3a..199c731 100644
--- a/Makefile-man.am
+++ b/Makefile-man.am
@@ -1289,6 +1289,7 @@ MANPAGES_ALIAS += \
man/sd_seat_can_tty.3 \
man/sd_seat_get_sessions.3 \
man/sd_session_get_class.3 \
+ man/sd_session_get_desktop.3 \
man/sd_session_get_display.3 \
man/sd_session_get_remote_host.3 \
man/sd_session_get_remote_user.3 \
@@ -1330,6 +1331,7 @@ man/sd_seat_can_multi_session.3: man/sd_seat_get_active.3
man/sd_seat_can_tty.3: man/sd_seat_get_active.3
man/sd_seat_get_sessions.3: man/sd_seat_get_active.3
man/sd_session_get_class.3: man/sd_session_is_active.3
+man/sd_session_get_desktop.3: man/sd_session_is_active.3
man/sd_session_get_display.3: man/sd_session_is_active.3
man/sd_session_get_remote_host.3: man/sd_session_is_active.3
man/sd_session_get_remote_user.3: man/sd_session_is_active.3
@@ -1421,6 +1423,9 @@ man/sd_seat_get_sessions.html: man/sd_seat_get_active.html
man/sd_session_get_class.html: man/sd_session_is_active.html
$(html-alias)
+man/sd_session_get_desktop.html: man/sd_session_is_active.html
+ $(html-alias)
+
man/sd_session_get_display.html: man/sd_session_is_active.html
$(html-alias)
commit bfe6c07e1b6bd8bf63d662c60fb333a003bb97a1
Author: Zbigniew JÄdrzejewski-Szmek <zbyszek at in.waw.pl>
Date: Thu Sep 25 17:27:17 2014 -0400
man/sd_event_new: tweaks
diff --git a/man/sd_event_new.xml b/man/sd_event_new.xml
index bd495b6..3062f43 100644
--- a/man/sd_event_new.xml
+++ b/man/sd_event_new.xml
@@ -86,7 +86,7 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
<parameter>event</parameter> parameter. After use, drop
the returned reference with
<function>sd_event_unref()</function>. When the last reference is
- dropped, the event loop is freed.</para>
+ dropped, the object is freed.</para>
<para><function>sd_event_default()</function> acquires a reference
to the default event loop object of the calling thread, possibly
@@ -100,23 +100,23 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
recommended to use this call instead of
<function>sd_event_new()</function> in order to share event loop
objects between various components that are dispatched in the same
- thread. All threads either have exactly zero or one default event loop
- associated, but never more.</para>
+ thread. All threads have exactly either zero or one default event loop
+ objects associated, but never more.</para>
<para><function>sd_event_ref()</function> increases the reference
- counter of the specified event loop object by one.</para>
+ count of the specified event loop object by one.</para>
<para><function>sd_event_unref()</function> decreases the
- reference counter of the specified event loop object by one. If
- the counter hits zero, the event loop object is freed. Note that it
+ reference count of the specified event loop object by one. If
+ the count hits zero, the object is freed. Note that it
is freed regardless of whether it is the default event loop object for a
thread or not. This means that allocating an event loop with
<function>sd_event_default()</function>, then releasing it, and
then acquiring a new one with
<function>sd_event_default()</function> will result in two
- distinct objects. Note that, in order to free an event loop object,
+ distinct objects. Note that in order to free an event loop object,
all remaining event sources of the event loop also need to be
- freed as they each keep a reference to it.</para>
+ freed as each keeps a reference to it.</para>
</refsect1>
<refsect1>
@@ -128,7 +128,7 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
code. <function>sd_event_ref()</function> always returns a pointer
to the event loop object passed
in. <function>sd_event_unref()</function> always returns
- NULL.</para>
+ <constant>NULL</constant>.</para>
</refsect1>
<refsect1>
@@ -140,7 +140,7 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
<varlistentry>
<term><varname>-ENOMEM</varname></term>
- <listitem><para>Not enough memory to allocate object</para></listitem>
+ <listitem><para>Not enough memory to allocate the object.</para></listitem>
</varlistentry>
<varlistentry>
commit 10893a5cfa7d792ba171282c2ec46b85ed6aae0c
Author: Gustavo Sverzut Barbieri <gustavo.barbieri at intel.com>
Date: Thu Sep 25 18:08:02 2014 -0300
journal: build fix when LZ4 is enabled but XZ is not
diff --git a/src/journal/journal-file.h b/src/journal/journal-file.h
index da2ef3b..6b4bf0d 100644
--- a/src/journal/journal-file.h
+++ b/src/journal/journal-file.h
@@ -78,7 +78,7 @@ typedef struct JournalFile {
Hashmap *chain_cache;
-#ifdef HAVE_XZ
+#if defined(HAVE_XZ) || defined(HAVE_LZ4)
void *compress_buffer;
size_t compress_buffer_size;
#endif
commit dd87b1840c966fd25b81a7aa1071e8488c624db8
Author: Zbigniew JÄdrzejewski-Szmek <zbyszek at in.waw.pl>
Date: Thu Sep 25 17:26:40 2014 -0400
journal-remote: fix counting of events written
After recent changes the number was always reported as 0, because
the accounting was done server_destroy(), called after the message was
already printed. But even before this change, the counts were wrong
because seqnum start at 0 only for newly created journal files, so when
appending to existing files, the calculated count was wrong anyway.
Also do some variable renaming for consistency and disable some low-level
debug messages.
diff --git a/src/journal-remote/journal-remote-parse.c b/src/journal-remote/journal-remote-parse.c
index e7eb151..224e8f1 100644
--- a/src/journal-remote/journal-remote-parse.c
+++ b/src/journal-remote/journal-remote-parse.c
@@ -367,7 +367,7 @@ int process_data(RemoteSource *source) {
assert(source->data_size == 0);
r = get_data_size(source);
- log_debug("get_data_size() -> %d", r);
+ // log_debug("get_data_size() -> %d", r);
if (r < 0)
return r;
if (r == 0) {
@@ -386,7 +386,7 @@ int process_data(RemoteSource *source) {
assert(source->data_size > 0);
r = get_data_data(source, &data);
- log_debug("get_data_data() -> %d", r);
+ // log_debug("get_data_data() -> %d", r);
if (r < 0)
return r;
if (r == 0) {
@@ -409,7 +409,7 @@ int process_data(RemoteSource *source) {
case STATE_DATA_FINISH:
r = get_data_newline(source);
- log_debug("get_data_newline() -> %d", r);
+ // log_debug("get_data_newline() -> %d", r);
if (r < 0)
return r;
if (r == 0) {
diff --git a/src/journal-remote/journal-remote-write.c b/src/journal-remote/journal-remote-write.c
index 8ede950..0139f85 100644
--- a/src/journal-remote/journal-remote-write.c
+++ b/src/journal-remote/journal-remote-write.c
@@ -99,11 +99,8 @@ Writer* writer_free(Writer *w) {
journal_file_close(w->journal);
}
- if (w->server) {
- w->server->event_count += w->seqnum;
- if (w->hashmap_key)
- hashmap_remove(w->server->writers, w->hashmap_key);
- }
+ if (w->server && w->hashmap_key)
+ hashmap_remove(w->server->writers, w->hashmap_key);
free(w->hashmap_key);
@@ -129,40 +126,47 @@ Writer* writer_ref(Writer *w) {
return w;
}
-
-int writer_write(Writer *s,
+int writer_write(Writer *w,
struct iovec_wrapper *iovw,
dual_timestamp *ts,
bool compress,
bool seal) {
int r;
- assert(s);
+ assert(w);
assert(iovw);
assert(iovw->count > 0);
- if (journal_file_rotate_suggested(s->journal, 0)) {
+ if (journal_file_rotate_suggested(w->journal, 0)) {
log_info("%s: Journal header limits reached or header out-of-date, rotating",
- s->journal->path);
- r = do_rotate(&s->journal, compress, seal);
+ w->journal->path);
+ r = do_rotate(&w->journal, compress, seal);
if (r < 0)
return r;
}
- r = journal_file_append_entry(s->journal, ts, iovw->iovec, iovw->count,
- &s->seqnum, NULL, NULL);
- if (r >= 0)
+ r = journal_file_append_entry(w->journal, ts, iovw->iovec, iovw->count,
+ &w->seqnum, NULL, NULL);
+ if (r >= 0) {
+ if (w->server)
+ w->server->event_count += 1;
return 1;
+ }
- log_debug("%s: Write failed, rotating: %s", s->journal->path, strerror(-r));
- r = do_rotate(&s->journal, compress, seal);
+ log_debug("%s: Write failed, rotating: %s", w->journal->path, strerror(-r));
+ r = do_rotate(&w->journal, compress, seal);
if (r < 0)
return r;
else
- log_info("%s: Successfully rotated journal", s->journal->path);
+ log_info("%s: Successfully rotated journal", w->journal->path);
log_debug("Retrying write.");
- r = journal_file_append_entry(s->journal, ts, iovw->iovec, iovw->count,
- &s->seqnum, NULL, NULL);
- return r < 0 ? r : 1;
+ r = journal_file_append_entry(w->journal, ts, iovw->iovec, iovw->count,
+ &w->seqnum, NULL, NULL);
+ if (r < 0)
+ return r;
+
+ if (w->server)
+ w->server->event_count += 1;
+ return 1;
}
commit 22259a00fdb54dee818eeb1019421e2c516a330d
Author: Jonathan Liu <net147 at gmail.com>
Date: Wed Sep 24 23:59:06 2014 +1000
journal-remote: initialize writer hashmap before use
https://bugs.freedesktop.org/show_bug.cgi?id=83682
[zj: move the initalization even earlier, before any sockets are
looked at.]
diff --git a/src/journal-remote/journal-remote.c b/src/journal-remote/journal-remote.c
index f06c2cb..ad87783 100644
--- a/src/journal-remote/journal-remote.c
+++ b/src/journal-remote/journal-remote.c
@@ -819,6 +819,10 @@ static int remoteserver_init(RemoteServer *s,
assert(server == NULL);
server = s;
+ r = init_writer_hashmap(s);
+ if (r < 0)
+ return r;
+
n = sd_listen_fds(true);
if (n < 0) {
log_error("Failed to read listening file descriptors from environment: %s",
@@ -942,10 +946,6 @@ static int remoteserver_init(RemoteServer *s,
return -EINVAL;
}
- r = init_writer_hashmap(s);
- if (r < 0)
- return r;
-
if (arg_split_mode == JOURNAL_WRITE_SPLIT_NONE) {
/* In this case we know what the writer will be
called, so we can create it and verify that we can
More information about the systemd-commits
mailing list