From eb0e417895c37dbdb64f18ae95c6b1a7a99f871e Mon Sep 17 00:00:00 2001 From: Sven Eden Date: Fri, 22 Sep 2017 09:04:02 +0200 Subject: [PATCH] Prep 229.9: Make all supportable API functions visible. The process of cleaning up elogind, meaning to mask all bits that are unneeded by elogind, has been finished a while ago. It is therefore time to re-enable all previously masked API functions that elogind can support. This will make it easier for future developers to integrate elogind into their software where they already support systemd-login. --- Makefile-man.am | 126 ++++------ Makefile.am | 13 +- man/glib-event-glue.c | 68 ++++++ man/sd_booted.xml | 43 ++-- man/sd_bus_creds_get_pid.xml | 94 ++------ man/sd_bus_creds_new_from_pid.xml | 26 +-- man/sd_bus_default.xml | 16 +- man/sd_bus_error_add_map.xml | 16 +- man/sd_bus_message_append.xml | 44 +--- man/sd_bus_message_append_array.xml | 14 +- man/sd_bus_message_append_basic.xml | 14 +- man/sd_bus_message_append_string_memfd.xml | 153 +++++++++++++ man/sd_bus_message_append_strv.xml | 14 +- man/sd_bus_message_get_cookie.xml | 146 ++++++++++++ man/sd_bus_message_get_monotonic_usec.xml | 181 +++++++++++++++ man/sd_bus_negotiate_fds.xml | 62 +++-- man/sd_bus_new.xml | 14 +- man/sd_bus_path_encode.xml | 188 +++++++++++++++ man/sd_bus_request_name.xml | 14 +- man/sd_event_add_child.xml | 14 +- man/sd_event_add_defer.xml | 16 +- man/sd_event_add_signal.xml | 14 +- man/sd_event_add_time.xml | 20 +- man/sd_event_get_fd.xml | 140 +++++++++++ man/sd_event_new.xml | 19 +- man/sd_event_run.xml | 14 +- man/sd_event_wait.xml | 36 ++- man/sd_is_fifo.xml | 69 +----- man/sd_login_monitor_new.xml | 16 +- man/sd_pid_get_session.xml | 127 ++-------- man/sd_uid_get_state.xml | 27 ++- src/basic/memfd-util.c | 2 +- src/basic/memfd-util.h | 2 +- src/basic/siphash24.c | 11 + src/basic/socket-util.h | 4 +- src/libelogind/libelogind.sym | 255 ++++++++++----------- src/libelogind/sd-bus/bus-control.c | 2 - src/libelogind/sd-bus/bus-convenience.c | 6 - src/libelogind/sd-bus/bus-creds.c | 16 +- src/libelogind/sd-bus/bus-message.c | 20 +- src/libelogind/sd-bus/bus-objects.c | 4 - src/libelogind/sd-bus/bus-slot.c | 2 - src/libelogind/sd-bus/bus-track.c | 2 - src/libelogind/sd-bus/sd-bus.c | 32 +-- src/libelogind/sd-daemon/sd-daemon.c | 16 +- src/libelogind/sd-event/sd-event.c | 26 --- src/login/.gitignore | 1 + src/systemd/sd-bus.h | 80 +------ src/systemd/sd-daemon.h | 10 +- src/systemd/sd-event.h | 24 -- 50 files changed, 1354 insertions(+), 919 deletions(-) create mode 100644 man/glib-event-glue.c create mode 100644 man/sd_bus_message_append_string_memfd.xml create mode 100644 man/sd_bus_message_get_cookie.xml create mode 100644 man/sd_bus_message_get_monotonic_usec.xml create mode 100644 man/sd_bus_path_encode.xml create mode 100644 man/sd_event_get_fd.xml diff --git a/Makefile-man.am b/Makefile-man.am index 2355ff8a6..c4e00d7cb 100644 --- a/Makefile-man.am +++ b/Makefile-man.am @@ -24,10 +24,14 @@ MANPAGES += \ man/sd_bus_message_append.3 \ man/sd_bus_message_append_array.3 \ man/sd_bus_message_append_basic.3 \ + man/sd_bus_message_append_string_memfd.3 \ man/sd_bus_message_append_strv.3 \ + man/sd_bus_message_get_cookie.3 \ + man/sd_bus_message_get_monotonic_usec.3 \ man/sd_bus_message_read_basic.3 \ man/sd_bus_negotiate_fds.3 \ man/sd_bus_new.3 \ + man/sd_bus_path_encode.3 \ man/sd_bus_process.3 \ man/sd_bus_request_name.3 \ man/sd_bus_track_add_name.3 \ @@ -38,6 +42,7 @@ MANPAGES += \ man/sd_event_add_signal.3 \ man/sd_event_add_time.3 \ man/sd_event_exit.3 \ + man/sd_event_get_fd.3 \ man/sd_event_new.3 \ man/sd_event_now.3 \ man/sd_event_run.3 \ @@ -97,7 +102,6 @@ MANPAGES_ALIAS += \ man/sd_bus_creds_get_selinux_context.3 \ man/sd_bus_creds_get_session.3 \ man/sd_bus_creds_get_sgid.3 \ - man/sd_bus_creds_get_slice.3 \ man/sd_bus_creds_get_suid.3 \ man/sd_bus_creds_get_supplementary_gids.3 \ man/sd_bus_creds_get_tid.3 \ @@ -105,9 +109,6 @@ MANPAGES_ALIAS += \ man/sd_bus_creds_get_tty.3 \ man/sd_bus_creds_get_uid.3 \ man/sd_bus_creds_get_unique_name.3 \ - man/sd_bus_creds_get_unit.3 \ - man/sd_bus_creds_get_user_slice.3 \ - man/sd_bus_creds_get_user_unit.3 \ man/sd_bus_creds_get_well_known_names.3 \ man/sd_bus_creds_has_bounding_cap.3 \ man/sd_bus_creds_has_effective_cap.3 \ @@ -133,7 +134,11 @@ MANPAGES_ALIAS += \ man/sd_bus_message_append_array_iovec.3 \ man/sd_bus_message_append_array_memfd.3 \ man/sd_bus_message_append_array_space.3 \ - man/sd_bus_message_appendv.3 \ + man/sd_bus_message_append_string_iovec.3 \ + man/sd_bus_message_append_string_space.3 \ + man/sd_bus_message_get_realtime_usec.3 \ + man/sd_bus_message_get_reply_cookie.3 \ + man/sd_bus_message_get_seqnum.3 \ man/sd_bus_negotiate_creds.3 \ man/sd_bus_negotiate_timestamp.3 \ man/sd_bus_open.3 \ @@ -141,6 +146,9 @@ MANPAGES_ALIAS += \ man/sd_bus_open_system_machine.3 \ man/sd_bus_open_system_remote.3 \ man/sd_bus_open_user.3 \ + man/sd_bus_path_decode.3 \ + man/sd_bus_path_decode_many.3 \ + man/sd_bus_path_encode_many.3 \ man/sd_bus_ref.3 \ man/sd_bus_release_name.3 \ man/sd_bus_track_add_sender.3 \ @@ -169,7 +177,6 @@ MANPAGES_ALIAS += \ man/sd_event_default.3 \ man/sd_event_dispatch.3 \ man/sd_event_get_exit_code.3 \ - man/sd_event_get_iteration.3 \ man/sd_event_get_state.3 \ man/sd_event_get_tid.3 \ man/sd_event_get_watchdog.3 \ @@ -205,10 +212,8 @@ MANPAGES_ALIAS += \ man/sd_id128_get_boot.3 \ man/sd_id128_get_invocation.3 \ man/sd_id128_get_machine_app_specific.3 \ - man/sd_is_mq.3 \ man/sd_is_socket.3 \ man/sd_is_socket_inet.3 \ - man/sd_is_socket_sockaddr.3 \ man/sd_is_socket_unix.3 \ man/sd_is_special.3 \ man/sd_listen_fds_with_names.3 \ @@ -254,7 +259,6 @@ man/sd_bus_creds_get_ppid.3: man/sd_bus_creds_get_pid.3 man/sd_bus_creds_get_selinux_context.3: man/sd_bus_creds_get_pid.3 man/sd_bus_creds_get_session.3: man/sd_bus_creds_get_pid.3 man/sd_bus_creds_get_sgid.3: man/sd_bus_creds_get_pid.3 -man/sd_bus_creds_get_slice.3: man/sd_bus_creds_get_pid.3 man/sd_bus_creds_get_suid.3: man/sd_bus_creds_get_pid.3 man/sd_bus_creds_get_supplementary_gids.3: man/sd_bus_creds_get_pid.3 man/sd_bus_creds_get_tid.3: man/sd_bus_creds_get_pid.3 @@ -262,9 +266,6 @@ man/sd_bus_creds_get_tid_comm.3: man/sd_bus_creds_get_pid.3 man/sd_bus_creds_get_tty.3: man/sd_bus_creds_get_pid.3 man/sd_bus_creds_get_uid.3: man/sd_bus_creds_get_pid.3 man/sd_bus_creds_get_unique_name.3: man/sd_bus_creds_get_pid.3 -man/sd_bus_creds_get_unit.3: man/sd_bus_creds_get_pid.3 -man/sd_bus_creds_get_user_slice.3: man/sd_bus_creds_get_pid.3 -man/sd_bus_creds_get_user_unit.3: man/sd_bus_creds_get_pid.3 man/sd_bus_creds_get_well_known_names.3: man/sd_bus_creds_get_pid.3 man/sd_bus_creds_has_bounding_cap.3: man/sd_bus_creds_get_pid.3 man/sd_bus_creds_has_effective_cap.3: man/sd_bus_creds_get_pid.3 @@ -290,7 +291,11 @@ man/sd_bus_error_setf.3: man/sd_bus_error.3 man/sd_bus_message_append_array_iovec.3: man/sd_bus_message_append_array.3 man/sd_bus_message_append_array_memfd.3: man/sd_bus_message_append_array.3 man/sd_bus_message_append_array_space.3: man/sd_bus_message_append_array.3 -man/sd_bus_message_appendv.3: man/sd_bus_message_append.3 +man/sd_bus_message_append_string_iovec.3: man/sd_bus_message_append_string_memfd.3 +man/sd_bus_message_append_string_space.3: man/sd_bus_message_append_string_memfd.3 +man/sd_bus_message_get_realtime_usec.3: man/sd_bus_message_get_monotonic_usec.3 +man/sd_bus_message_get_reply_cookie.3: man/sd_bus_message_get_cookie.3 +man/sd_bus_message_get_seqnum.3: man/sd_bus_message_get_monotonic_usec.3 man/sd_bus_negotiate_creds.3: man/sd_bus_negotiate_fds.3 man/sd_bus_negotiate_timestamp.3: man/sd_bus_negotiate_fds.3 man/sd_bus_open.3: man/sd_bus_default.3 @@ -298,6 +303,9 @@ man/sd_bus_open_system.3: man/sd_bus_default.3 man/sd_bus_open_system_machine.3: man/sd_bus_default.3 man/sd_bus_open_system_remote.3: man/sd_bus_default.3 man/sd_bus_open_user.3: man/sd_bus_default.3 +man/sd_bus_path_decode.3: man/sd_bus_path_encode.3 +man/sd_bus_path_decode_many.3: man/sd_bus_path_encode.3 +man/sd_bus_path_encode_many.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_track_add_sender.3: man/sd_bus_track_add_name.3 @@ -326,7 +334,6 @@ man/sd_event_child_handler_t.3: man/sd_event_add_child.3 man/sd_event_default.3: man/sd_event_new.3 man/sd_event_dispatch.3: man/sd_event_wait.3 man/sd_event_get_exit_code.3: man/sd_event_exit.3 -man/sd_event_get_iteration.3: man/sd_event_wait.3 man/sd_event_get_state.3: man/sd_event_wait.3 man/sd_event_get_tid.3: man/sd_event_new.3 man/sd_event_get_watchdog.3: man/sd_event_set_watchdog.3 @@ -362,10 +369,8 @@ man/sd_id128_from_string.3: man/sd_id128_to_string.3 man/sd_id128_get_boot.3: man/sd_id128_get_machine.3 man/sd_id128_get_invocation.3: man/sd_id128_get_machine.3 man/sd_id128_get_machine_app_specific.3: man/sd_id128_get_machine.3 -man/sd_is_mq.3: man/sd_is_fifo.3 man/sd_is_socket.3: man/sd_is_fifo.3 man/sd_is_socket_inet.3: man/sd_is_fifo.3 -man/sd_is_socket_sockaddr.3: man/sd_is_fifo.3 man/sd_is_socket_unix.3: man/sd_is_fifo.3 man/sd_is_special.3: man/sd_is_fifo.3 man/sd_listen_fds_with_names.3: man/sd_listen_fds.3 @@ -485,9 +490,6 @@ man/sd_bus_creds_get_session.html: man/sd_bus_creds_get_pid.html man/sd_bus_creds_get_sgid.html: man/sd_bus_creds_get_pid.html $(html-alias) -man/sd_bus_creds_get_slice.html: man/sd_bus_creds_get_pid.html - $(html-alias) - man/sd_bus_creds_get_suid.html: man/sd_bus_creds_get_pid.html $(html-alias) @@ -509,15 +511,6 @@ man/sd_bus_creds_get_uid.html: man/sd_bus_creds_get_pid.html man/sd_bus_creds_get_unique_name.html: man/sd_bus_creds_get_pid.html $(html-alias) -man/sd_bus_creds_get_unit.html: man/sd_bus_creds_get_pid.html - $(html-alias) - -man/sd_bus_creds_get_user_slice.html: man/sd_bus_creds_get_pid.html - $(html-alias) - -man/sd_bus_creds_get_user_unit.html: man/sd_bus_creds_get_pid.html - $(html-alias) - man/sd_bus_creds_get_well_known_names.html: man/sd_bus_creds_get_pid.html $(html-alias) @@ -593,7 +586,19 @@ man/sd_bus_message_append_array_memfd.html: man/sd_bus_message_append_array.html man/sd_bus_message_append_array_space.html: man/sd_bus_message_append_array.html $(html-alias) -man/sd_bus_message_appendv.html: man/sd_bus_message_append.html +man/sd_bus_message_append_string_iovec.html: man/sd_bus_message_append_string_memfd.html + $(html-alias) + +man/sd_bus_message_append_string_space.html: man/sd_bus_message_append_string_memfd.html + $(html-alias) + +man/sd_bus_message_get_realtime_usec.html: man/sd_bus_message_get_monotonic_usec.html + $(html-alias) + +man/sd_bus_message_get_reply_cookie.html: man/sd_bus_message_get_cookie.html + $(html-alias) + +man/sd_bus_message_get_seqnum.html: man/sd_bus_message_get_monotonic_usec.html $(html-alias) man/sd_bus_negotiate_creds.html: man/sd_bus_negotiate_fds.html @@ -617,6 +622,15 @@ man/sd_bus_open_system_remote.html: man/sd_bus_default.html man/sd_bus_open_user.html: man/sd_bus_default.html $(html-alias) +man/sd_bus_path_decode.html: man/sd_bus_path_encode.html + $(html-alias) + +man/sd_bus_path_decode_many.html: man/sd_bus_path_encode.html + $(html-alias) + +man/sd_bus_path_encode_many.html: man/sd_bus_path_encode.html + $(html-alias) + man/sd_bus_ref.html: man/sd_bus_new.html $(html-alias) @@ -701,9 +715,6 @@ man/sd_event_dispatch.html: man/sd_event_wait.html man/sd_event_get_exit_code.html: man/sd_event_exit.html $(html-alias) -man/sd_event_get_iteration.html: man/sd_event_wait.html - $(html-alias) - man/sd_event_get_state.html: man/sd_event_wait.html $(html-alias) @@ -809,18 +820,12 @@ man/sd_id128_get_invocation.html: man/sd_id128_get_machine.html man/sd_id128_get_machine_app_specific.html: man/sd_id128_get_machine.html $(html-alias) -man/sd_is_mq.html: man/sd_is_fifo.html - $(html-alias) - man/sd_is_socket.html: man/sd_is_fifo.html $(html-alias) man/sd_is_socket_inet.html: man/sd_is_fifo.html $(html-alias) -man/sd_is_socket_sockaddr.html: man/sd_is_fifo.html - $(html-alias) - man/sd_is_socket_unix.html: man/sd_is_fifo.html $(html-alias) @@ -870,17 +875,9 @@ MANPAGES_ALIAS += \ man/sd_peer_get_machine_name.3 \ man/sd_peer_get_owner_uid.3 \ man/sd_peer_get_session.3 \ - man/sd_peer_get_slice.3 \ - man/sd_peer_get_unit.3 \ - man/sd_peer_get_user_slice.3 \ - man/sd_peer_get_user_unit.3 \ man/sd_pid_get_cgroup.3 \ man/sd_pid_get_machine_name.3 \ man/sd_pid_get_owner_uid.3 \ - man/sd_pid_get_slice.3 \ - man/sd_pid_get_unit.3 \ - man/sd_pid_get_user_slice.3 \ - man/sd_pid_get_user_unit.3 \ man/sd_seat_can_graphical.3 \ man/sd_seat_can_multi_session.3 \ man/sd_seat_can_tty.3 \ @@ -916,17 +913,9 @@ man/sd_peer_get_cgroup.3: man/sd_pid_get_session.3 man/sd_peer_get_machine_name.3: man/sd_pid_get_session.3 man/sd_peer_get_owner_uid.3: man/sd_pid_get_session.3 man/sd_peer_get_session.3: man/sd_pid_get_session.3 -man/sd_peer_get_slice.3: man/sd_pid_get_session.3 -man/sd_peer_get_unit.3: man/sd_pid_get_session.3 -man/sd_peer_get_user_slice.3: man/sd_pid_get_session.3 -man/sd_peer_get_user_unit.3: man/sd_pid_get_session.3 man/sd_pid_get_cgroup.3: man/sd_pid_get_session.3 man/sd_pid_get_machine_name.3: man/sd_pid_get_session.3 man/sd_pid_get_owner_uid.3: man/sd_pid_get_session.3 -man/sd_pid_get_slice.3: man/sd_pid_get_session.3 -man/sd_pid_get_unit.3: man/sd_pid_get_session.3 -man/sd_pid_get_user_slice.3: man/sd_pid_get_session.3 -man/sd_pid_get_user_unit.3: man/sd_pid_get_session.3 man/sd_seat_can_graphical.3: man/sd_seat_get_active.3 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 @@ -990,18 +979,6 @@ man/sd_peer_get_owner_uid.html: man/sd_pid_get_session.html man/sd_peer_get_session.html: man/sd_pid_get_session.html $(html-alias) -man/sd_peer_get_slice.html: man/sd_pid_get_session.html - $(html-alias) - -man/sd_peer_get_unit.html: man/sd_pid_get_session.html - $(html-alias) - -man/sd_peer_get_user_slice.html: man/sd_pid_get_session.html - $(html-alias) - -man/sd_peer_get_user_unit.html: man/sd_pid_get_session.html - $(html-alias) - man/sd_pid_get_cgroup.html: man/sd_pid_get_session.html $(html-alias) @@ -1011,18 +988,6 @@ man/sd_pid_get_machine_name.html: man/sd_pid_get_session.html man/sd_pid_get_owner_uid.html: man/sd_pid_get_session.html $(html-alias) -man/sd_pid_get_slice.html: man/sd_pid_get_session.html - $(html-alias) - -man/sd_pid_get_unit.html: man/sd_pid_get_session.html - $(html-alias) - -man/sd_pid_get_user_slice.html: man/sd_pid_get_session.html - $(html-alias) - -man/sd_pid_get_user_unit.html: man/sd_pid_get_session.html - $(html-alias) - man/sd_seat_can_graphical.html: man/sd_seat_get_active.html $(html-alias) @@ -1120,10 +1085,14 @@ EXTRA_DIST += \ man/sd_bus_message_append.xml \ man/sd_bus_message_append_array.xml \ man/sd_bus_message_append_basic.xml \ + man/sd_bus_message_append_string_memfd.xml \ man/sd_bus_message_append_strv.xml \ + man/sd_bus_message_get_cookie.xml \ + man/sd_bus_message_get_monotonic_usec.xml \ man/sd_bus_message_read_basic.xml \ man/sd_bus_negotiate_fds.xml \ man/sd_bus_new.xml \ + man/sd_bus_path_encode.xml \ man/sd_bus_process.xml \ man/sd_bus_request_name.xml \ man/sd_bus_track_add_name.xml \ @@ -1134,6 +1103,7 @@ EXTRA_DIST += \ man/sd_event_add_signal.xml \ man/sd_event_add_time.xml \ man/sd_event_exit.xml \ + man/sd_event_get_fd.xml \ man/sd_event_new.xml \ man/sd_event_now.xml \ man/sd_event_run.xml \ diff --git a/Makefile.am b/Makefile.am index 5e0fa6843..c31bda544 100644 --- a/Makefile.am +++ b/Makefile.am @@ -991,10 +991,15 @@ pkgconfiglib_DATA += \ src/libelogind/libelogind.pc pkginclude_HEADERS += \ - src/systemd/sd-login.h \ - src/systemd/sd-messages.h \ - src/systemd/sd-id128.h \ - src/systemd/_sd-common.h + src/systemd/sd-bus.h \ + src/systemd/sd-bus-protocol.h \ + src/systemd/sd-bus-vtable.h \ + src/systemd/_sd-common.h \ + src/systemd/sd-daemon.h \ + src/systemd/sd-event.h \ + src/systemd/sd-id128.h \ + src/systemd/sd-login.h \ + src/systemd/sd-messages.h header-install-hook: $(MKDIR_P) $(DESTDIR)/$(pkgincludedir) diff --git a/man/glib-event-glue.c b/man/glib-event-glue.c new file mode 100644 index 000000000..8f3168d0e --- /dev/null +++ b/man/glib-event-glue.c @@ -0,0 +1,68 @@ +/*** + Copyright 2014 Tom Gundersen + + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation files + (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of the Software, + and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. +***/ + +#include + +typedef struct SDEventSource { + GSource source; + GPollFD pollfd; + sd_event *event; +} SDEventSource; + +static gboolean event_prepare(GSource *source, gint *timeout_) { + return sd_event_prepare(((SDEventSource *)source)->event) > 0; +} + +static gboolean event_check(GSource *source) { + return sd_event_wait(((SDEventSource *)source)->event, 0) > 0; +} + +static gboolean event_dispatch(GSource *source, GSourceFunc callback, gpointer user_data) { + return sd_event_dispatch(((SDEventSource *)source)->event) > 0; +} + +static void event_finalize(GSource *source) { + sd_event_unref(((SDEventSource *)source)->event); +} + +static GSourceFuncs event_funcs = { + .prepare = event_prepare, + .check = event_check, + .dispatch = event_dispatch, + .finalize = event_finalize, +}; + +GSource *g_sd_event_create_source(sd_event *event) { + SDEventSource *source; + + source = (SDEventSource *)g_source_new(&event_funcs, sizeof(SDEventSource)); + + source->event = sd_event_ref(event); + source->pollfd.fd = sd_event_get_fd(event); + source->pollfd.events = G_IO_IN | G_IO_HUP | G_IO_ERR; + + g_source_add_poll((GSource *)source, &source->pollfd); + + return (GSource *)source; +} diff --git a/man/sd_booted.xml b/man/sd_booted.xml index d9c4013c0..d6e9be16e 100644 --- a/man/sd_booted.xml +++ b/man/sd_booted.xml @@ -3,22 +3,22 @@ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> sd_booted - systemd + elogind Developer - Lennart - Poettering - lennart@poettering.net + Sven + Eden + sven.eden@gmx.de.net @@ -50,7 +50,7 @@ - #include <systemd/sd-daemon.h> + #include <elogind/sd-daemon.h> int sd_booted @@ -61,34 +61,21 @@ Description - sd_booted() checks whether the system - was booted up using the systemd init system. + sd_booted() is a compatibility function + that will always return 0. elogind is not meant to be used on systems + that are booted with systemd. Use systemd-login on such systems. Return Value - On failure, this call returns a negative errno-style error - code. If the system was booted up with systemd as init system, - this call returns a positive return value, zero otherwise. - - - - Notes - - - - Internally, this function checks whether the directory - /run/systemd/system/ exists. A simple check - like this can also be implemented trivially in shell or any other - language. + This function always returns zero. See Also - systemd1, - sd-daemon3 + elogind8, diff --git a/man/sd_bus_creds_get_pid.xml b/man/sd_bus_creds_get_pid.xml index 29cb9bd32..ffc526ea6 100644 --- a/man/sd_bus_creds_get_pid.xml +++ b/man/sd_bus_creds_get_pid.xml @@ -3,29 +3,29 @@ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> sd_bus_creds_get_pid - systemd + elogind @@ -60,10 +60,6 @@ sd_bus_creds_get_exe sd_bus_creds_get_cmdline sd_bus_creds_get_cgroup - sd_bus_creds_get_unit - sd_bus_creds_get_slice - sd_bus_creds_get_user_unit - sd_bus_creds_get_user_slice sd_bus_creds_get_session sd_bus_creds_get_owner_uid sd_bus_creds_has_effective_cap @@ -83,7 +79,7 @@ - #include <systemd/sd-bus.h> + #include <elogind/sd-bus.h> int sd_bus_creds_get_pid @@ -187,30 +183,6 @@ const char **cgroup - - int sd_bus_creds_get_unit - sd_bus_creds *c - const char **unit - - - - int sd_bus_creds_get_slice - sd_bus_creds *c - const char **slice - - - - int sd_bus_creds_get_user_unit - sd_bus_creds *c - const char **unit - - - - int sd_bus_creds_get_user_slice - sd_bus_creds *c - const char **slice - - int sd_bus_creds_get_session sd_bus_creds *c @@ -366,52 +338,34 @@ -ENXIO is returned. sd_bus_creds_get_cgroup() will retrieve - the control group path. See cgroups.txt. - sd_bus_creds_get_unit() will retrieve - the systemd unit name (in the system instance of systemd) that the - process is a part of. See - systemd.unit5. For - processes that are not part of a unit, returns -ENXIO. - - - sd_bus_creds_get_user_unit() will - retrieve the systemd unit name (in the user instance of systemd) - that the process is a part of. See - systemd.unit5. For - processes that are not part of a user unit, returns -ENXIO. - - - sd_bus_creds_get_slice() will retrieve - the systemd slice (a unit in the system instance of systemd) that - the process is a part of. See - systemd.slice5. Similarly, - sd_bus_creds_get_user_slice() retrieves the - systemd slice of the process, in the user instance of systemd. - - sd_bus_creds_get_session() will retrieve the identifier of the login session that the process is a part of. See - systemd-logind.service8. For + elogind-logind.service8. For processes that are not part of a session, returns -ENXIO. sd_bus_creds_get_owner_uid() will retrieve the numeric UID (user identifier) of the user who owns the login session that the process is a part of. See - systemd-logind.service8. + elogind-logind.service8. For processes that are not part of a session, returns -ENXIO. - sd_bus_creds_has_effective_cap() will check whether the capability specified by - capability was set in the effective capabilities mask. A positive return value means that it - was set, zero means that it was not set, and a negative return value indicates an error. See capabilities7 and the - AmbientCapabilities= and CapabilityBoundingSet= settings in - systemd.exec5. + sd_bus_creds_has_effective_cap() will + check whether the capability specified by + capability was set in the effective + capabilities mask. A positive return value means that is was + set, zero means that it was not set, and a negative return + value indicates an error. See + capabilities7 + and Capabilities= and + CapabilityBoundingSet= settings in + elogind.exec5. sd_bus_creds_has_permitted_cap() is @@ -500,13 +454,9 @@ The given field is not specified for the described process or peer. This will be returned by - sd_bus_get_unit(), - sd_bus_get_slice(), - sd_bus_get_user_unit(), - sd_bus_get_user_slice(), sd_bus_get_session(), and sd_bus_get_owner_uid() if the process is - not part of a systemd system unit, systemd user unit, systemd + not part of a elogind system unit, systemd user unit, systemd slice, or logind session. It will also be returned by sd_bus_creds_get_exe() and sd_bus_creds_get_cmdline() for kernel @@ -551,7 +501,7 @@ See Also - systemd1, + elogind8, sd-bus3, sd_bus_creds_new_from_pid2, fork2, @@ -559,7 +509,7 @@ credentials7, free3, proc5, - systemd.journal-fields7 + elogind.journal-fields7 diff --git a/man/sd_bus_creds_new_from_pid.xml b/man/sd_bus_creds_new_from_pid.xml index fe4911c4a..1a507cf91 100644 --- a/man/sd_bus_creds_new_from_pid.xml +++ b/man/sd_bus_creds_new_from_pid.xml @@ -3,29 +3,29 @@ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> sd_bus_creds_new_from_pid - systemd + elogind @@ -55,7 +55,7 @@ - #include <systemd/sd-bus.h> + #include <elogind/sd-bus.h> int sd_bus_creds_new_from_pid @@ -66,12 +66,12 @@ uint64_t sd_bus_creds_get_mask - sd_bus_creds *c + const sd_bus_creds *c uint64_t sd_bus_creds_get_augmented_mask - sd_bus_creds *c + const sd_bus_creds *c @@ -108,10 +108,6 @@ SD_BUS_CREDS_EXE, SD_BUS_CREDS_CMDLINE, SD_BUS_CREDS_CGROUP, - SD_BUS_CREDS_UNIT, - SD_BUS_CREDS_SLICE, - SD_BUS_CREDS_USER_UNIT, - SD_BUS_CREDS_USER_SLICE, SD_BUS_CREDS_SESSION, SD_BUS_CREDS_OWNER_UID, SD_BUS_CREDS_EFFECTIVE_CAPS, @@ -162,10 +158,6 @@ SD_BUS_CREDS_EXE, SD_BUS_CREDS_CMDLINE, SD_BUS_CREDS_CGROUP, - SD_BUS_CREDS_UNIT, - SD_BUS_CREDS_SLICE, - SD_BUS_CREDS_USER_UNIT, - SD_BUS_CREDS_USER_SLICE, SD_BUS_CREDS_SESSION, SD_BUS_CREDS_OWNER_UID, SD_BUS_CREDS_EFFECTIVE_CAPS, @@ -341,7 +333,7 @@ See Also - systemd1, + elogind8, sd-bus3, sd_bus_creds_get_pid3, sd_bus_get_name_creds3, diff --git a/man/sd_bus_default.xml b/man/sd_bus_default.xml index 7e853d6fe..13033a52e 100644 --- a/man/sd_bus_default.xml +++ b/man/sd_bus_default.xml @@ -3,29 +3,29 @@ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> sd_bus_default - systemd + elogind @@ -58,7 +58,7 @@ - #include <systemd/sd-bus.h> + #include <elogind/sd-bus.h> int sd_bus_default @@ -298,13 +298,13 @@ See Also - systemd1, + elogind8, sd-bus3, sd_bus_new3, sd_bus_ref3, sd_bus_unref3, ssh1, - systemd-machined.service8, + elogind-machined.service8, machinectl1 diff --git a/man/sd_bus_error_add_map.xml b/man/sd_bus_error_add_map.xml index f38fae7eb..93c8d7f48 100644 --- a/man/sd_bus_error_add_map.xml +++ b/man/sd_bus_error_add_map.xml @@ -3,29 +3,29 @@ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> sd_bus_error_add_map - systemd + elogind @@ -53,12 +53,12 @@ - #include <systemd/sd-bus.h> + #include <elogind/sd-bus.h> typedef struct { const char *name; int code; - … + ... } sd_bus_error_map; @@ -161,7 +161,7 @@ See Also - systemd1, + elogind8, sd-bus3, sd_bus_error3, sd-bus-errors3, diff --git a/man/sd_bus_message_append.xml b/man/sd_bus_message_append.xml index 26af67cd3..ba86f7afb 100644 --- a/man/sd_bus_message_append.xml +++ b/man/sd_bus_message_append.xml @@ -3,22 +3,22 @@ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> sd_bus_message_append - systemd + elogind @@ -45,7 +45,6 @@ sd_bus_message_append - sd_bus_message_appendv Attach fields to a D-Bus message based on a type string @@ -53,22 +52,14 @@ - #include <systemd/sd-bus.h> + #include <elogind/sd-bus.h> int sd_bus_message_append sd_bus_message *m const char *types - … + ... - - - int sd_bus_message_appendv - sd_bus_message *m - const char *types - va_list ap - - @@ -118,14 +109,6 @@ values for each entry matching the element type of the dictionary entries. - The sd_bus_message_appendv() is equivalent to - the function sd_bus_message_append(), - except that it is called with a va_list instead of - a variable number of arguments. This function does not call the - va_end() macro. Because it invokes the - va_arg() macro, the value of ap - is undefined after the call. - For further details on the D-Bus type system, please consult the D-Bus @@ -186,11 +169,6 @@ - For types "s" and "g" (unicode string or signature), the pointer may be - NULL, which is equivalent to an empty string. See - sd_bus_message_append_basic3 - for the precise interpretation of those and other types. - @@ -215,7 +193,7 @@ dictionary ::= "a" "{" basic_type complete_type "}" sd_bus_message *m; -… +... sd_bus_message_append(m, "s", "a string"); Append all types of integers: @@ -255,8 +233,8 @@ sd_bus_message_append(m, "ynqiuxtd", y, n, q, i, u, x, t, d); Return Value - On success, these functions return 0 or a positive - integer. On failure, these functions return a negative + On success, this call returns 0 or a positive + integer. On failure, this call returns a negative errno-style error code. @@ -276,7 +254,7 @@ sd_bus_message_append(m, "ynqiuxtd", y, n, q, i, u, x, t, d); See Also - systemd1, + elogind8, sd-bus3, sd_bus_message_append_basic3, sd_bus_message_append_array3 diff --git a/man/sd_bus_message_append_array.xml b/man/sd_bus_message_append_array.xml index 70f1f7889..9a893035e 100644 --- a/man/sd_bus_message_append_array.xml +++ b/man/sd_bus_message_append_array.xml @@ -3,22 +3,22 @@ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> sd_bus_message_append_array - systemd + elogind @@ -55,7 +55,7 @@ - #include <systemd/sd-bus.h> + #include <elogind/sd-bus.h> int sd_bus_message_append_array @@ -201,7 +201,7 @@ See Also - systemd1, + elogind8, sd-bus3, sd_bus_message_append3, sd_bus_message_append_basic3, diff --git a/man/sd_bus_message_append_basic.xml b/man/sd_bus_message_append_basic.xml index 90abca809..a49a18bba 100644 --- a/man/sd_bus_message_append_basic.xml +++ b/man/sd_bus_message_append_basic.xml @@ -3,29 +3,29 @@ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> sd_bus_message_append_basic - systemd + elogind @@ -50,7 +50,7 @@ - #include <systemd/sd-bus.h> + #include <elogind/sd-bus.h> int sd_bus_message_append_basic @@ -285,7 +285,7 @@ See Also - systemd1, + elogind8, sd-bus3, sd_bus_message_append3, The D-Bus specification diff --git a/man/sd_bus_message_append_string_memfd.xml b/man/sd_bus_message_append_string_memfd.xml new file mode 100644 index 000000000..08f1fd001 --- /dev/null +++ b/man/sd_bus_message_append_string_memfd.xml @@ -0,0 +1,153 @@ + + + + + + + + + sd_bus_message_append_string_memfd + elogind + + + + A monkey with a typewriter + Zbigniew + Jędrzejewski-Szmek + zbyszek@in.waw.pl + + + + + + sd_bus_message_append_string_memfd + 3 + + + + sd_bus_message_append_string_memfd + sd_bus_message_append_string_iovec + sd_bus_message_append_string_space + + Attach a string to a message + + + + + #include <elogind/sd-bus.h> + + + int sd_bus_message_append_string_memfd + sd_bus_message *m + int memfd + + + + int sd_bus_message_append_string_iovec + sd_bus_message *m + const struct iovec *iov + unsigned n + + + + int sd_bus_message_append_string_space + sd_bus_message *m + size_t size + char **s + + + + + + Description + + The functions + sd_bus_message_append_string_memfd and + sd_bus_message_append_string_iovec can be + used to append a single string (item of type s) + to message m. + + In case of + sd_bus_message_append_string_memfd, the + contents of memfd are the string. They must + satisfy the same constraints as described for the + s type in + sd_bus_message_append_basic3. + + In case of + sd_bus_message_append_string_iovec, the + payload of iov is the string. It must + satisfy the same constraints as described for the + s type in + sd_bus_message_append_basic3. + + The iov argument must point to + n struct iovec + structures. Each structure may have the + iov_base field set, in which case the + memory pointed to will be copied into the message, or unset, in + which case a block of spaces (ASCII 32) of length + iov_len will be inserted. The + memory pointed at by iov may be changed + after this call. + + The + sd_bus_message_append_string_space function appends + space for a string to message m. It behaves + similar to sd_bus_message_append_basic with + type s, but instead of copying a string into + the message, it returns a pointer to the destination area to + the caller in pointer p. Space for the string + of length size plus the terminating + NUL is allocated. + + + + Return Value + + On success, those calls return 0 or a positive integer. On + failure, they returns a negative errno-style error code. + + + + + + Notes + + The functions described here are available as a shared library, + which can be compiled and linked to with the + libelogind pkg-config1 + file. + + + + See Also + + + elogind8, + sd-bus3, + sd_bus_message_append_basic3, + The D-Bus specification + + + + diff --git a/man/sd_bus_message_append_strv.xml b/man/sd_bus_message_append_strv.xml index 8b7178637..458e21dcb 100644 --- a/man/sd_bus_message_append_strv.xml +++ b/man/sd_bus_message_append_strv.xml @@ -3,22 +3,22 @@ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> sd_bus_message_append_strv - systemd + elogind @@ -51,7 +51,7 @@ - #include <systemd/sd-bus.h> + #include <elogind/sd-bus.h> int sd_bus_message_append_strv @@ -105,7 +105,7 @@ See Also - systemd1, + elogind8, sd-bus3, sd_bus_message_append3, sd_bus_message_append_array3, diff --git a/man/sd_bus_message_get_cookie.xml b/man/sd_bus_message_get_cookie.xml new file mode 100644 index 000000000..7994d72aa --- /dev/null +++ b/man/sd_bus_message_get_cookie.xml @@ -0,0 +1,146 @@ + + + + + + + + + sd_bus_message_get_cookie + elogind + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + sd_bus_message_get_cookie + 3 + + + + sd_bus_message_get_cookie + sd_bus_message_get_reply_cookie + Returns the transaction cookie of a message + + + + + #include <elogind/sd-bus.h> + + + int sd_bus_message_get_cookie + sd_bus_message *message + uint64_t *cookie + + + + int sd_bus_message_get_reply_cookie + sd_bus_message *message + uint64_t *cookie + + + + + + Description + + sd_bus_message_get_cookie() returns the + transaction cookie of a message. The cookie uniquely identifies a + message within each bus peer, but is not globally unique. It is + assigned when a message is sent. + + sd_bus_message_get_reply_cookie() + returns the transaction cookie of the message the specified + message is a response to. When a reply message is generated for a + method call message, its cookie is copied over into this field. + Note that while every message that is transferred is identified by + a cookie, only response messages carry a reply cookie + field. + + Both functions take a message object as first parameter and + a place to store the 64-bit cookie in. + + + + Return Value + + On success, these calls return 0 or a positive integer. On + failure, these calls return a negative errno-style error + code. + + On success, the cookie/reply cookie is returned in the + specified 64-bit unsigned integer variable. + + + + Errors + + Returned errors may indicate the following problems: + + + + -EINVAL + + A specified parameter + is invalid. + + + + -ENODATA + + No cookie has been assigned to this message. + This either indicates that the message has not been sent yet + and hence has no cookie assigned, or that the message is not a + method response message and hence carries a reply cookie + field. + + + + + + Notes + + The sd_bus_message_get_cookie() and + sd_bus_message_get_reply_cookie() interfaces + are available as a shared library, which can be compiled and + linked to with the + libelogind pkg-config1 + file. + + + + See Also + + + elogind8, + sd-bus3, + sd_bus_new3 + + + + diff --git a/man/sd_bus_message_get_monotonic_usec.xml b/man/sd_bus_message_get_monotonic_usec.xml new file mode 100644 index 000000000..4fb50252a --- /dev/null +++ b/man/sd_bus_message_get_monotonic_usec.xml @@ -0,0 +1,181 @@ + + + + + + + + + sd_bus_message_get_monotonic_usec + elogind + + + + Developer + Lennart + Poettering + lennart@poettering.net + + + + + + sd_bus_message_get_monotonic_usec + 3 + + + + sd_bus_message_get_monotonic_usec + sd_bus_message_get_realtime_usec + sd_bus_message_get_seqnum + Retrieve the sender timestamps and sequence number of a message + + + + + #include <elogind/sd-bus.h> + + + int sd_bus_message_get_monotonic_usec + sd_bus_message *message + uint64_t *usec + + + + int sd_bus_message_get_realtime_usec + sd_bus_message *message + uint64_t *usec + + + + int sd_bus_message_get_seqnum + sd_bus_message *message + uint64_t *seqnum + + + + + + Description + + sd_bus_message_get_monotonic_usec() + returns the monotonic timestamp of the time the message was sent. + This value is in microseconds since the + CLOCK_MONOTONIC epoch, see + clock_gettime2 + for details. + + Similarly, + sd_bus_message_get_realtime_usec() returns + the realtime (wallclock) timestamp of the time the message was + sent. This value is in microseconds since Jan 1st, 1970, i.e. in + the CLOCK_REALTIME clock. + + sd_bus_message_get_seqnum() returns the + kernel-assigned sequence number of the message. The kernel assigns + a global, monotonically increasing sequence number to all messages + transmitted on the local system, at the time the message was sent. + This sequence number is useful for determining message send order, + even across different buses of the local system. The sequence + number combined with the boot ID of the system (as returned by + sd_id128_get_boot3) + is a suitable globally unique identifier for bus messages. + + Note that the sending order and receiving order of messages + might differ, in particular for broadcast messages. This means + that the sequence number and the timestamps of messages a client + reads are not necessarily monotonically increasing. + + These timestamps and the sequence number are attached to + each message by the kernel and cannot be manipulated by the + sender. + + Note that these timestamps are only available on some bus + transports, and only after support for them has been negotiated + with the + sd_bus_negotiate_timestamp3 + call. + + + + Return Value + + On success, these calls return 0 or a positive integer. On + failure, these calls return a negative errno-style error + code. + + On success, the timestamp or sequence number is returned in + the specified 64-bit unsigned integer variable. + + + + Errors + + Returned errors may indicate the following problems: + + + + -EINVAL + + A specified parameter is + invalid. + + + + -ENODATA + + No timestamp or sequence number information is + attached to the passed message. This error is returned if the + underlying transport does not support timestamping or + assigning of sequence numbers, or if this feature has not been + negotiated with + sd_bus_negotiate_timestamp3. + + + + + + Notes + + The + sd_bus_message_get_monotonic_usec(), + sd_bus_message_get_realtime_usec(), and + sd_bus_message_get_seqnum() interfaces are + available as a shared library, which can be compiled and linked to + with the + libelogind pkg-config1 + file. + + + + See Also + + + elogind8, + sd-bus3, + sd_bus_new3, + sd_bus_negotiate_timestamp3, + clock_gettime2, + sd_id128_get_boot3 + + + + diff --git a/man/sd_bus_negotiate_fds.xml b/man/sd_bus_negotiate_fds.xml index 61c972008..90404d2f2 100644 --- a/man/sd_bus_negotiate_fds.xml +++ b/man/sd_bus_negotiate_fds.xml @@ -3,29 +3,29 @@ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> sd_bus_negotiate_fds - systemd + elogind @@ -52,7 +52,7 @@ - #include <systemd/sd-bus.h> + #include <elogind/sd-bus.h> int sd_bus_negotiate_fds @@ -99,27 +99,41 @@ setting as negotiated by the program ultimately activated. By default, file descriptor passing is enabled for both. - sd_bus_negotiate_timestamp() controls whether implicit sender - timestamps shall be attached automatically to all incoming messages. Takes a bus object and a - boolean, which, when true, enables timestamping, and, when false, disables it. Use + sd_bus_negotiate_timestamps() controls + whether implicit sender timestamps shall be attached automatically + to all incoming messages. Takes a bus object and a boolean, which, + when true, enables timestamping, and, when false, disables it. + Use sd_bus_message_get_monotonic_usec3, sd_bus_message_get_realtime_usec3, sd_bus_message_get_seqnum3 - to query the timestamps of incoming messages. If negotiation is disabled or not supported, these - calls will fail with -ENODATA. Note that currently no transports support - timestamping of messages. By default, message timestamping is not negotiated for + to query the timestamps of incoming messages. If negotiation is + disabled or not supported, these calls will fail with + -ENODATA. Note that not all transports + support timestamping of messages. Specifically, timestamping is + only available on the kdbus transport, but not on dbus1. The + timestamping is applied by the kernel and cannot be manipulated by + userspace. By default, message timestamping is not negotiated for connections. - sd_bus_negotiate_creds() controls whether and which implicit sender - credentials shall be attached automatically to all incoming messages. Takes a bus object and a - boolean indicating whether to enable or disable the credential parts encoded in the bit mask - value argument. Note that not all transports support attaching sender credentials to messages, - or do not support all types of sender credential parameters, or might suppress them under - certain circumstances for individual messages. Specifically, dbus1 only supports - SD_BUS_CREDS_UNIQUE_NAME. The sender credentials are suitable for - authorization decisions. By default, only SD_BUS_CREDS_WELL_KNOWN_NAMES and - SD_BUS_CREDS_UNIQUE_NAME are enabled. In fact, these two credential fields - are always sent along and cannot be turned off. + sd_bus_negotiate_creds() controls + whether and which implicit sender credentials shall be attached + automatically to all incoming messages. Takes a bus object and a + boolean indicating whether to enable or disable the credential + parts encoded in the bit mask value argument. Note that not all + transports support attaching sender credentials to messages, or do + not support all types of sender credential parameters, or might + suppress them under certain circumstances for individual + messages. Specifically, implicit sender credentials on messages + are only fully supported on kdbus transports, and dbus1 only + supports SD_BUS_CREDS_UNIQUE_NAME. The sender + credentials are attached by the kernel and cannot be manipulated + by userspace, and are thus suitable for authorization + decisions. By default, only + SD_BUS_CREDS_WELL_KNOWN_NAMES and + SD_BUS_CREDS_UNIQUE_NAME are enabled. In + fact, these two credential fields are always sent along and cannot + be turned off. The sd_bus_negotiate_fds() function may be called only before the connection has been started with @@ -171,7 +185,7 @@ See Also - systemd1, + elogind8, sd-bus3, sd_bus_start3, sd_bus_message_can_send3, @@ -179,7 +193,7 @@ sd_bus_message_get_realtime_usec3, sd_bus_message_get_seqnum3, sd_bus_message_get_creds3, - systemd.busname5 + elogind.busname5 diff --git a/man/sd_bus_new.xml b/man/sd_bus_new.xml index 2eeba78e8..6be915ac9 100644 --- a/man/sd_bus_new.xml +++ b/man/sd_bus_new.xml @@ -3,29 +3,29 @@ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> sd_bus_new - systemd + elogind @@ -53,7 +53,7 @@ - #include <systemd/sd-bus.h> + #include <elogind/sd-bus.h> int sd_bus_new @@ -177,7 +177,7 @@ See Also - systemd1, + elogind8, sd-bus3, sd_bus_default_user3, sd_bus_default_system3, diff --git a/man/sd_bus_path_encode.xml b/man/sd_bus_path_encode.xml new file mode 100644 index 000000000..3fbb37cea --- /dev/null +++ b/man/sd_bus_path_encode.xml @@ -0,0 +1,188 @@ + + + + + + + + + sd_bus_path_encode + elogind + + + + A monkey with a typewriter + Zbigniew + Jędrzejewski-Szmek + zbyszek@in.waw.pl + + + + + + sd_bus_path_encode + 3 + + + + sd_bus_path_encode + sd_bus_path_encode_many + sd_bus_path_decode + sd_bus_path_decode_many + + Convert an external identifier into an object path and back + + + + + #include <elogind/sd-bus.h> + + + int sd_bus_path_encode + const char *prefix + const char *external_id + char **ret_path + + + + int sd_bus_path_encode_many + char **out + const char *path_template + ... + + + + int sd_bus_path_decode + const char *path + const char *prefix + char **ret_external_id + + + + int sd_bus_path_decode_many + const char *path + const char *path_template + ... + + + + + + Description + + sd_bus_path_encode() and + sd_bus_path_decode() convert external + identifier strings into object paths and back. These functions are + useful to map application-specific string identifiers of any kind + into bus object paths in a simple, reversible and safe way. + + sd_bus_path_encode() takes a bus path + prefix and an external identifier string as arguments, plus a + place to store the returned bus path string. The bus path prefix + must be a valid bus path, starting with a slash + /, and not ending in one. The external + identifier string may be in any format, may be the empty string, + and has no restrictions on the charset — however, it must + always be NUL-terminated. The returned string + will be the concatenation of the bus path prefix plus an escaped + version of the external identifier string. This operation may be + reversed with sd_bus_decode(). It is + recommended to only use external identifiers that generally + require little escaping to be turned into valid bus path + identifiers (for example, by sticking to a 7-bit ASCII character + set), in order to ensure the resulting bus path is still short and + easily processed. + + sd_bus_path_decode() reverses the + operation of sd_bus_path_encode() and thus + regenerates an external identifier string from a bus path. It + takes a bus path and a prefix string, plus a place to store the + returned external identifier string. If the bus path does not + start with the specified prefix, 0 is returned and the returned + string is set to NULL. Otherwise, the + string following the prefix is unescaped and returned in the + external identifier string. + + The escaping used will replace all characters which are + invalid in a bus object path by _, followed by a + hexadecimal value. As a special case, the empty string will be + replaced by a lone _. + + sd_bus_path_encode_many() works like + its counterpart sd_bus_path_encode(), but + takes a path template as argument and encodes multiple labels + according to its embedded directives. For each + % character found in the template, the caller + must provide a string via varargs, which will be encoded and + embedded at the position of the % character. + Any other character in the template is copied verbatim into the + encoded path. + + sd_bus_path_decode_many() does the + reverse of sd_bus_path_encode_many(). It + decodes the passed object path according to the given + path template. For each % character in the + template, the caller must provide an output storage + (char **) via varargs. The decoded label + will be stored there. Each % character will + only match the current label. It will never match across labels. + Furthermore, only a single directive is allowed per label. + If NULL is passed as output storage, the + label is verified but not returned to the caller. + + + + Return Value + + On success, sd_bus_path_encode() + returns positive or 0, and a valid bus path in the return + argument. On success, sd_bus_path_decode() + returns a positive value if the prefixed matched, or 0 if it + did not. If the prefix matched, the external identifier is returned + in the return parameter. If it did not match, NULL is returned in + the return parameter. On failure, a negative errno-style error + number is returned by either function. The returned strings must + be + free3'd + by the caller. + + + + Notes + + sd_bus_path_encode() and + sd_bus_path_decode() are available as a + shared library, which can be compiled and linked to with the + libelogind pkg-config1 + file. + + + + See Also + + + elogind8, + sd-bus3, + free3 + + + + diff --git a/man/sd_bus_request_name.xml b/man/sd_bus_request_name.xml index 520e6fb84..d627eded1 100644 --- a/man/sd_bus_request_name.xml +++ b/man/sd_bus_request_name.xml @@ -3,29 +3,29 @@ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> sd_bus_request_name - systemd + elogind @@ -50,7 +50,7 @@ - #include <systemd/sd-bus.h> + #include <elogind/sd-bus.h> int sd_bus_request_name @@ -204,7 +204,7 @@ See Also - systemd1, + elogind8, sd-bus3, sd_bus_new3 diff --git a/man/sd_event_add_child.xml b/man/sd_event_add_child.xml index 1e7cbf56e..9925cec33 100644 --- a/man/sd_event_add_child.xml +++ b/man/sd_event_add_child.xml @@ -3,29 +3,29 @@ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> sd_event_add_child - systemd + elogind @@ -52,7 +52,7 @@ - #include <systemd/sd-event.h> + #include <elogind/sd-event.h> typedef struct sd_event_source sd_event_source; @@ -227,7 +227,7 @@ See Also - systemd1, + elogind8, sd-event3, sd_event_new3, sd_event_now3, diff --git a/man/sd_event_add_defer.xml b/man/sd_event_add_defer.xml index f8ac3e40a..dd88b0982 100644 --- a/man/sd_event_add_defer.xml +++ b/man/sd_event_add_defer.xml @@ -3,29 +3,29 @@ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> sd_event_add_defer - systemd + elogind @@ -53,7 +53,7 @@ - #include <systemd/sd-event.h> + #include <elogind/sd-event.h> typedef struct sd_event_source sd_event_source; @@ -153,7 +153,7 @@ Return Value - On success, these functions return 0 or a positive + On success, this functions return 0 or a positive integer. On failure, they return a negative errno-style error code. @@ -197,7 +197,7 @@ See Also - systemd1, + elogind8, sd-event3, sd_event_new3, sd_event_now3, diff --git a/man/sd_event_add_signal.xml b/man/sd_event_add_signal.xml index 4c19ada01..dec185a97 100644 --- a/man/sd_event_add_signal.xml +++ b/man/sd_event_add_signal.xml @@ -3,29 +3,29 @@ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> sd_event_add_signal - systemd + elogind @@ -53,7 +53,7 @@ - #include <systemd/sd-event.h> + #include <elogind/sd-event.h> typedef struct sd_event_source sd_event_source; @@ -202,7 +202,7 @@ See Also - systemd1, + elogind8, sd-event3, sd_event_new3, sd_event_now3, diff --git a/man/sd_event_add_time.xml b/man/sd_event_add_time.xml index d5e2e9137..426dff1c5 100644 --- a/man/sd_event_add_time.xml +++ b/man/sd_event_add_time.xml @@ -3,29 +3,29 @@ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> sd_event_add_time - systemd + elogind @@ -56,7 +56,7 @@ - #include <systemd/sd-event.h> + #include <elogind/sd-event.h> typedef struct sd_event_source sd_event_source; @@ -123,7 +123,7 @@ regarding the various types of clocks. The usec parameter specifies the earliest time, in microseconds (µs), relative to the clock's epoch, when the timer shall be triggered. If a time already in the past is specified (including 0), this timer source "fires" immediately and is ready to be - dispatched. If the parameter is specified as UINT64_MAX the timer event will never elapse, + dispatched. If the paramater is specified as UINT64_MAX the timer event will never elapse, which may be used as an alternative to explicitly disabling a timer event source with sd_event_source_set_enabled3. The accuracy parameter specifies an additional accuracy value in µs specifying how much the @@ -213,7 +213,7 @@ in µs. sd_event_source_get_time_accuracy() - retrieves the configured accuracy value of an event source + retrieves the configured accuracy value of a event source created previously with sd_event_add_time(). It takes the event source object and a pointer to a variable to store the accuracy in. The accuracy is specified in µs. @@ -224,7 +224,7 @@ the event source object and accuracy, in µs. sd_event_source_get_time_clock() - retrieves the configured clock of an event source created + retrieves the configured clock of a event source created previously with sd_event_add_time(). It takes the event source object and a pointer to a variable to store the clock identifier in. @@ -292,7 +292,7 @@ See Also - systemd1, + elogind8, sd-event3, sd_event_new3, sd_event_now3, diff --git a/man/sd_event_get_fd.xml b/man/sd_event_get_fd.xml new file mode 100644 index 000000000..88671a2b9 --- /dev/null +++ b/man/sd_event_get_fd.xml @@ -0,0 +1,140 @@ + + + + + + + + + sd_event_get_fd + elogind + + + + More text + Zbigniew + Jędrzejewski-Szmek + zbyszek@in.waw.pl + + + + + + sd_event_get_fd + 3 + + + + sd_event_get_fd + + Obtain a file descriptor to poll for event loop events + + + + + #include <elogind/sd-event.h> + + + int sd_event_get_fd + sd_event *event + + + + + + + Description + + sd_event_get_fd() returns the file + descriptor that an event loop object returned by the + sd_event_new3 + function uses to wait for events. This file descriptor may itself + be polled for + POLLIN/EPOLLIN + events. This makes it possible to embed an + sd-event3 + event loop into another, possibly foreign, event loop. + + The returned file descriptor refers to an epoll7 + object. It is recommended not to alter it by invoking + epoll_ctl2 + on it, in order to avoid interference with the event loop's inner + logic and assumptions. + + + + Return Value + + On success, sd_event_get_fd() returns a + non-negative file descriptor. On failure, it returns a negative + errno-style error code. + + + + Errors + + Returned errors may indicate the following problems: + + + + -EINVAL + + event is not a valid + pointer to an sd_event structure. + + + + + -ECHILD + + The event loop has been created in a different process. + + + + + + + Examples + + + Integration in the GLib event loop + + + + + + + + + See Also + + + sd-event3, + sd_event_new3, + sd_event_wait3, + epoll_ctl3, + epoll7 + + + + diff --git a/man/sd_event_new.xml b/man/sd_event_new.xml index 12716d7de..40a686b14 100644 --- a/man/sd_event_new.xml +++ b/man/sd_event_new.xml @@ -3,29 +3,29 @@ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> sd_event_new - systemd + elogind @@ -56,7 +56,7 @@ - #include <systemd/sd-event.h> + #include <elogind/sd-event.h> typedef struct sd_event sd_event; @@ -183,9 +183,8 @@ Return Value - On success, sd_event_new(), - sd_event_default() and - sd_event_get_tid() return 0 or a positive + On success, sd_event_new() and + sd_event_default() return 0 or a positive integer. On failure, they return a negative errno-style error code. sd_event_ref() always returns a pointer to the event loop object passed @@ -229,7 +228,7 @@ See Also - systemd1, + elogind8, sd-event3, sd_event_add_io3, sd_event_add_time3, diff --git a/man/sd_event_run.xml b/man/sd_event_run.xml index 0f5bac584..d37febef4 100644 --- a/man/sd_event_run.xml +++ b/man/sd_event_run.xml @@ -3,29 +3,29 @@ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> sd_event_run - systemd + elogind @@ -51,7 +51,7 @@ - #include <systemd/sd-event.h> + #include <elogind/sd-event.h> int sd_event_run @@ -172,7 +172,7 @@ See Also - systemd1, + elogind8, sd_event_new3, sd_event_add_io3, sd_event_add_time3, diff --git a/man/sd_event_wait.xml b/man/sd_event_wait.xml index d53090cac..5d675ecea 100644 --- a/man/sd_event_wait.xml +++ b/man/sd_event_wait.xml @@ -3,29 +3,29 @@ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> sd_event_wait - systemd + elogind @@ -47,7 +47,6 @@ sd_event_prepare sd_event_dispatch sd_event_get_state - sd_event_get_iteration SD_EVENT_INITIAL SD_EVENT_PREPARING SD_EVENT_ARMED @@ -61,7 +60,7 @@ - #include <systemd/sd-event.h> + #include <elogind/sd-event.h> enum { SD_EVENT_INITIAL, @@ -94,12 +93,6 @@ sd_event *event - - int sd_event_get_iteration - sd_event *event - uint64_t *ret - - @@ -147,15 +140,12 @@ determine the state the event loop is currently in. It returns one of the states described below. - sd_event_get_iteration() may be used to determine the current iteration of the event - loop. It returns an unsigned 64bit integer containing a counter that increases monotonically with each iteration of - the event loop, starting with 0. The counter is increased at the time of the - sd_event_prepare() invocation. - - All five functions take, as the first argument, the event loop object event that has - been created with sd_event_new(). The timeout for sd_event_wait() is - specified in usec in microseconds. (uint64_t) -1 may be used to - specify an infinite timeout. + All four functions take, as the first argument, the event + loop object event that has been created + with sd_event_new(). The timeout for + sd_event_wait() is specified in + usec in milliseconds. (uint64_t) + -1 may be used to specify an infinite timeout. @@ -339,7 +329,7 @@ See Also - systemd1, + elogind8, sd_event_new3, sd_event_add_io3, sd_event_add_time3, diff --git a/man/sd_is_fifo.xml b/man/sd_is_fifo.xml index 0f4f274f6..3dac5a900 100644 --- a/man/sd_is_fifo.xml +++ b/man/sd_is_fifo.xml @@ -3,22 +3,22 @@ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> sd_is_fifo - systemd + elogind @@ -48,15 +48,13 @@ sd_is_socket sd_is_socket_inet sd_is_socket_unix - sd_is_socket_sockaddr - sd_is_mq sd_is_special Check the type of a file descriptor - #include <systemd/sd-daemon.h> + #include <elogind/sd-daemon.h> int sd_is_fifo @@ -81,15 +79,6 @@ uint16_t port - - int sd_is_socket_sockaddr - int fd - int type - const struct sockaddr *addr - unsigned addr_len - int listening - - int sd_is_socket_unix int fd @@ -99,12 +88,6 @@ size_t length - - int sd_is_mq - int fd - const char *path - - int sd_is_special int fd @@ -127,11 +110,11 @@ whether the specified file descriptor refers to a socket. If the family parameter is not AF_UNSPEC, it is checked whether the socket - is of the specified family (AF_UNIX, - AF_INET, …). If the type - parameter is not 0, it is checked whether the socket is of the - specified type (SOCK_STREAM, - SOCK_DGRAM, …). If the + is of the specified family (AF_UNIX, AF_INET, + ...). If the type parameter is not 0, it is + checked whether the socket is of the specified type + (SOCK_STREAM, + SOCK_DGRAM, ...). If the listening parameter is positive, it is checked whether the socket is in accepting mode, i.e. listen() has been called for it. If @@ -149,18 +132,6 @@ AF_UNSPEC, AF_INET, or AF_INET6. - sd_is_socket_sockaddr() is similar to - sd_is_socket_inet(), but checks if the socket is bound to the - address specified by addr. The - family specified by addr must be - either AF_INET or AF_INET6 and - addr_len must be large enough for that family. If - addr specifies a non-zero port, it is also checked if the - socket is bound to this port. In addition, for IPv6, if addr - specifies non-zero sin6_flowinfo or - sin6_scope_id, it is checked if the socket has the same - values. - sd_is_socket_unix() is similar to sd_is_socket() but optionally checks the AF_UNIX path the socket is bound to, unless @@ -173,12 +144,6 @@ path to the initial 0 byte of the socket address. - sd_is_mq() may be called to check - whether the specified file descriptor refers to a POSIX message - queue. If the path parameter is not - NULL, it is checked whether the message queue - is bound to the specified name. - sd_is_special() may be called to check whether the specified file descriptor refers to a special file. If the path parameter is not @@ -211,17 +176,7 @@ See Also - systemd1, - sd-daemon3, - sd_listen_fds3, - systemd.service5, - systemd.socket5, - ip7, - ipv67, - unix7, - fifo7, - mq_overview7, - socket7. + elogind8, diff --git a/man/sd_login_monitor_new.xml b/man/sd_login_monitor_new.xml index c6c58390a..0b5b474a5 100644 --- a/man/sd_login_monitor_new.xml +++ b/man/sd_login_monitor_new.xml @@ -3,29 +3,29 @@ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> sd_login_monitor_new - systemd + elogind @@ -56,7 +56,7 @@ - #include <systemd/sd-login.h> + #include <elogind/sd-login.h> int sd_login_monitor_new @@ -203,7 +203,7 @@ if (t == (uint64_t) -1) else { struct timespec ts; uint64_t n; - clock_gettime(CLOCK_MONOTONIC, &ts); + clock_getttime(CLOCK_MONOTONIC, &ts); n = (uint64_t) ts.tv_sec * 1000000 + ts.tv_nsec / 1000; msec = t > n ? (int) ((t - n + 999) / 1000) : 0; } @@ -276,7 +276,7 @@ else { See Also - systemd1, + elogind8, sd-login3, sd_get_seats3, poll2, diff --git a/man/sd_pid_get_session.xml b/man/sd_pid_get_session.xml index a4be941de..f85b413f0 100644 --- a/man/sd_pid_get_session.xml +++ b/man/sd_pid_get_session.xml @@ -3,29 +3,29 @@ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> sd_pid_get_session - systemd + elogind @@ -44,20 +44,12 @@ sd_pid_get_session - sd_pid_get_unit - sd_pid_get_user_unit sd_pid_get_owner_uid sd_pid_get_machine_name - sd_pid_get_slice - sd_pid_get_user_slice sd_pid_get_cgroup sd_peer_get_session - sd_peer_get_unit - sd_peer_get_user_unit sd_peer_get_owner_uid sd_peer_get_machine_name - sd_peer_get_slice - sd_peer_get_user_slice sd_peer_get_cgroup Determine session, unit, owner of a session, container/VM or slice of a specific PID or socket @@ -66,7 +58,7 @@ - #include <systemd/sd-login.h> + #include <elogind/sd-login.h> int sd_pid_get_session @@ -74,18 +66,6 @@ char **session - - int sd_pid_get_unit - pid_t pid - char **unit - - - - int sd_pid_get_user_unit - pid_t pid - char **unit - - int sd_pid_get_owner_uid pid_t pid @@ -98,18 +78,6 @@ char **name - - int sd_pid_get_slice - pid_t pid - char **slice - - - - int sd_pid_get_user_slice - pid_t pid - char **slice - - int sd_pid_get_cgroup pid_t pid @@ -122,18 +90,6 @@ char **session - - int sd_peer_get_unit - int fd - char **unit - - - - int sd_peer_get_user_unit - int fd - char **unit - - int sd_peer_get_owner_uid int fd @@ -146,18 +102,6 @@ char **name - - int sd_peer_get_slice - int fd - char **slice - - - - int sd_peer_get_user_slice - int fd - char **slice - - int sd_peer_get_cgroup int fd @@ -177,30 +121,11 @@ processes, user processes that are shared between multiple sessions of the same user, or kernel threads). For processes not being part of a login session, this function will fail with - -ENODATA. The returned string needs to be freed with the libc + -ENODATA. The returned string needs to be freed with the libc free3 call after use. - sd_pid_get_unit() may be used to - determine the systemd system unit (i.e. system service or scope - unit) identifier of a process identified by the specified PID. The - unit name is a short string, suitable for usage in file system - paths. Note that not all processes are part of a system - unit/service (e.g. user processes, or kernel threads). For - processes not being part of a systemd system unit, this function - will fail with -ENODATA. (More specifically, this call will not - work for kernel threads.) The returned string needs to be freed - with the libc free3 - call after use. - - sd_pid_get_user_unit() may be used to - determine the systemd user unit (i.e. user service or scope unit) - identifier of a process identified by the specified PID. This is - similar to sd_pid_get_unit(), but applies to - user units instead of system units. - sd_pid_get_owner_uid() may be used to determine the Unix UID (user identifier) of the owner of the session of a process identified the specified PID. Note that this @@ -208,7 +133,7 @@ multiple login sessions of the same user, whereas sd_pid_get_session() will fail. For processes not being part of a login session and not being a shared process - of a user, this function will fail with -ENODATA. + of a user, this function will fail with -ENODATA. sd_pid_get_machine_name() may be used to determine the name of the VM or container is a member of. The @@ -217,19 +142,7 @@ free3 call after use. For processes not part of a VM or containers, this - function fails with -ENODATA. - - sd_pid_get_slice() may be used to - determine the slice unit the process is a member of. See - systemd.slice5 - for details about slices. The returned string needs to be freed - with the libc - free3 - call after use. - - Similarly, sd_pid_get_user_slice() - returns the user slice (as managed by the user's systemd instance) - of a process. + function fails with -ENODATA. sd_pid_get_cgroup() returns the control group path of the specified process, relative to the root of the @@ -247,12 +160,8 @@ calling process. The sd_peer_get_session(), - sd_peer_get_unit(), - sd_peer_get_user_unit(), sd_peer_get_owner_uid(), - sd_peer_get_machine_name(), - sd_peer_get_slice(), - sd_peer_get_user_slice() and + sd_peer_get_machine_name() and sd_peer_get_cgroup() calls operate similar to their PID counterparts, but operate on a connected AF_UNIX socket and retrieve information about the connected peer process. Note @@ -285,7 +194,7 @@ - -EBADF + -BADF The specified socket file descriptor was invalid. @@ -318,19 +227,11 @@ Notes The sd_pid_get_session(), - sd_pid_get_unit(), - sd_pid_get_user_unit(), sd_pid_get_owner_uid(), sd_pid_get_machine_name(), - sd_pid_get_slice(), - sd_pid_get_user_slice(), sd_peer_get_session(), - sd_peer_get_unit(), - sd_peer_get_user_unit(), sd_peer_get_owner_uid(), sd_peer_get_machine_name(), - sd_peer_get_slice() and - sd_peer_get_user_slice() interfaces are available as a shared library, which can be compiled and linked to with the libelogind pkg-config1 @@ -347,12 +248,12 @@ See Also - systemd1, + elogind8, sd-login3, sd_session_is_active3, getsid2, - systemd.slice5, - systemd-machined.service8 + elogind.slice5, + elogind-machined.service8 diff --git a/man/sd_uid_get_state.xml b/man/sd_uid_get_state.xml index eb20c4494..20aa92b96 100644 --- a/man/sd_uid_get_state.xml +++ b/man/sd_uid_get_state.xml @@ -3,29 +3,29 @@ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> sd_uid_get_state - systemd + elogind @@ -53,7 +53,7 @@ - #include <systemd/sd-login.h> + #include <elogind/sd-login.h> int sd_uid_get_state @@ -217,11 +217,24 @@ entry. + + History + + sd_uid_get_state(), + sd_uid_is_on_seat(), + sd_uid_get_sessions(), and + sd_uid_get_seats() functions were added in + elogind-31. + + sd_uid_get_display() was added in + elogind-213. + + See Also - systemd1, + elogind8, sd-login3, sd_pid_get_owner_uid3 diff --git a/src/basic/memfd-util.c b/src/basic/memfd-util.c index e857c040d..2ecec8c90 100644 --- a/src/basic/memfd-util.c +++ b/src/basic/memfd-util.c @@ -123,6 +123,7 @@ int memfd_get_sealed(int fd) { return r == (F_SEAL_SHRINK | F_SEAL_GROW | F_SEAL_WRITE | F_SEAL_SEAL); } +#endif // 0 int memfd_get_size(int fd, uint64_t *sz) { struct stat stat; @@ -138,7 +139,6 @@ int memfd_get_size(int fd, uint64_t *sz) { *sz = stat.st_size; return 0; } -#endif // 0 int memfd_set_size(int fd, uint64_t sz) { int r; diff --git a/src/basic/memfd-util.h b/src/basic/memfd-util.h index 6b828520e..781d1a431 100644 --- a/src/basic/memfd-util.h +++ b/src/basic/memfd-util.h @@ -34,7 +34,7 @@ int memfd_map(int fd, uint64_t offset, size_t size, void **p); int memfd_set_sealed(int fd); #if 0 /// UNNEEDED by elogind int memfd_get_sealed(int fd); +#endif // 0 int memfd_get_size(int fd, uint64_t *sz); -#endif // 0 int memfd_set_size(int fd, uint64_t sz); diff --git a/src/basic/siphash24.c b/src/basic/siphash24.c index 4bb41786c..e8b18dd16 100644 --- a/src/basic/siphash24.c +++ b/src/basic/siphash24.c @@ -68,6 +68,12 @@ void siphash24_init(struct siphash *state, const uint8_t k[16]) { }; } +#if 1 /// let's add a diagnostic push to silence -Wimplicit-fallthrough to elogind +# ifdef __GNUC__ +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wimplicit-fallthrough" +# endif // __GNUC__ +#endif // 1 void siphash24_compress(const void *_in, size_t inlen, struct siphash *state) { const uint8_t *in = _in; @@ -150,6 +156,11 @@ void siphash24_compress(const void *_in, size_t inlen, struct siphash *state) { break; } } +#if 1 /// end diagnostic push in elogind +# ifdef __GNUC__ +# pragma GCC diagnostic pop +# endif // __GNUC__ +#endif // 1 uint64_t siphash24_finalize(struct siphash *state) { uint64_t b; diff --git a/src/basic/socket-util.h b/src/basic/socket-util.h index db3a73197..ad1924474 100644 --- a/src/basic/socket-util.h +++ b/src/basic/socket-util.h @@ -34,12 +34,10 @@ union sockaddr_union { struct sockaddr sa; -#if 0 /// UNNEEDED by elogind, only 'sa' and 'un' are used in all of elogind. struct sockaddr_in in; struct sockaddr_in6 in6; -#endif // 0 struct sockaddr_un un; -#if 0 /// UNNEEDED by elogind, only 'sa' and 'un' are used in all of elogind. +#if 0 /// UNNEEDED by elogind, only 'sa', 'in', 'in6' and 'un' are used in all of elogind. struct sockaddr_nl nl; struct sockaddr_storage storage; struct sockaddr_ll ll; diff --git a/src/libelogind/libelogind.sym b/src/libelogind/libelogind.sym index 55f6a80bd..dbd8a320b 100644 --- a/src/libelogind/libelogind.sym +++ b/src/libelogind/libelogind.sym @@ -65,15 +65,15 @@ global: /* sd-daemon */ sd_booted; - /* sd_is_fifo; */ + sd_is_fifo; /* sd_is_mq; */ sd_is_socket; - /* sd_is_socket_inet; */ - /* sd_is_socket_unix; */ - /* sd_is_special; */ + sd_is_socket_inet; + sd_is_socket_unix; + sd_is_special; /* sd_listen_fds; */ sd_notify; - /* sd_notifyf; */ + sd_notifyf; sd_watchdog_enabled; /* sd-id128 */ @@ -142,19 +142,16 @@ global: sd_uid_get_display; } LIBSYSTEMD_211; -/* - * These methods are not needed by elogind. - * LIBSYSTEMD_214 { - * global: - * sd_pid_notify; - * sd_pid_notifyf; - * } LIBSYSTEMD_213; - */ +LIBSYSTEMD_214 { +global: + sd_pid_notify; + sd_pid_notifyf; +} LIBSYSTEMD_213; LIBSYSTEMD_216 { global: sd_machine_get_ifindices; -} LIBSYSTEMD_213; +} LIBSYSTEMD_214; LIBSYSTEMD_217 { global: @@ -186,88 +183,88 @@ global: sd_bus_new; sd_bus_set_address; sd_bus_set_fd; - /* sd_bus_set_exec; */ - /* sd_bus_get_address; */ + sd_bus_set_exec; + sd_bus_get_address; sd_bus_set_bus_client; - /* sd_bus_is_bus_client; */ + sd_bus_is_bus_client; sd_bus_set_server; - /* sd_bus_is_server; */ + sd_bus_is_server; sd_bus_set_anonymous; - /* sd_bus_is_anonymous; */ - /* sd_bus_set_trusted; */ - /* sd_bus_is_trusted; */ - /* sd_bus_set_monitor; */ - /* sd_bus_is_monitor; */ - /* sd_bus_set_description; */ - /* sd_bus_get_description; */ - /* sd_bus_negotiate_creds; */ - /* sd_bus_negotiate_timestamp; */ + sd_bus_is_anonymous; + sd_bus_set_trusted; + sd_bus_is_trusted; + sd_bus_set_monitor; + sd_bus_is_monitor; + sd_bus_set_description; + sd_bus_get_description; + sd_bus_negotiate_creds; + sd_bus_negotiate_timestamp; sd_bus_negotiate_fds; sd_bus_can_send; - /* sd_bus_get_creds_mask; */ + sd_bus_get_creds_mask; sd_bus_set_allow_interactive_authorization; - /* sd_bus_get_allow_interactive_authorization; */ + sd_bus_get_allow_interactive_authorization; sd_bus_start; sd_bus_close; - /* sd_bus_try_close; */ + sd_bus_try_close; sd_bus_ref; sd_bus_unref; - /* sd_bus_is_open; */ - /* sd_bus_get_bus_id; */ - /* sd_bus_get_scope; */ - /* sd_bus_get_tid; */ + sd_bus_is_open; + sd_bus_get_bus_id; + sd_bus_get_scope; + sd_bus_get_tid; sd_bus_get_owner_creds; sd_bus_send; - /* sd_bus_send_to; */ + sd_bus_send_to; sd_bus_call; sd_bus_call_async; - /* sd_bus_get_fd; */ + sd_bus_get_fd; sd_bus_get_events; sd_bus_get_timeout; sd_bus_process; - /* sd_bus_process_priority; */ + sd_bus_process_priority; sd_bus_wait; sd_bus_flush; - /* sd_bus_get_current_slot; */ + sd_bus_get_current_slot; sd_bus_get_current_message; sd_bus_get_current_handler; sd_bus_get_current_userdata; sd_bus_attach_event; sd_bus_detach_event; sd_bus_get_event; - /* sd_bus_add_filter; */ + sd_bus_add_filter; sd_bus_add_match; sd_bus_add_object; sd_bus_add_fallback; sd_bus_add_object_vtable; sd_bus_add_fallback_vtable; sd_bus_add_node_enumerator; - /* sd_bus_add_object_manager; */ + sd_bus_add_object_manager; sd_bus_slot_ref; sd_bus_slot_unref; - /* sd_bus_slot_get_bus; */ - /* sd_bus_slot_get_userdata; */ - /* sd_bus_slot_set_userdata; */ - /* sd_bus_slot_get_description; */ - /* sd_bus_slot_set_description; */ - /* sd_bus_slot_get_current_message; */ - /* sd_bus_slot_get_current_handler; */ - /* sd_bus_slot_get_current_userdata; */ + sd_bus_slot_get_bus; + sd_bus_slot_get_userdata; + sd_bus_slot_set_userdata; + sd_bus_slot_get_description; + sd_bus_slot_set_description; + sd_bus_slot_get_current_message; + sd_bus_slot_get_current_handler; + sd_bus_slot_get_current_userdata; sd_bus_message_new_signal; sd_bus_message_new_method_call; sd_bus_message_new_method_return; sd_bus_message_new_method_error; sd_bus_message_new_method_errorf; sd_bus_message_new_method_errno; - /* sd_bus_message_new_method_errnof; */ + sd_bus_message_new_method_errnof; sd_bus_message_ref; sd_bus_message_unref; - /* sd_bus_message_get_type; */ - /* sd_bus_message_get_cookie; */ - /* sd_bus_message_get_reply_cookie; */ - /* sd_bus_message_get_priority; */ - /* sd_bus_message_get_expect_reply; */ - /* sd_bus_message_get_auto_start; */ + sd_bus_message_get_type; + sd_bus_message_get_cookie; + sd_bus_message_get_reply_cookie; + sd_bus_message_get_priority; + sd_bus_message_get_expect_reply; + sd_bus_message_get_auto_start; sd_bus_message_get_allow_interactive_authorization; sd_bus_message_get_signature; sd_bus_message_get_path; @@ -277,30 +274,30 @@ global: sd_bus_message_get_sender; sd_bus_message_get_error; sd_bus_message_get_errno; - /* sd_bus_message_get_monotonic_usec; */ - /* sd_bus_message_get_realtime_usec; */ - /* sd_bus_message_get_seqnum; */ + sd_bus_message_get_monotonic_usec; + sd_bus_message_get_realtime_usec; + sd_bus_message_get_seqnum; sd_bus_message_get_bus; sd_bus_message_get_creds; sd_bus_message_is_signal; sd_bus_message_is_method_call; sd_bus_message_is_method_error; - /* sd_bus_message_is_empty; */ - /* sd_bus_message_has_signature; */ - /* sd_bus_message_set_expect_reply; */ - /* sd_bus_message_set_auto_start; */ - /* sd_bus_message_set_allow_interactive_authorization; */ + sd_bus_message_is_empty; + sd_bus_message_has_signature; + sd_bus_message_set_expect_reply; + sd_bus_message_set_auto_start; + sd_bus_message_set_allow_interactive_authorization; sd_bus_message_set_destination; - /* sd_bus_message_set_priority; */ + sd_bus_message_set_priority; sd_bus_message_append; sd_bus_message_append_basic; - /* sd_bus_message_append_array; */ + sd_bus_message_append_array; sd_bus_message_append_array_space; - /* sd_bus_message_append_array_iovec; */ - /* sd_bus_message_append_array_memfd; */ - /* sd_bus_message_append_string_space; */ - /* sd_bus_message_append_string_iovec; */ - /* sd_bus_message_append_string_memfd; */ + sd_bus_message_append_array_iovec; + sd_bus_message_append_array_memfd; + sd_bus_message_append_string_space; + sd_bus_message_append_string_iovec; + sd_bus_message_append_string_memfd; sd_bus_message_append_strv; sd_bus_message_open_container; sd_bus_message_close_container; @@ -313,27 +310,27 @@ global: sd_bus_message_enter_container; sd_bus_message_exit_container; sd_bus_message_peek_type; - /* sd_bus_message_verify_type; */ - /* sd_bus_message_at_end; */ + sd_bus_message_verify_type; + sd_bus_message_at_end; sd_bus_message_rewind; sd_bus_get_unique_name; sd_bus_request_name; sd_bus_release_name; sd_bus_list_names; sd_bus_get_name_creds; - /* sd_bus_get_name_machine_id; */ + sd_bus_get_name_machine_id; sd_bus_call_method; - /* sd_bus_call_method_async; */ + sd_bus_call_method_async; sd_bus_get_property; sd_bus_get_property_trivial; sd_bus_get_property_string; - /* sd_bus_get_property_strv; */ - /* sd_bus_set_property; */ + sd_bus_get_property_strv; + sd_bus_set_property; sd_bus_reply_method_return; sd_bus_reply_method_error; sd_bus_reply_method_errorf; sd_bus_reply_method_errno; - /* sd_bus_reply_method_errnof; */ + sd_bus_reply_method_errnof; sd_bus_emit_signal; sd_bus_emit_properties_changed_strv; sd_bus_emit_properties_changed; @@ -343,28 +340,28 @@ global: sd_bus_emit_interfaces_removed; sd_bus_query_sender_creds; sd_bus_query_sender_privilege; - /* sd_bus_creds_new_from_pid; */ + sd_bus_creds_new_from_pid; sd_bus_creds_ref; sd_bus_creds_unref; - /* sd_bus_creds_get_mask; */ + sd_bus_creds_get_mask; sd_bus_creds_get_augmented_mask; sd_bus_creds_get_pid; - /* sd_bus_creds_get_ppid; */ + sd_bus_creds_get_ppid; sd_bus_creds_get_tid; sd_bus_creds_get_uid; sd_bus_creds_get_euid; - /* sd_bus_creds_get_suid; */ - /* sd_bus_creds_get_fsuid; */ - /* sd_bus_creds_get_gid; */ + sd_bus_creds_get_suid; + sd_bus_creds_get_fsuid; + sd_bus_creds_get_gid; sd_bus_creds_get_egid; - /* sd_bus_creds_get_sgid; */ - /* sd_bus_creds_get_fsgid; */ - /* sd_bus_creds_get_supplementary_gids; */ - /* sd_bus_creds_get_comm; */ - /* sd_bus_creds_get_tid_comm; */ - /* sd_bus_creds_get_exe; */ + sd_bus_creds_get_sgid; + sd_bus_creds_get_fsgid; + sd_bus_creds_get_supplementary_gids; + sd_bus_creds_get_comm; + sd_bus_creds_get_tid_comm; + sd_bus_creds_get_exe; sd_bus_creds_get_cmdline; - /* sd_bus_creds_get_cgroup; */ + sd_bus_creds_get_cgroup; /* sd_bus_creds_get_unit; */ /* sd_bus_creds_get_slice; */ /* sd_bus_creds_get_user_unit; */ @@ -372,16 +369,16 @@ global: sd_bus_creds_get_session; sd_bus_creds_get_owner_uid; sd_bus_creds_has_effective_cap; - /* sd_bus_creds_has_permitted_cap; */ - /* sd_bus_creds_has_inheritable_cap; */ - /* sd_bus_creds_has_bounding_cap; */ + sd_bus_creds_has_permitted_cap; + sd_bus_creds_has_inheritable_cap; + sd_bus_creds_has_bounding_cap; sd_bus_creds_get_selinux_context; - /* sd_bus_creds_get_audit_session_id; */ + sd_bus_creds_get_audit_session_id; sd_bus_creds_get_audit_login_uid; sd_bus_creds_get_tty; - /* sd_bus_creds_get_unique_name; */ - /* sd_bus_creds_get_well_known_names; */ - /* sd_bus_creds_get_description; */ + sd_bus_creds_get_unique_name; + sd_bus_creds_get_well_known_names; + sd_bus_creds_get_description; sd_bus_error_free; sd_bus_error_set; sd_bus_error_setf; @@ -394,14 +391,14 @@ global: sd_bus_error_is_set; sd_bus_error_has_name; sd_bus_error_add_map; - /* sd_bus_path_encode; */ - /* sd_bus_path_decode; */ + sd_bus_path_encode; + sd_bus_path_decode; sd_bus_track_new; sd_bus_track_ref; sd_bus_track_unref; sd_bus_track_get_bus; - /* sd_bus_track_get_userdata; */ - /* sd_bus_track_set_userdata; */ + sd_bus_track_get_userdata; + sd_bus_track_set_userdata; sd_bus_track_add_sender; sd_bus_track_remove_sender; sd_bus_track_add_name; @@ -430,44 +427,44 @@ global: sd_event_loop; sd_event_exit; sd_event_now; - /* sd_event_get_fd; */ + sd_event_get_fd; sd_event_get_state; - /* sd_event_get_tid; */ - /* sd_event_get_exit_code; */ + sd_event_get_tid; + sd_event_get_exit_code; sd_event_set_watchdog; - /* sd_event_get_watchdog; */ - /* sd_event_source_ref; */ + sd_event_get_watchdog; + sd_event_source_ref; sd_event_source_unref; sd_event_source_get_event; - /* sd_event_source_get_userdata; */ - /* sd_event_source_set_userdata; */ + sd_event_source_get_userdata; + sd_event_source_set_userdata; sd_event_source_set_description; - /* sd_event_source_get_description; */ + sd_event_source_get_description; sd_event_source_set_prepare; - /* sd_event_source_get_pending; */ + sd_event_source_get_pending; sd_event_source_get_priority; sd_event_source_set_priority; - /* sd_event_source_get_enabled; */ + sd_event_source_get_enabled; sd_event_source_set_enabled; - /* sd_event_source_get_io_fd; */ + sd_event_source_get_io_fd; sd_event_source_set_io_fd; - /* sd_event_source_get_io_events; */ + sd_event_source_get_io_events; sd_event_source_set_io_events; - /* sd_event_source_get_io_revents; */ + sd_event_source_get_io_revents; sd_event_source_get_time; sd_event_source_set_time; - /* sd_event_source_set_time_accuracy; */ - /* sd_event_source_get_time_accuracy; */ - /* sd_event_source_get_time_clock; */ - /* sd_event_source_get_signal; */ - /* sd_event_source_get_child_pid; */ + sd_event_source_set_time_accuracy; + sd_event_source_get_time_accuracy; + sd_event_source_get_time_clock; + sd_event_source_get_signal; + sd_event_source_get_child_pid; } LIBSYSTEMD_220; LIBSYSTEMD_222 { global: /* sd-bus */ sd_bus_emit_object_added; - /* sd_bus_emit_object_removed; */ + sd_bus_emit_object_removed; sd_bus_flush_close_unref; } LIBSYSTEMD_221; @@ -479,10 +476,10 @@ global: LIBSYSTEMD_227 { global: - /* sd_bus_default_flush_close; */ - /* sd_bus_path_decode_many; */ - /* sd_bus_path_encode_many; */ - sd_listen_fds_with_names; + sd_bus_default_flush_close; + sd_bus_path_decode_many; + sd_bus_path_encode_many; + /* sd_listen_fds_with_names; */ } LIBSYSTEMD_226; /* @@ -512,12 +509,12 @@ global: LIBSYSTEMD_232 { global: - /* sd_bus_track_set_recursive; */ - /* sd_bus_track_get_recursive; */ - /* sd_bus_track_count_name; */ - /* sd_bus_track_count_sender; */ + sd_bus_track_set_recursive; + sd_bus_track_get_recursive; + sd_bus_track_count_name; + sd_bus_track_count_sender; sd_bus_set_exit_on_disconnect; - /* sd_bus_get_exit_on_disconnect; */ + sd_bus_get_exit_on_disconnect; sd_id128_get_invocation; } LIBSYSTEMD_231; diff --git a/src/libelogind/sd-bus/bus-control.c b/src/libelogind/sd-bus/bus-control.c index 313a44b53..b56bb0771 100644 --- a/src/libelogind/sd-bus/bus-control.c +++ b/src/libelogind/sd-bus/bus-control.c @@ -1678,7 +1678,6 @@ int bus_remove_match_internal( return bus_remove_match_internal_dbus1(bus, match); } -#if 0 /// UNNEEDED by elogind _public_ int sd_bus_get_name_machine_id(sd_bus *bus, const char *name, sd_id128_t *machine) { _cleanup_(sd_bus_message_unrefp) sd_bus_message *reply = NULL, *m = NULL; const char *mid; @@ -1723,4 +1722,3 @@ _public_ int sd_bus_get_name_machine_id(sd_bus *bus, const char *name, sd_id128_ return sd_id128_from_string(mid, machine); } -#endif // 0 diff --git a/src/libelogind/sd-bus/bus-convenience.c b/src/libelogind/sd-bus/bus-convenience.c index 1eb726462..04158cae4 100644 --- a/src/libelogind/sd-bus/bus-convenience.c +++ b/src/libelogind/sd-bus/bus-convenience.c @@ -57,7 +57,6 @@ _public_ int sd_bus_emit_signal( return sd_bus_send(bus, m, NULL); } -#if 0 /// UNNEEDED by elogind _public_ int sd_bus_call_method_async( sd_bus *bus, sd_bus_slot **slot, @@ -94,7 +93,6 @@ _public_ int sd_bus_call_method_async( return sd_bus_call_async(bus, slot, m, callback, userdata, 0); } -#endif // 0 _public_ int sd_bus_call_method( sd_bus *bus, @@ -255,7 +253,6 @@ _public_ int sd_bus_reply_method_errno( return sd_bus_reply_method_error(call, &berror); } -#if 0 /// UNNEEDED by elogind _public_ int sd_bus_reply_method_errnof( sd_bus_message *call, int error, @@ -283,7 +280,6 @@ _public_ int sd_bus_reply_method_errnof( return sd_bus_reply_method_error(call, &berror); } -#endif // 0 _public_ int sd_bus_get_property( sd_bus *bus, @@ -419,7 +415,6 @@ fail: return sd_bus_error_set_errno(error, r); } -#if 0 /// UNNEEDED by elogind _public_ int sd_bus_get_property_strv( sd_bus *bus, const char *destination, @@ -512,7 +507,6 @@ _public_ int sd_bus_set_property( fail: return sd_bus_error_set_errno(error, r); } -#endif // 0 _public_ int sd_bus_query_sender_creds(sd_bus_message *call, uint64_t mask, sd_bus_creds **creds) { sd_bus_creds *c; diff --git a/src/libelogind/sd-bus/bus-creds.c b/src/libelogind/sd-bus/bus-creds.c index 3cb996171..d52bbff84 100644 --- a/src/libelogind/sd-bus/bus-creds.c +++ b/src/libelogind/sd-bus/bus-creds.c @@ -132,13 +132,11 @@ _public_ sd_bus_creds *sd_bus_creds_unref(sd_bus_creds *c) { return NULL; } -#if 0 /// UNNEEDED by elogind _public_ uint64_t sd_bus_creds_get_mask(const sd_bus_creds *c) { assert_return(c, 0); return c->mask; } -#endif // 0 _public_ uint64_t sd_bus_creds_get_augmented_mask(const sd_bus_creds *c) { assert_return(c, 0); @@ -158,7 +156,6 @@ sd_bus_creds* bus_creds_new(void) { return c; } -#if 0 /// UNNEEDED by elogind _public_ int sd_bus_creds_new_from_pid(sd_bus_creds **ret, pid_t pid, uint64_t mask) { sd_bus_creds *c; int r; @@ -190,7 +187,6 @@ _public_ int sd_bus_creds_new_from_pid(sd_bus_creds **ret, pid_t pid, uint64_t m *ret = c; return 0; } -#endif // 0 _public_ int sd_bus_creds_get_uid(sd_bus_creds *c, uid_t *uid) { assert_return(c, -EINVAL); @@ -214,7 +210,6 @@ _public_ int sd_bus_creds_get_euid(sd_bus_creds *c, uid_t *euid) { return 0; } -#if 0 /// UNNEEDED by elogind _public_ int sd_bus_creds_get_suid(sd_bus_creds *c, uid_t *suid) { assert_return(c, -EINVAL); assert_return(suid, -EINVAL); @@ -248,7 +243,6 @@ _public_ int sd_bus_creds_get_gid(sd_bus_creds *c, gid_t *gid) { *gid = c->gid; return 0; } -#endif // 0 _public_ int sd_bus_creds_get_egid(sd_bus_creds *c, gid_t *egid) { assert_return(c, -EINVAL); @@ -261,7 +255,6 @@ _public_ int sd_bus_creds_get_egid(sd_bus_creds *c, gid_t *egid) { return 0; } -#if 0 /// UNNEEDED by elogind _public_ int sd_bus_creds_get_sgid(sd_bus_creds *c, gid_t *sgid) { assert_return(c, -EINVAL); assert_return(sgid, -EINVAL); @@ -294,7 +287,6 @@ _public_ int sd_bus_creds_get_supplementary_gids(sd_bus_creds *c, const gid_t ** *gids = c->supplementary_gids; return (int) c->n_supplementary_gids; } -#endif // 0 _public_ int sd_bus_creds_get_pid(sd_bus_creds *c, pid_t *pid) { assert_return(c, -EINVAL); @@ -308,7 +300,6 @@ _public_ int sd_bus_creds_get_pid(sd_bus_creds *c, pid_t *pid) { return 0; } -#if 0 /// UNNEEDED by elogind _public_ int sd_bus_creds_get_ppid(sd_bus_creds *c, pid_t *ppid) { assert_return(c, -EINVAL); assert_return(ppid, -EINVAL); @@ -325,7 +316,6 @@ _public_ int sd_bus_creds_get_ppid(sd_bus_creds *c, pid_t *ppid) { *ppid = c->ppid; return 0; } -#endif // 0 _public_ int sd_bus_creds_get_tid(sd_bus_creds *c, pid_t *tid) { assert_return(c, -EINVAL); @@ -350,7 +340,6 @@ _public_ int sd_bus_creds_get_selinux_context(sd_bus_creds *c, const char **ret) return 0; } -#if 0 /// UNNEEDED by elogind _public_ int sd_bus_creds_get_comm(sd_bus_creds *c, const char **ret) { assert_return(c, -EINVAL); assert_return(ret, -EINVAL); @@ -401,6 +390,7 @@ _public_ int sd_bus_creds_get_cgroup(sd_bus_creds *c, const char **ret) { return 0; } +#if 0 /// UNNEEDED by elogind _public_ int sd_bus_creds_get_unit(sd_bus_creds *c, const char **ret) { int r; @@ -625,7 +615,6 @@ _public_ int sd_bus_creds_get_tty(sd_bus_creds *c, const char **ret) { return 0; } -#if 0 /// UNNEEDED by elogind _public_ int sd_bus_creds_get_unique_name(sd_bus_creds *c, const char **unique_name) { assert_return(c, -EINVAL); assert_return(unique_name, -EINVAL); @@ -688,7 +677,6 @@ _public_ int sd_bus_creds_get_description(sd_bus_creds *c, const char **ret) { *ret = c->unescaped_description; return 0; } -#endif // 0 static int has_cap(sd_bus_creds *c, unsigned offset, int capability) { size_t sz; @@ -715,7 +703,6 @@ _public_ int sd_bus_creds_has_effective_cap(sd_bus_creds *c, int capability) { return has_cap(c, CAP_OFFSET_EFFECTIVE, capability); } -#if 0 /// UNNEEDED by elogind _public_ int sd_bus_creds_has_permitted_cap(sd_bus_creds *c, int capability) { assert_return(c, -EINVAL); assert_return(capability >= 0, -EINVAL); @@ -745,7 +732,6 @@ _public_ int sd_bus_creds_has_bounding_cap(sd_bus_creds *c, int capability) { return has_cap(c, CAP_OFFSET_BOUNDING, capability); } -#endif // 0 static int parse_caps(sd_bus_creds *c, unsigned offset, const char *p) { size_t sz, max; diff --git a/src/libelogind/sd-bus/bus-message.c b/src/libelogind/sd-bus/bus-message.c index cbe9c6259..a9853e326 100644 --- a/src/libelogind/sd-bus/bus-message.c +++ b/src/libelogind/sd-bus/bus-message.c @@ -829,7 +829,6 @@ _public_ int sd_bus_message_new_method_errno( return sd_bus_message_new_method_error(call, m, &berror); } -#if 0 /// UNNEEDED by elogind _public_ int sd_bus_message_new_method_errnof( sd_bus_message *call, sd_bus_message **m, @@ -846,7 +845,6 @@ _public_ int sd_bus_message_new_method_errnof( return sd_bus_message_new_method_error(call, m, &berror); } -#endif // 0 void bus_message_set_sender_local(sd_bus *bus, sd_bus_message *m) { assert(bus); @@ -944,7 +942,6 @@ _public_ sd_bus_message* sd_bus_message_unref(sd_bus_message *m) { return NULL; } -#if 0 /// UNNEEDED by elogind _public_ int sd_bus_message_get_type(sd_bus_message *m, uint8_t *type) { assert_return(m, -EINVAL); assert_return(type, -EINVAL); @@ -990,7 +987,6 @@ _public_ int sd_bus_message_get_auto_start(sd_bus_message *m) { return !(m->header->flags & BUS_MESSAGE_NO_AUTO_START); } -#endif // 0 _public_ int sd_bus_message_get_allow_interactive_authorization(sd_bus_message *m) { assert_return(m, -EINVAL); @@ -1038,7 +1034,6 @@ _public_ const sd_bus_error *sd_bus_message_get_error(sd_bus_message *m) { return &m->error; } -#if 0 /// UNNEEDED by elogind _public_ int sd_bus_message_get_monotonic_usec(sd_bus_message *m, uint64_t *usec) { assert_return(m, -EINVAL); assert_return(usec, -EINVAL); @@ -1071,7 +1066,6 @@ _public_ int sd_bus_message_get_seqnum(sd_bus_message *m, uint64_t *seqnum) { *seqnum = m->seqnum; return 0; } -#endif // 0 _public_ sd_bus_creds *sd_bus_message_get_creds(sd_bus_message *m) { assert_return(m, NULL); @@ -1132,7 +1126,6 @@ _public_ int sd_bus_message_is_method_error(sd_bus_message *m, const char *name) return 1; } -#if 0 /// UNNEEDED by elogind _public_ int sd_bus_message_set_expect_reply(sd_bus_message *m, int b) { assert_return(m, -EINVAL); assert_return(!m->sealed, -EPERM); @@ -1160,7 +1153,6 @@ _public_ int sd_bus_message_set_allow_interactive_authorization(sd_bus_message * return 0; } -#endif // 0 static struct bus_container *message_get_container(sd_bus_message *m) { assert(m); @@ -1655,7 +1647,6 @@ _public_ int sd_bus_message_append_basic(sd_bus_message *m, char type, const voi return message_append_basic(m, type, p, NULL); } -#if 0 /// UNNEEDED by elogind _public_ int sd_bus_message_append_string_space( sd_bus_message *m, size_t size, @@ -1746,7 +1737,6 @@ _public_ int sd_bus_message_append_string_iovec( return 0; } -#endif // 0 static int bus_message_open_array( sd_bus_message *m, @@ -2614,7 +2604,6 @@ _public_ int sd_bus_message_append_array_space( return 0; } -#if 0 /// UNNEEDED by elogind _public_ int sd_bus_message_append_array( sd_bus_message *m, char type, @@ -2848,7 +2837,6 @@ _public_ int sd_bus_message_append_string_memfd( return 0; } -#endif // 0 _public_ int sd_bus_message_append_strv(sd_bus_message *m, char **l) { char **i; @@ -3149,7 +3137,6 @@ static bool message_end_of_array(sd_bus_message *m, size_t index) { } } -#if 0 /// UNNEEDED by elogind _public_ int sd_bus_message_at_end(sd_bus_message *m, int complete) { assert_return(m, -EINVAL); assert_return(m->sealed, -EPERM); @@ -3165,7 +3152,6 @@ _public_ int sd_bus_message_at_end(sd_bus_message *m, int complete) { return false; } -#endif // 0 static struct bus_body_part* find_part(sd_bus_message *m, size_t index, size_t sz, void **p) { struct bus_body_part *part; @@ -5721,7 +5707,6 @@ _public_ const char* sd_bus_message_get_signature(sd_bus_message *m, int complet return strempty(c->signature); } -#if 0 /// UNNEEDED by elogind _public_ int sd_bus_message_is_empty(sd_bus_message *m) { assert_return(m, -EINVAL); @@ -5733,7 +5718,6 @@ _public_ int sd_bus_message_has_signature(sd_bus_message *m, const char *signatu return streq(strempty(m->root_container.signature), strempty(signature)); } -#endif // 0 _public_ int sd_bus_message_copy(sd_bus_message *m, sd_bus_message *source, int all) { bool done_something = false; @@ -5814,7 +5798,6 @@ _public_ int sd_bus_message_copy(sd_bus_message *m, sd_bus_message *source, int return done_something; } -#if 0 /// UNNEEDED by elogind _public_ int sd_bus_message_verify_type(sd_bus_message *m, char type, const char *contents) { const char *c; char t; @@ -5839,7 +5822,6 @@ _public_ int sd_bus_message_verify_type(sd_bus_message *m, char type, const char return 1; } -#endif // 0 _public_ sd_bus *sd_bus_message_get_bus(sd_bus_message *m) { assert_return(m, NULL); @@ -5942,6 +5924,7 @@ int bus_message_append_sender(sd_bus_message *m, const char *sender) { return message_append_field_string(m, BUS_MESSAGE_HEADER_SENDER, SD_BUS_TYPE_STRING, sender, &m->sender); } +#endif // 0 _public_ int sd_bus_message_get_priority(sd_bus_message *m, int64_t *priority) { assert_return(m, -EINVAL); @@ -5958,4 +5941,3 @@ _public_ int sd_bus_message_set_priority(sd_bus_message *m, int64_t priority) { m->priority = priority; return 0; } -#endif // 0 diff --git a/src/libelogind/sd-bus/bus-objects.c b/src/libelogind/sd-bus/bus-objects.c index f2fb43e4b..98911d520 100644 --- a/src/libelogind/sd-bus/bus-objects.c +++ b/src/libelogind/sd-bus/bus-objects.c @@ -2381,7 +2381,6 @@ _public_ int sd_bus_emit_object_added(sd_bus *bus, const char *path) { return sd_bus_send(bus, m, NULL); } -#if 0 /// UNNEEDED by elogind static int object_removed_append_all_prefix( sd_bus *bus, sd_bus_message *m, @@ -2551,7 +2550,6 @@ _public_ int sd_bus_emit_object_removed(sd_bus *bus, const char *path) { return sd_bus_send(bus, m, NULL); } -#endif // 0 static int interfaces_added_append_one_prefix( sd_bus *bus, @@ -2790,7 +2788,6 @@ _public_ int sd_bus_emit_interfaces_removed(sd_bus *bus, const char *path, const return sd_bus_emit_interfaces_removed_strv(bus, path, interfaces); } -#if 0 /// UNNEEDED by elogind _public_ int sd_bus_add_object_manager(sd_bus *bus, sd_bus_slot **slot, const char *path) { sd_bus_slot *s; struct node *n; @@ -2825,4 +2822,3 @@ fail: return r; } -#endif // 0 diff --git a/src/libelogind/sd-bus/bus-slot.c b/src/libelogind/sd-bus/bus-slot.c index cd5e97674..33590c31a 100644 --- a/src/libelogind/sd-bus/bus-slot.c +++ b/src/libelogind/sd-bus/bus-slot.c @@ -215,7 +215,6 @@ _public_ sd_bus_slot* sd_bus_slot_unref(sd_bus_slot *slot) { return mfree(slot); } -#if 0 /// UNNEEDED by elogind _public_ sd_bus* sd_bus_slot_get_bus(sd_bus_slot *slot) { assert_return(slot, NULL); @@ -283,4 +282,3 @@ _public_ int sd_bus_slot_get_description(sd_bus_slot *slot, const char **descrip *description = slot->description; return 0; } -#endif // 0 diff --git a/src/libelogind/sd-bus/bus-track.c b/src/libelogind/sd-bus/bus-track.c index 9714da690..4acaf2479 100644 --- a/src/libelogind/sd-bus/bus-track.c +++ b/src/libelogind/sd-bus/bus-track.c @@ -455,7 +455,6 @@ void bus_track_close(sd_bus_track *track) { bus_track_dispatch(track); } -#if 0 /// UNNEEDED by elogind _public_ void *sd_bus_track_get_userdata(sd_bus_track *track) { assert_return(track, NULL); @@ -524,4 +523,3 @@ _public_ int sd_bus_track_count_name(sd_bus_track *track, const char *name) { return i->n_ref; } -#endif // 0 diff --git a/src/libelogind/sd-bus/sd-bus.c b/src/libelogind/sd-bus/sd-bus.c index 5df358f5a..fda12a384 100644 --- a/src/libelogind/sd-bus/sd-bus.c +++ b/src/libelogind/sd-bus/sd-bus.c @@ -234,7 +234,6 @@ _public_ int sd_bus_set_fd(sd_bus *bus, int input_fd, int output_fd) { return 0; } -#if 0 /// UNNEEDED by elogind _public_ int sd_bus_set_exec(sd_bus *bus, const char *path, char *const argv[]) { char *p, **a; @@ -262,7 +261,6 @@ _public_ int sd_bus_set_exec(sd_bus *bus, const char *path, char *const argv[]) return 0; } -#endif // 0 _public_ int sd_bus_set_bus_client(sd_bus *bus, int b) { assert_return(bus, -EINVAL); @@ -273,7 +271,6 @@ _public_ int sd_bus_set_bus_client(sd_bus *bus, int b) { return 0; } -#if 0 /// UNNEEDED by elogind _public_ int sd_bus_set_monitor(sd_bus *bus, int b) { assert_return(bus, -EINVAL); assert_return(bus->state == BUS_UNSET, -EPERM); @@ -282,7 +279,6 @@ _public_ int sd_bus_set_monitor(sd_bus *bus, int b) { SET_FLAG(bus->hello_flags, KDBUS_HELLO_MONITOR, b); return 0; } -#endif // 0 _public_ int sd_bus_negotiate_fds(sd_bus *bus, int b) { assert_return(bus, -EINVAL); @@ -293,7 +289,6 @@ _public_ int sd_bus_negotiate_fds(sd_bus *bus, int b) { return 0; } -#if 0 /// UNNEEDED by elogind _public_ int sd_bus_negotiate_timestamp(sd_bus *bus, int b) { uint64_t new_flags; assert_return(bus, -EINVAL); @@ -337,7 +332,6 @@ _public_ int sd_bus_negotiate_creds(sd_bus *bus, int b, uint64_t mask) { return 0; } -#endif // 0 _public_ int sd_bus_set_server(sd_bus *bus, int b, sd_id128_t server_id) { assert_return(bus, -EINVAL); @@ -359,7 +353,6 @@ _public_ int sd_bus_set_anonymous(sd_bus *bus, int b) { return 0; } -#if 0 /// UNNEEDED by elogind _public_ int sd_bus_set_trusted(sd_bus *bus, int b) { assert_return(bus, -EINVAL); assert_return(bus->state == BUS_UNSET, -EPERM); @@ -376,7 +369,6 @@ _public_ int sd_bus_set_description(sd_bus *bus, const char *description) { return free_and_strdup(&bus->description, description); } -#endif // 0 _public_ int sd_bus_set_allow_interactive_authorization(sd_bus *bus, int b) { assert_return(bus, -EINVAL); @@ -386,14 +378,12 @@ _public_ int sd_bus_set_allow_interactive_authorization(sd_bus *bus, int b) { return 0; } -#if 0 /// UNNEEDED by elogind _public_ int sd_bus_get_allow_interactive_authorization(sd_bus *bus) { assert_return(bus, -EINVAL); assert_return(!bus_pid_changed(bus), -ECHILD); return bus->allow_interactive_authorization; } -#endif // 0 static int hello_callback(sd_bus_message *reply, void *userdata, sd_bus_error *error) { const char *s; @@ -1538,7 +1528,6 @@ _public_ sd_bus *sd_bus_unref(sd_bus *bus) { return NULL; } -#if 0 /// UNNEEDED by elogind _public_ int sd_bus_is_open(sd_bus *bus) { assert_return(bus, -EINVAL); @@ -1546,7 +1535,6 @@ _public_ int sd_bus_is_open(sd_bus *bus) { return BUS_IS_OPEN(bus->state); } -#endif // 0 _public_ int sd_bus_can_send(sd_bus *bus, char type) { int r; @@ -1572,7 +1560,6 @@ _public_ int sd_bus_can_send(sd_bus *bus, char type) { return bus_type_is_valid(type); } -#if 0 /// UNNEEDED by elogind _public_ int sd_bus_get_bus_id(sd_bus *bus, sd_id128_t *id) { int r; @@ -1587,7 +1574,6 @@ _public_ int sd_bus_get_bus_id(sd_bus *bus, sd_id128_t *id) { *id = bus->server_id; return 0; } -#endif // 0 static int bus_seal_message(sd_bus *b, sd_bus_message *m, usec_t timeout) { assert(b); @@ -1864,7 +1850,6 @@ _public_ int sd_bus_send(sd_bus *bus, sd_bus_message *m, uint64_t *cookie) { return bus_send_internal(bus, m, cookie, false); } -#if 0 /// UNNEEDED by elogind _public_ int sd_bus_send_to(sd_bus *bus, sd_bus_message *m, const char *destination, uint64_t *cookie) { int r; @@ -1890,7 +1875,6 @@ _public_ int sd_bus_send_to(sd_bus *bus, sd_bus_message *m, const char *destinat return sd_bus_send(bus, m, cookie); } -#endif // 0 static usec_t calc_elapse(uint64_t usec) { if (usec == (uint64_t) -1) @@ -2175,7 +2159,6 @@ fail: return sd_bus_error_set_errno(error, r); } -#if 0 /// UNNEEDED by elogind _public_ int sd_bus_get_fd(sd_bus *bus) { assert_return(bus, -EINVAL); @@ -2184,7 +2167,6 @@ _public_ int sd_bus_get_fd(sd_bus *bus) { return bus->input_fd; } -#endif // 0 _public_ int sd_bus_get_events(sd_bus *bus) { int flags = 0; @@ -2903,11 +2885,9 @@ _public_ int sd_bus_process(sd_bus *bus, sd_bus_message **ret) { return bus_process_internal(bus, false, 0, ret); } -#if 0 /// UNNEEDED by elogind _public_ int sd_bus_process_priority(sd_bus *bus, int64_t priority, sd_bus_message **ret) { return bus_process_internal(bus, true, priority, ret); } -#endif // 0 static int bus_poll(sd_bus *bus, bool need_more, uint64_t timeout_usec) { struct pollfd p[2] = {}; @@ -3024,7 +3004,6 @@ _public_ int sd_bus_flush(sd_bus *bus) { } } -#if 0 /// UNNEEDED by elogind _public_ int sd_bus_add_filter( sd_bus *bus, sd_bus_slot **slot, @@ -3051,7 +3030,6 @@ _public_ int sd_bus_add_filter( return 0; } -#endif // 0 _public_ int sd_bus_add_match( sd_bus *bus, @@ -3405,13 +3383,11 @@ _public_ sd_bus_message* sd_bus_get_current_message(sd_bus *bus) { return bus->current_message; } -#if 0 /// UNNEEDED by elogind _public_ sd_bus_slot* sd_bus_get_current_slot(sd_bus *bus) { assert_return(bus, NULL); return bus->current_slot; } -#endif // 0 _public_ sd_bus_message_handler_t sd_bus_get_current_handler(sd_bus *bus) { assert_return(bus, NULL); @@ -3505,7 +3481,6 @@ _public_ int sd_bus_default(sd_bus **ret) { return sd_bus_default_system(ret); } -#if 0 /// UNNEEDED by elogind _public_ int sd_bus_get_tid(sd_bus *b, pid_t *tid) { assert_return(b, -EINVAL); assert_return(tid, -EINVAL); @@ -3764,7 +3739,6 @@ _public_ int sd_bus_get_description(sd_bus *bus, const char **description) { *description = bus->description; return 0; } -#endif // 0 int bus_get_root_path(sd_bus *bus) { int r; @@ -3784,7 +3758,6 @@ int bus_get_root_path(sd_bus *bus) { return r; } -#if 0 /// UNNEEDED by elogind _public_ int sd_bus_get_scope(sd_bus *bus, const char **scope) { int r; @@ -3896,10 +3869,11 @@ static void flush_close(sd_bus *bus) { _public_ void sd_bus_default_flush_close(void) { flush_close(default_starter_bus); +#if 0 /// There is no user bus with elogind flush_close(default_user_bus); +#endif // 0 flush_close(default_system_bus); } -#endif // 0 _public_ int sd_bus_set_exit_on_disconnect(sd_bus *bus, int b) { assert_return(bus, -EINVAL); @@ -3913,10 +3887,8 @@ _public_ int sd_bus_set_exit_on_disconnect(sd_bus *bus, int b) { return bus_exit_now(bus); } -#if 0 /// UNNEEDED by elogind _public_ int sd_bus_get_exit_on_disconnect(sd_bus *bus) { assert_return(bus, -EINVAL); return bus->exit_on_disconnect; } -#endif // 0 diff --git a/src/libelogind/sd-daemon/sd-daemon.c b/src/libelogind/sd-daemon/sd-daemon.c index e58302458..160bfa7c5 100644 --- a/src/libelogind/sd-daemon/sd-daemon.c +++ b/src/libelogind/sd-daemon/sd-daemon.c @@ -44,6 +44,7 @@ #define SNDBUF_SIZE (8*1024*1024) +#if 0 /// UNNEEDED by elogind static void unsetenv_all(bool unset_environment) { if (!unset_environment) @@ -144,8 +145,8 @@ _public_ int sd_listen_fds_with_names(int unset_environment, char ***names) { return n_fds; } +#endif // 0 -#if 0 /// UNNEEDED by elogind _public_ int sd_is_fifo(int fd, const char *path) { struct stat st_fd; @@ -210,7 +211,6 @@ _public_ int sd_is_special(int fd, const char *path) { return 1; } -#endif // 0 static int sd_is_socket_internal(int fd, int type, int listening) { struct stat st_fd; @@ -281,7 +281,6 @@ _public_ int sd_is_socket(int fd, int family, int type, int listening) { return 1; } -#if 0 /// UNNEEDED by elogind _public_ int sd_is_socket_inet(int fd, int family, int type, int listening, uint16_t port) { union sockaddr_union sockaddr = {}; socklen_t l = sizeof(sockaddr); @@ -325,6 +324,7 @@ _public_ int sd_is_socket_inet(int fd, int family, int type, int listening, uint return 1; } +#if 0 /// UNNEEDED by elogind _public_ int sd_is_socket_sockaddr(int fd, int type, const struct sockaddr* addr, unsigned addr_len, int listening) { union sockaddr_union sockaddr = {}; socklen_t l = sizeof(sockaddr); @@ -382,6 +382,7 @@ _public_ int sd_is_socket_sockaddr(int fd, int type, const struct sockaddr* addr sizeof(in->sin6_addr.s6_addr)) == 0; } } +#endif // 0 _public_ int sd_is_socket_unix(int fd, int type, int listening, const char *path, size_t length) { union sockaddr_union sockaddr = {}; @@ -426,6 +427,7 @@ _public_ int sd_is_socket_unix(int fd, int type, int listening, const char *path return 1; } +#if 0 /// UNNEEDED by elogind _public_ int sd_is_mq(int fd, const char *path) { struct mq_attr attr; @@ -585,17 +587,14 @@ finish: return r; } -#if 0 /// UNNEEDED by elogind _public_ int sd_pid_notify(pid_t pid, int unset_environment, const char *state) { return sd_pid_notify_with_fds(pid, unset_environment, state, NULL, 0); } -#endif // 0 _public_ int sd_notify(int unset_environment, const char *state) { return sd_pid_notify_with_fds(0, unset_environment, state, NULL, 0); } -#if 0 /// UNNEEDED by elogind _public_ int sd_pid_notifyf(pid_t pid, int unset_environment, const char *format, ...) { _cleanup_free_ char *p = NULL; int r; @@ -631,14 +630,17 @@ _public_ int sd_notifyf(int unset_environment, const char *format, ...) { return sd_pid_notify(0, unset_environment, p); } -#endif // 0 _public_ int sd_booted(void) { +#if 0 /// With elogind, the system is (should never be) booted by systemd /* We test whether the runtime unit file directory has been * created. This takes place in mount-setup.c, so is * guaranteed to happen very early during boot. */ return laccess("/run/systemd/system/", F_OK) >= 0; +#else + return 0; +#endif // 0 } _public_ int sd_watchdog_enabled(int unset_environment, uint64_t *usec) { diff --git a/src/libelogind/sd-event/sd-event.c b/src/libelogind/sd-event/sd-event.c index 0f7a0ca7b..b4686d006 100644 --- a/src/libelogind/sd-event/sd-event.c +++ b/src/libelogind/sd-event/sd-event.c @@ -546,7 +546,6 @@ static int source_io_register( return 0; } -#if 0 /// UNNEEDED by elogind static clockid_t event_source_type_to_clock(EventSourceType t) { switch (t) { @@ -570,7 +569,6 @@ static clockid_t event_source_type_to_clock(EventSourceType t) { return (clockid_t) -1; } } -#endif // 0 static EventSourceType clock_to_event_source_type(clockid_t clock) { @@ -1366,7 +1364,6 @@ _public_ int sd_event_add_exit( return 0; } -#if 0 /// UNNEEDED by elogind _public_ sd_event_source* sd_event_source_ref(sd_event_source *s) { if (!s) @@ -1377,7 +1374,6 @@ _public_ sd_event_source* sd_event_source_ref(sd_event_source *s) { return s; } -#endif // 0 _public_ sd_event_source* sd_event_source_unref(sd_event_source *s) { @@ -1415,7 +1411,6 @@ _public_ int sd_event_source_set_description(sd_event_source *s, const char *des return free_and_strdup(&s->description, description); } -#if 0 /// UNNEEDED by elogind _public_ int sd_event_source_get_description(sd_event_source *s, const char **description) { assert_return(s, -EINVAL); assert_return(description, -EINVAL); @@ -1425,7 +1420,6 @@ _public_ int sd_event_source_get_description(sd_event_source *s, const char **de *description = s->description; return 0; } -#endif // 0 _public_ sd_event *sd_event_source_get_event(sd_event_source *s) { assert_return(s, NULL); @@ -1433,7 +1427,6 @@ _public_ sd_event *sd_event_source_get_event(sd_event_source *s) { return s->event; } -#if 0 /// UNNEEDED by elogind _public_ int sd_event_source_get_pending(sd_event_source *s) { assert_return(s, -EINVAL); assert_return(s->type != SOURCE_EXIT, -EDOM); @@ -1450,7 +1443,6 @@ _public_ int sd_event_source_get_io_fd(sd_event_source *s) { return s->io.fd; } -#endif // 0 _public_ int sd_event_source_set_io_fd(sd_event_source *s, int fd) { int r; @@ -1488,7 +1480,6 @@ _public_ int sd_event_source_set_io_fd(sd_event_source *s, int fd) { return 0; } -#if 0 /// UNNEEDED by elogind _public_ int sd_event_source_get_io_events(sd_event_source *s, uint32_t* events) { assert_return(s, -EINVAL); assert_return(events, -EINVAL); @@ -1498,7 +1489,6 @@ _public_ int sd_event_source_get_io_events(sd_event_source *s, uint32_t* events) *events = s->io.events; return 0; } -#endif // 0 _public_ int sd_event_source_set_io_events(sd_event_source *s, uint32_t events) { int r; @@ -1525,7 +1515,6 @@ _public_ int sd_event_source_set_io_events(sd_event_source *s, uint32_t events) return 0; } -#if 0 /// UNNEEDED by elogind _public_ int sd_event_source_get_io_revents(sd_event_source *s, uint32_t* revents) { assert_return(s, -EINVAL); assert_return(revents, -EINVAL); @@ -1544,7 +1533,6 @@ _public_ int sd_event_source_get_signal(sd_event_source *s) { return s->signal.sig; } -#endif // 0 _public_ int sd_event_source_get_priority(sd_event_source *s, int64_t *priority) { assert_return(s, -EINVAL); @@ -1596,7 +1584,6 @@ _public_ int sd_event_source_set_priority(sd_event_source *s, int64_t priority) return 0; } -#if 0 /// UNNEEDED by elogind _public_ int sd_event_source_get_enabled(sd_event_source *s, int *m) { assert_return(s, -EINVAL); assert_return(m, -EINVAL); @@ -1605,7 +1592,6 @@ _public_ int sd_event_source_get_enabled(sd_event_source *s, int *m) { *m = s->enabled; return 0; } -#endif // 0 _public_ int sd_event_source_set_enabled(sd_event_source *s, int m) { int r; @@ -1791,7 +1777,6 @@ _public_ int sd_event_source_set_time(sd_event_source *s, uint64_t usec) { return 0; } -#if 0 /// UNNEEDED by elogind _public_ int sd_event_source_get_time_accuracy(sd_event_source *s, uint64_t *usec) { assert_return(s, -EINVAL); assert_return(usec, -EINVAL); @@ -1846,7 +1831,6 @@ _public_ int sd_event_source_get_child_pid(sd_event_source *s, pid_t *pid) { *pid = s->child.pid; return 0; } -#endif // 0 _public_ int sd_event_source_set_prepare(sd_event_source *s, sd_event_handler_t callback) { int r; @@ -1880,7 +1864,6 @@ _public_ int sd_event_source_set_prepare(sd_event_source *s, sd_event_handler_t return 0; } -#if 0 /// UNNEEDED by elogind _public_ void* sd_event_source_get_userdata(sd_event_source *s) { assert_return(s, NULL); @@ -1897,7 +1880,6 @@ _public_ void *sd_event_source_set_userdata(sd_event_source *s, void *userdata) return ret; } -#endif // 0 static usec_t sleep_between(sd_event *e, usec_t a, usec_t b) { usec_t c; @@ -2737,7 +2719,6 @@ finish: return r; } -#if 0 /// UNNEEDED by elogind _public_ int sd_event_get_fd(sd_event *e) { assert_return(e, -EINVAL); @@ -2745,7 +2726,6 @@ _public_ int sd_event_get_fd(sd_event *e) { return e->epoll_fd; } -#endif // 0 _public_ int sd_event_get_state(sd_event *e) { assert_return(e, -EINVAL); @@ -2754,7 +2734,6 @@ _public_ int sd_event_get_state(sd_event *e) { return e->state; } -#if 0 /// UNNEEDED by elogind _public_ int sd_event_get_exit_code(sd_event *e, int *code) { assert_return(e, -EINVAL); assert_return(code, -EINVAL); @@ -2766,7 +2745,6 @@ _public_ int sd_event_get_exit_code(sd_event *e, int *code) { *code = e->exit_code; return 0; } -#endif // 0 _public_ int sd_event_exit(sd_event *e, int code) { assert_return(e, -EINVAL); @@ -2830,7 +2808,6 @@ _public_ int sd_event_default(sd_event **ret) { return 1; } -#if 0 /// UNNEEDED by elogind _public_ int sd_event_get_tid(sd_event *e, pid_t *tid) { assert_return(e, -EINVAL); assert_return(tid, -EINVAL); @@ -2843,7 +2820,6 @@ _public_ int sd_event_get_tid(sd_event *e, pid_t *tid) { return -ENXIO; } -#endif // 0 _public_ int sd_event_set_watchdog(sd_event *e, int b) { int r; @@ -2897,14 +2873,12 @@ fail: return r; } -#if 0 /// UNNEEDED by elogind _public_ int sd_event_get_watchdog(sd_event *e) { assert_return(e, -EINVAL); assert_return(!event_pid_changed(e), -ECHILD); return e->watchdog; } -#endif // 0 _public_ int sd_event_get_iteration(sd_event *e, uint64_t *ret) { assert_return(e, -EINVAL); diff --git a/src/login/.gitignore b/src/login/.gitignore index 42dc3d01d..247883ce0 100644 --- a/src/login/.gitignore +++ b/src/login/.gitignore @@ -4,3 +4,4 @@ /71-seat.rules /73-seat-late.rules /elogind-user +/org.freedesktop.login1.service diff --git a/src/systemd/sd-bus.h b/src/systemd/sd-bus.h index ca44a4412..a452cd3af 100644 --- a/src/systemd/sd-bus.h +++ b/src/systemd/sd-bus.h @@ -126,20 +126,13 @@ int sd_bus_new(sd_bus **ret); int sd_bus_set_address(sd_bus *bus, const char *address); int sd_bus_set_fd(sd_bus *bus, int input_fd, int output_fd); -#if 0 /// UNNEEDED by elogind int sd_bus_set_exec(sd_bus *bus, const char *path, char *const argv[]); int sd_bus_get_address(sd_bus *bus, const char **address); -#endif // 0 int sd_bus_set_bus_client(sd_bus *bus, int b); -#if 0 /// UNNEEDED by elogind int sd_bus_is_bus_client(sd_bus *bus); -#endif // 0 int sd_bus_set_server(sd_bus *bus, int b, sd_id128_t bus_id); -#if 0 /// UNNEEDED by elogind int sd_bus_is_server(sd_bus *bus); -#endif // 0 int sd_bus_set_anonymous(sd_bus *bus, int b); -#if 0 /// UNNEEDED by elogind int sd_bus_is_anonymous(sd_bus *bus); int sd_bus_set_trusted(sd_bus *bus, int b); int sd_bus_is_trusted(sd_bus *bus); @@ -149,20 +142,13 @@ int sd_bus_set_description(sd_bus *bus, const char *description); int sd_bus_get_description(sd_bus *bus, const char **description); int sd_bus_negotiate_creds(sd_bus *bus, int b, uint64_t creds_mask); int sd_bus_negotiate_timestamp(sd_bus *bus, int b); -#endif // 0 int sd_bus_negotiate_fds(sd_bus *bus, int b); int sd_bus_can_send(sd_bus *bus, char type); -#if 0 /// UNNEEDED by elogind int sd_bus_get_creds_mask(sd_bus *bus, uint64_t *creds_mask); -#endif // 0 int sd_bus_set_allow_interactive_authorization(sd_bus *bus, int b); -#if 0 /// UNNEEDED by elogind int sd_bus_get_allow_interactive_authorization(sd_bus *bus); -#endif // 0 int sd_bus_set_exit_on_disconnect(sd_bus *bus, int b); -#if 0 /// UNNEEDED by elogind int sd_bus_get_exit_on_disconnect(sd_bus *bus); -#endif // 0 int sd_bus_start(sd_bus *ret); @@ -173,7 +159,6 @@ sd_bus *sd_bus_ref(sd_bus *bus); sd_bus *sd_bus_unref(sd_bus *bus); sd_bus *sd_bus_flush_close_unref(sd_bus *bus); -#if 0 /// UNNEEDED by elogind void sd_bus_default_flush_close(void); int sd_bus_is_open(sd_bus *bus); @@ -181,31 +166,22 @@ int sd_bus_is_open(sd_bus *bus); int sd_bus_get_bus_id(sd_bus *bus, sd_id128_t *id); int sd_bus_get_scope(sd_bus *bus, const char **scope); int sd_bus_get_tid(sd_bus *bus, pid_t *tid); -#endif // 0 int sd_bus_get_owner_creds(sd_bus *bus, uint64_t creds_mask, sd_bus_creds **ret); int sd_bus_send(sd_bus *bus, sd_bus_message *m, uint64_t *cookie); -#if 0 /// UNNEEDED by elogind int sd_bus_send_to(sd_bus *bus, sd_bus_message *m, const char *destination, uint64_t *cookie); -#endif // 0 int sd_bus_call(sd_bus *bus, sd_bus_message *m, uint64_t usec, sd_bus_error *ret_error, sd_bus_message **reply); int sd_bus_call_async(sd_bus *bus, sd_bus_slot **slot, sd_bus_message *m, sd_bus_message_handler_t callback, void *userdata, uint64_t usec); -#if 0 /// UNNEEDED by elogind int sd_bus_get_fd(sd_bus *bus); -#endif // 0 int sd_bus_get_events(sd_bus *bus); int sd_bus_get_timeout(sd_bus *bus, uint64_t *timeout_usec); int sd_bus_process(sd_bus *bus, sd_bus_message **r); -#if 0 /// UNNEEDED by elogind int sd_bus_process_priority(sd_bus *bus, int64_t max_priority, sd_bus_message **r); -#endif // 0 int sd_bus_wait(sd_bus *bus, uint64_t timeout_usec); int sd_bus_flush(sd_bus *bus); -#if 0 /// UNNEEDED by elogind sd_bus_slot* sd_bus_get_current_slot(sd_bus *bus); -#endif // 0 sd_bus_message* sd_bus_get_current_message(sd_bus *bus); sd_bus_message_handler_t sd_bus_get_current_handler(sd_bus *bus); void* sd_bus_get_current_userdata(sd_bus *bus); @@ -214,25 +190,20 @@ int sd_bus_attach_event(sd_bus *bus, sd_event *e, int priority); int sd_bus_detach_event(sd_bus *bus); sd_event *sd_bus_get_event(sd_bus *bus); -#if 0 /// UNNEEDED by elogind int sd_bus_add_filter(sd_bus *bus, sd_bus_slot **slot, sd_bus_message_handler_t callback, void *userdata); -#endif // 0 int sd_bus_add_match(sd_bus *bus, sd_bus_slot **slot, const char *match, sd_bus_message_handler_t callback, void *userdata); int sd_bus_add_object(sd_bus *bus, sd_bus_slot **slot, const char *path, sd_bus_message_handler_t callback, void *userdata); int sd_bus_add_fallback(sd_bus *bus, sd_bus_slot **slot, const char *prefix, sd_bus_message_handler_t callback, void *userdata); int sd_bus_add_object_vtable(sd_bus *bus, sd_bus_slot **slot, const char *path, const char *interface, const sd_bus_vtable *vtable, void *userdata); int sd_bus_add_fallback_vtable(sd_bus *bus, sd_bus_slot **slot, const char *prefix, const char *interface, const sd_bus_vtable *vtable, sd_bus_object_find_t find, void *userdata); int sd_bus_add_node_enumerator(sd_bus *bus, sd_bus_slot **slot, const char *path, sd_bus_node_enumerator_t callback, void *userdata); -#if 0 /// UNNEEDED by elogind int sd_bus_add_object_manager(sd_bus *bus, sd_bus_slot **slot, const char *path); -#endif // 0 /* Slot object */ sd_bus_slot* sd_bus_slot_ref(sd_bus_slot *slot); sd_bus_slot* sd_bus_slot_unref(sd_bus_slot *slot); -#if 0 /// UNNEEDED by elogind sd_bus* sd_bus_slot_get_bus(sd_bus_slot *slot); void *sd_bus_slot_get_userdata(sd_bus_slot *slot); void *sd_bus_slot_set_userdata(sd_bus_slot *slot, void *userdata); @@ -242,7 +213,6 @@ int sd_bus_slot_get_description(sd_bus_slot *slot, const char **description); sd_bus_message* sd_bus_slot_get_current_message(sd_bus_slot *slot); sd_bus_message_handler_t sd_bus_slot_get_current_handler(sd_bus_slot *bus); void *sd_bus_slot_get_current_userdata(sd_bus_slot *slot); -#endif // 0 /* Message object */ @@ -252,14 +222,11 @@ int sd_bus_message_new_method_return(sd_bus_message *call, sd_bus_message **m); int sd_bus_message_new_method_error(sd_bus_message *call, sd_bus_message **m, const sd_bus_error *e); int sd_bus_message_new_method_errorf(sd_bus_message *call, sd_bus_message **m, const char *name, const char *format, ...) _sd_printf_(4, 5); int sd_bus_message_new_method_errno(sd_bus_message *call, sd_bus_message **m, int error, const sd_bus_error *e); -#if 0 /// UNNEEDED by elogind int sd_bus_message_new_method_errnof(sd_bus_message *call, sd_bus_message **m, int error, const char *format, ...) _sd_printf_(4, 5); -#endif // 0 sd_bus_message* sd_bus_message_ref(sd_bus_message *m); sd_bus_message* sd_bus_message_unref(sd_bus_message *m); -#if 0 /// UNNEEDED by elogind int sd_bus_message_get_type(sd_bus_message *m, uint8_t *type); int sd_bus_message_get_cookie(sd_bus_message *m, uint64_t *cookie); int sd_bus_message_get_reply_cookie(sd_bus_message *m, uint64_t *cookie); @@ -267,7 +234,6 @@ int sd_bus_message_get_priority(sd_bus_message *m, int64_t *priority); int sd_bus_message_get_expect_reply(sd_bus_message *m); int sd_bus_message_get_auto_start(sd_bus_message *m); -#endif // 0 int sd_bus_message_get_allow_interactive_authorization(sd_bus_message *m); const char *sd_bus_message_get_signature(sd_bus_message *m, int complete); @@ -279,11 +245,9 @@ const char *sd_bus_message_get_sender(sd_bus_message *m); const sd_bus_error *sd_bus_message_get_error(sd_bus_message *m); int sd_bus_message_get_errno(sd_bus_message *m); -#if 0 /// UNNEEDED by elogind int sd_bus_message_get_monotonic_usec(sd_bus_message *m, uint64_t *usec); int sd_bus_message_get_realtime_usec(sd_bus_message *m, uint64_t *usec); int sd_bus_message_get_seqnum(sd_bus_message *m, uint64_t* seqnum); -#endif // 0 sd_bus* sd_bus_message_get_bus(sd_bus_message *m); sd_bus_creds *sd_bus_message_get_creds(sd_bus_message *m); /* do not unref the result */ @@ -291,34 +255,26 @@ sd_bus_creds *sd_bus_message_get_creds(sd_bus_message *m); /* do not unref the r int sd_bus_message_is_signal(sd_bus_message *m, const char *interface, const char *member); int sd_bus_message_is_method_call(sd_bus_message *m, const char *interface, const char *member); int sd_bus_message_is_method_error(sd_bus_message *m, const char *name); -#if 0 /// UNNEEDED by elogind int sd_bus_message_is_empty(sd_bus_message *m); int sd_bus_message_has_signature(sd_bus_message *m, const char *signature); int sd_bus_message_set_expect_reply(sd_bus_message *m, int b); int sd_bus_message_set_auto_start(sd_bus_message *m, int b); int sd_bus_message_set_allow_interactive_authorization(sd_bus_message *m, int b); -#endif // 0 int sd_bus_message_set_destination(sd_bus_message *m, const char *destination); -#if 0 /// UNNEEDED by elogind int sd_bus_message_set_priority(sd_bus_message *m, int64_t priority); -#endif // 0 int sd_bus_message_append(sd_bus_message *m, const char *types, ...); int sd_bus_message_appendv(sd_bus_message *m, const char *types, va_list ap); int sd_bus_message_append_basic(sd_bus_message *m, char type, const void *p); -#if 0 /// UNNEEDED by elogind int sd_bus_message_append_array(sd_bus_message *m, char type, const void *ptr, size_t size); -#endif // 0 int sd_bus_message_append_array_space(sd_bus_message *m, char type, size_t size, void **ptr); -#if 0 /// UNNEEDED by elogind int sd_bus_message_append_array_iovec(sd_bus_message *m, char type, const struct iovec *iov, unsigned n); int sd_bus_message_append_array_memfd(sd_bus_message *m, char type, int memfd, uint64_t offset, uint64_t size); int sd_bus_message_append_string_space(sd_bus_message *m, size_t size, char **s); int sd_bus_message_append_string_iovec(sd_bus_message *m, const struct iovec *iov, unsigned n); int sd_bus_message_append_string_memfd(sd_bus_message *m, int memfd, uint64_t offset, uint64_t size); -#endif // 0 int sd_bus_message_append_strv(sd_bus_message *m, char **l); int sd_bus_message_open_container(sd_bus_message *m, char type, const char *contents); int sd_bus_message_close_container(sd_bus_message *m); @@ -332,10 +288,8 @@ int sd_bus_message_skip(sd_bus_message *m, const char *types); int sd_bus_message_enter_container(sd_bus_message *m, char type, const char *contents); int sd_bus_message_exit_container(sd_bus_message *m); int sd_bus_message_peek_type(sd_bus_message *m, char *type, const char **contents); -#if 0 /// UNNEEDED by elogind int sd_bus_message_verify_type(sd_bus_message *m, char type, const char *contents); int sd_bus_message_at_end(sd_bus_message *m, int complete); -#endif // 0 int sd_bus_message_rewind(sd_bus_message *m, int complete); /* Bus management */ @@ -345,31 +299,23 @@ int sd_bus_request_name(sd_bus *bus, const char *name, uint64_t flags); int sd_bus_release_name(sd_bus *bus, const char *name); int sd_bus_list_names(sd_bus *bus, char ***acquired, char ***activatable); /* free the results */ int sd_bus_get_name_creds(sd_bus *bus, const char *name, uint64_t mask, sd_bus_creds **creds); /* unref the result! */ -#if 0 /// UNNEEDED by elogind int sd_bus_get_name_machine_id(sd_bus *bus, const char *name, sd_id128_t *machine); -#endif // 0 /* Convenience calls */ int sd_bus_call_method(sd_bus *bus, const char *destination, const char *path, const char *interface, const char *member, sd_bus_error *ret_error, sd_bus_message **reply, const char *types, ...); -#if 0 /// UNNEEDED by elogind int sd_bus_call_method_async(sd_bus *bus, sd_bus_slot **slot, const char *destination, const char *path, const char *interface, const char *member, sd_bus_message_handler_t callback, void *userdata, const char *types, ...); -#endif // 0 int sd_bus_get_property(sd_bus *bus, const char *destination, const char *path, const char *interface, const char *member, sd_bus_error *ret_error, sd_bus_message **reply, const char *type); int sd_bus_get_property_trivial(sd_bus *bus, const char *destination, const char *path, const char *interface, const char *member, sd_bus_error *ret_error, char type, void *ret_ptr); int sd_bus_get_property_string(sd_bus *bus, const char *destination, const char *path, const char *interface, const char *member, sd_bus_error *ret_error, char **ret); /* free the result! */ -#if 0 /// UNNEEDED by elogind int sd_bus_get_property_strv(sd_bus *bus, const char *destination, const char *path, const char *interface, const char *member, sd_bus_error *ret_error, char ***ret); /* free the result! */ int sd_bus_set_property(sd_bus *bus, const char *destination, const char *path, const char *interface, const char *member, sd_bus_error *ret_error, const char *type, ...); -#endif // 0 int sd_bus_reply_method_return(sd_bus_message *call, const char *types, ...); int sd_bus_reply_method_error(sd_bus_message *call, const sd_bus_error *e); int sd_bus_reply_method_errorf(sd_bus_message *call, const char *name, const char *format, ...) _sd_printf_(3, 4); int sd_bus_reply_method_errno(sd_bus_message *call, int error, const sd_bus_error *e); -#if 0 /// UNNEEDED by elogind int sd_bus_reply_method_errnof(sd_bus_message *call, int error, const char *format, ...) _sd_printf_(3, 4); -#endif // 0 int sd_bus_emit_signal(sd_bus *bus, const char *path, const char *interface, const char *member, const char *types, ...); @@ -377,9 +323,7 @@ int sd_bus_emit_properties_changed_strv(sd_bus *bus, const char *path, const cha int sd_bus_emit_properties_changed(sd_bus *bus, const char *path, const char *interface, const char *name, ...) _sd_sentinel_; int sd_bus_emit_object_added(sd_bus *bus, const char *path); -#if 0 /// UNNEEDED by elogind int sd_bus_emit_object_removed(sd_bus *bus, const char *path); -#endif // 0 int sd_bus_emit_interfaces_added_strv(sd_bus *bus, const char *path, char **interfaces); int sd_bus_emit_interfaces_added(sd_bus *bus, const char *path, const char *interface, ...) _sd_sentinel_; int sd_bus_emit_interfaces_removed_strv(sd_bus *bus, const char *path, char **interfaces); @@ -390,40 +334,30 @@ int sd_bus_query_sender_privilege(sd_bus_message *call, int capability); /* Credential handling */ -#if 0 /// UNNEEDED by elogind int sd_bus_creds_new_from_pid(sd_bus_creds **ret, pid_t pid, uint64_t creds_mask); -#endif // 0 sd_bus_creds *sd_bus_creds_ref(sd_bus_creds *c); sd_bus_creds *sd_bus_creds_unref(sd_bus_creds *c); -#if 0 /// UNNEEDED by elogind uint64_t sd_bus_creds_get_mask(const sd_bus_creds *c); -#endif // 0 uint64_t sd_bus_creds_get_augmented_mask(const sd_bus_creds *c); int sd_bus_creds_get_pid(sd_bus_creds *c, pid_t *pid); -#if 0 /// UNNEEDED by elogind int sd_bus_creds_get_ppid(sd_bus_creds *c, pid_t *ppid); -#endif // 0 int sd_bus_creds_get_tid(sd_bus_creds *c, pid_t *tid); int sd_bus_creds_get_uid(sd_bus_creds *c, uid_t *uid); int sd_bus_creds_get_euid(sd_bus_creds *c, uid_t *euid); -#if 0 /// UNNEEDED by elogind int sd_bus_creds_get_suid(sd_bus_creds *c, uid_t *suid); int sd_bus_creds_get_fsuid(sd_bus_creds *c, uid_t *fsuid); int sd_bus_creds_get_gid(sd_bus_creds *c, gid_t *gid); -#endif // 0 int sd_bus_creds_get_egid(sd_bus_creds *c, gid_t *egid); -#if 0 /// UNNEEDED by elogind int sd_bus_creds_get_sgid(sd_bus_creds *c, gid_t *sgid); int sd_bus_creds_get_fsgid(sd_bus_creds *c, gid_t *fsgid); int sd_bus_creds_get_supplementary_gids(sd_bus_creds *c, const gid_t **gids); int sd_bus_creds_get_comm(sd_bus_creds *c, const char **comm); int sd_bus_creds_get_tid_comm(sd_bus_creds *c, const char **comm); int sd_bus_creds_get_exe(sd_bus_creds *c, const char **exe); -#endif // 0 int sd_bus_creds_get_cmdline(sd_bus_creds *c, char ***cmdline); -#if 0 /// UNNEEDED by elogind int sd_bus_creds_get_cgroup(sd_bus_creds *c, const char **cgroup); +#if 0 /// unsupported by elogind int sd_bus_creds_get_unit(sd_bus_creds *c, const char **unit); int sd_bus_creds_get_slice(sd_bus_creds *c, const char **slice); int sd_bus_creds_get_user_unit(sd_bus_creds *c, const char **unit); @@ -432,20 +366,16 @@ int sd_bus_creds_get_user_slice(sd_bus_creds *c, const char **slice); int sd_bus_creds_get_session(sd_bus_creds *c, const char **session); int sd_bus_creds_get_owner_uid(sd_bus_creds *c, uid_t *uid); int sd_bus_creds_has_effective_cap(sd_bus_creds *c, int capability); -#if 0 /// UNNEEDED by elogind int sd_bus_creds_has_permitted_cap(sd_bus_creds *c, int capability); int sd_bus_creds_has_inheritable_cap(sd_bus_creds *c, int capability); int sd_bus_creds_has_bounding_cap(sd_bus_creds *c, int capability); -#endif // 0 int sd_bus_creds_get_selinux_context(sd_bus_creds *c, const char **context); int sd_bus_creds_get_audit_session_id(sd_bus_creds *c, uint32_t *sessionid); int sd_bus_creds_get_audit_login_uid(sd_bus_creds *c, uid_t *loginuid); int sd_bus_creds_get_tty(sd_bus_creds *c, const char **tty); -#if 0 /// UNNEEDED by elogind int sd_bus_creds_get_unique_name(sd_bus_creds *c, const char **name); int sd_bus_creds_get_well_known_names(sd_bus_creds *c, char ***names); int sd_bus_creds_get_description(sd_bus_creds *c, const char **name); -#endif // 0 /* Error structures */ @@ -493,12 +423,10 @@ int sd_bus_error_add_map(const sd_bus_error_map *map); /* Label escaping */ -#if 0 /// UNNEEDED by elogind int sd_bus_path_encode(const char *prefix, const char *external_id, char **ret_path); int sd_bus_path_encode_many(char **out, const char *path_template, ...); int sd_bus_path_decode(const char *path, const char *prefix, char **ret_external_id); int sd_bus_path_decode_many(const char *path, const char *path_template, ...); -#endif // 0 /* Tracking peers */ @@ -507,26 +435,20 @@ sd_bus_track* sd_bus_track_ref(sd_bus_track *track); sd_bus_track* sd_bus_track_unref(sd_bus_track *track); sd_bus* sd_bus_track_get_bus(sd_bus_track *track); -#if 0 /// UNNEEDED by elogind void *sd_bus_track_get_userdata(sd_bus_track *track); void *sd_bus_track_set_userdata(sd_bus_track *track, void *userdata); -#endif // 0 int sd_bus_track_add_sender(sd_bus_track *track, sd_bus_message *m); int sd_bus_track_remove_sender(sd_bus_track *track, sd_bus_message *m); int sd_bus_track_add_name(sd_bus_track *track, const char *name); int sd_bus_track_remove_name(sd_bus_track *track, const char *name); -#if 0 /// UNNEEDED by elogind int sd_bus_track_set_recursive(sd_bus_track *track, int b); int sd_bus_track_get_recursive(sd_bus_track *track); -#endif // 0 unsigned sd_bus_track_count(sd_bus_track *track); -#if 0 /// UNNEEDED by elogind int sd_bus_track_count_sender(sd_bus_track *track, sd_bus_message *m); int sd_bus_track_count_name(sd_bus_track *track, const char *name); -#endif // 0 const char* sd_bus_track_contains(sd_bus_track *track, const char *name); const char* sd_bus_track_first(sd_bus_track *track); diff --git a/src/systemd/sd-daemon.h b/src/systemd/sd-daemon.h index 83a8fe82f..1780746c7 100644 --- a/src/systemd/sd-daemon.h +++ b/src/systemd/sd-daemon.h @@ -57,6 +57,7 @@ _SD_BEGIN_DECLARATIONS; /* The first passed file descriptor is fd 3 */ #define SD_LISTEN_FDS_START 3 +#if 0 /// unsupported by elogind /* Returns how many file descriptors have been passed, or a negative errno code on failure. Optionally, removes the $LISTEN_FDS and @@ -75,8 +76,8 @@ _SD_BEGIN_DECLARATIONS; int sd_listen_fds(int unset_environment); int sd_listen_fds_with_names(int unset_environment, char ***names); +#endif // 0 -#if 0 /// UNNEEDED by elogind /* Helper call for identifying a passed file descriptor. Returns 1 if the file descriptor is a FIFO in the file system stored under the @@ -100,7 +101,6 @@ int sd_is_fifo(int fd, const char *path); See sd_is_special(3) for more information. */ int sd_is_special(int fd, const char *path); -#endif // 0 /* Helper call for identifying a passed file descriptor. Returns 1 if @@ -118,7 +118,6 @@ int sd_is_special(int fd, const char *path); */ int sd_is_socket(int fd, int family, int type, int listening); -#if 0 /// UNNEEDED by elogind /* Helper call for identifying a passed file descriptor. Returns 1 if the file descriptor is an Internet socket, of the specified family @@ -133,6 +132,7 @@ int sd_is_socket(int fd, int family, int type, int listening); */ int sd_is_socket_inet(int fd, int family, int type, int listening, uint16_t port); +#if 0 /// unsupported by elogind /* Helper call for identifying a passed file descriptor. Returns 1 if the file descriptor is an Internet socket of the specified type @@ -144,6 +144,7 @@ int sd_is_socket_inet(int fd, int family, int type, int listening, uint16_t port See sd_is_socket_sockaddr(3) for more information. */ int sd_is_socket_sockaddr(int fd, int type, const struct sockaddr* addr, unsigned addr_len, int listening); +#endif // 0 /* Helper call for identifying a passed file descriptor. Returns 1 if @@ -161,6 +162,7 @@ int sd_is_socket_sockaddr(int fd, int type, const struct sockaddr* addr, unsigne */ int sd_is_socket_unix(int fd, int type, int listening, const char *path, size_t length); +#if 0 /// UNNEEDED by elogind /* Helper call for identifying a passed file descriptor. Returns 1 if the file descriptor is a POSIX Message Queue of the specified name, @@ -235,7 +237,6 @@ int sd_is_mq(int fd, const char *path); */ int sd_notify(int unset_environment, const char *state); -#if 0 /// UNNEEDED by elogind /* Similar to sd_notify() but takes a format string. @@ -269,7 +270,6 @@ int sd_pid_notify(pid_t pid, int unset_environment, const char *state); process, if the appropriate permissions are available. */ int sd_pid_notifyf(pid_t pid, int unset_environment, const char *format, ...) _sd_printf_(3,4); -#endif // 0 /* Similar to sd_pid_notify(), but also passes the specified fd array diff --git a/src/systemd/sd-event.h b/src/systemd/sd-event.h index 95d9f37c2..f8cb89566 100644 --- a/src/systemd/sd-event.h +++ b/src/systemd/sd-event.h @@ -98,65 +98,41 @@ int sd_event_exit(sd_event *e, int code); int sd_event_now(sd_event *e, clockid_t clock, uint64_t *usec); -#if 0 /// UNNEEDED by elogind int sd_event_get_fd(sd_event *e); -#endif // 0 int sd_event_get_state(sd_event *e); -#if 0 /// UNNEEDED by elogind int sd_event_get_tid(sd_event *e, pid_t *tid); int sd_event_get_exit_code(sd_event *e, int *code); -#endif // 0 int sd_event_set_watchdog(sd_event *e, int b); -#if 0 /// UNNEEDED by elogind int sd_event_get_watchdog(sd_event *e); -#endif // 0 int sd_event_get_iteration(sd_event *e, uint64_t *ret); -#if 0 /// UNNEEDED by elogind sd_event_source* sd_event_source_ref(sd_event_source *s); -#endif // 0 sd_event_source* sd_event_source_unref(sd_event_source *s); sd_event *sd_event_source_get_event(sd_event_source *s); -#if 0 /// UNNEEDED by elogind void* sd_event_source_get_userdata(sd_event_source *s); void* sd_event_source_set_userdata(sd_event_source *s, void *userdata); -#endif // 0 int sd_event_source_set_description(sd_event_source *s, const char *description); -#if 0 /// UNNEEDED by elogind int sd_event_source_get_description(sd_event_source *s, const char **description); -#endif // 0 int sd_event_source_set_prepare(sd_event_source *s, sd_event_handler_t callback); -#if 0 /// UNNEEDED by elogind int sd_event_source_get_pending(sd_event_source *s); -#endif // 0 int sd_event_source_get_priority(sd_event_source *s, int64_t *priority); int sd_event_source_set_priority(sd_event_source *s, int64_t priority); -#if 0 /// UNNEEDED by elogind int sd_event_source_get_enabled(sd_event_source *s, int *enabled); -#endif // 0 int sd_event_source_set_enabled(sd_event_source *s, int enabled); -#if 0 /// UNNEEDED by elogind int sd_event_source_get_io_fd(sd_event_source *s); -#endif // 0 int sd_event_source_set_io_fd(sd_event_source *s, int fd); -#if 0 /// UNNEEDED by elogind int sd_event_source_get_io_events(sd_event_source *s, uint32_t* events); -#endif // 0 int sd_event_source_set_io_events(sd_event_source *s, uint32_t events); -#if 0 /// UNNEEDED by elogind int sd_event_source_get_io_revents(sd_event_source *s, uint32_t* revents); -#endif // 0 int sd_event_source_get_time(sd_event_source *s, uint64_t *usec); int sd_event_source_set_time(sd_event_source *s, uint64_t usec); -#if 0 /// UNNEEDED by elogind int sd_event_source_get_time_accuracy(sd_event_source *s, uint64_t *usec); int sd_event_source_set_time_accuracy(sd_event_source *s, uint64_t usec); int sd_event_source_get_time_clock(sd_event_source *s, clockid_t *clock); int sd_event_source_get_signal(sd_event_source *s); int sd_event_source_get_child_pid(sd_event_source *s, pid_t *pid); -#endif // 0 /* Define helpers so that __attribute__((cleanup(sd_event_unrefp))) and similar may be used. */ _SD_DEFINE_POINTER_CLEANUP_FUNC(sd_event, sd_event_unref); -- 2.30.2