From 20710c92ba65584a6fba036f9a2c3624a6bc2565 Mon Sep 17 00:00:00 2001 From: Sven Eden Date: Tue, 12 Dec 2017 07:54:16 +0100 Subject: 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. --- man/glib-event-glue.c | 68 ++++++++ man/sd_bus_message_append_string_memfd.xml | 153 ++++++++++++++++++ man/sd_bus_message_get_cookie.xml | 146 +++++++++++++++++ man/sd_bus_message_get_monotonic_usec.xml | 181 +++++++++++++++++++++ man/sd_bus_path_encode.xml | 188 ++++++++++++++++++++++ man/sd_event_get_fd.xml | 140 ++++++++++++++++ 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 | 247 ++++++++++++++--------------- 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 | 30 +--- src/libelogind/sd-daemon/sd-daemon.c | 8 +- src/libelogind/sd-event/sd-event.c | 26 --- src/systemd/sd-bus.h | 75 +-------- src/systemd/sd-daemon.h | 6 +- src/systemd/sd-event.h | 45 +++--- 24 files changed, 1042 insertions(+), 342 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/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_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_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_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_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/src/basic/memfd-util.c b/src/basic/memfd-util.c index ad80d5662..231c2de71 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 a85045d11..91aa2f529 100644 --- a/src/basic/socket-util.h +++ b/src/basic/socket-util.h @@ -36,12 +36,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. 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 b0132fca2..79c219afb 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; /* @@ -524,7 +521,7 @@ global: LIBSYSTEMD_233 { global: sd_id128_get_machine_app_specific; - /* sd_is_socket_sockaddr; */ + sd_is_socket_sockaddr; } LIBSYSTEMD_232; LIBSYSTEMD_234 { diff --git a/src/libelogind/sd-bus/bus-control.c b/src/libelogind/sd-bus/bus-control.c index 23f83a631..fcd4d27e0 100644 --- a/src/libelogind/sd-bus/bus-control.c +++ b/src/libelogind/sd-bus/bus-control.c @@ -695,7 +695,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; @@ -740,4 +739,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 85c8e3979..e171c53e2 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 4e2708b2c..57e7b0c57 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 cfff484a8..0440cbf20 100644 --- a/src/libelogind/sd-bus/bus-message.c +++ b/src/libelogind/sd-bus/bus-message.c @@ -810,7 +810,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, @@ -827,7 +826,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); @@ -925,7 +923,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); @@ -971,7 +968,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); @@ -1019,7 +1015,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); @@ -1052,7 +1047,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); @@ -1113,7 +1107,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); @@ -1141,7 +1134,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); @@ -1593,7 +1585,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, @@ -1684,7 +1675,6 @@ _public_ int sd_bus_message_append_string_iovec( return 0; } -#endif // 0 static int bus_message_open_array( sd_bus_message *m, @@ -2552,7 +2542,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, @@ -2786,7 +2775,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; @@ -3087,7 +3075,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); @@ -3103,7 +3090,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; @@ -5655,7 +5641,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); @@ -5667,7 +5652,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; @@ -5746,7 +5730,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; @@ -5771,7 +5754,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); @@ -5874,6 +5856,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); @@ -5890,4 +5873,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 37a49123e..df2bdc806 100644 --- a/src/libelogind/sd-bus/bus-objects.c +++ b/src/libelogind/sd-bus/bus-objects.c @@ -2385,7 +2385,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, @@ -2555,7 +2554,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, @@ -2794,7 +2792,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; @@ -2829,4 +2826,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 9fba5634a..725265b33 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..8a2248bc6 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); @@ -473,6 +472,7 @@ _public_ void *sd_bus_track_set_userdata(sd_bus_track *track, void *userdata) { return ret; } +#if 0 /// UNNEEDED by elogind _public_ int sd_bus_track_set_recursive(sd_bus_track *track, int b) { assert_return(track, -EINVAL); diff --git a/src/libelogind/sd-bus/sd-bus.c b/src/libelogind/sd-bus/sd-bus.c index 107fc363c..38730da9e 100644 --- a/src/libelogind/sd-bus/sd-bus.c +++ b/src/libelogind/sd-bus/sd-bus.c @@ -233,7 +233,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; @@ -261,7 +260,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); @@ -272,7 +270,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); @@ -281,7 +278,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); @@ -292,7 +288,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); @@ -332,7 +327,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); @@ -354,7 +348,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); @@ -371,7 +364,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); @@ -381,14 +373,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; @@ -1375,7 +1365,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); @@ -1383,7 +1372,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; @@ -1409,7 +1397,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; @@ -1424,7 +1411,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); @@ -1686,7 +1672,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; @@ -1712,7 +1697,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) @@ -1995,7 +1979,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); @@ -2004,7 +1987,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; @@ -2718,11 +2700,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] = {}; @@ -2839,7 +2819,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, @@ -2866,7 +2845,6 @@ _public_ int sd_bus_add_filter( return 0; } -#endif // 0 _public_ int sd_bus_add_match( sd_bus *bus, @@ -3215,13 +3193,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); @@ -3315,7 +3291,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); @@ -3555,7 +3530,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; @@ -3575,7 +3549,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) { assert_return(bus, -EINVAL); assert_return(scope, -EINVAL); @@ -3665,10 +3638,11 @@ static void flush_close(sd_bus *bus) { _public_ void sd_bus_default_flush_close(void) { flush_close(default_starter_bus); +#if 0 /// elogind does not support user buses 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); diff --git a/src/libelogind/sd-daemon/sd-daemon.c b/src/libelogind/sd-daemon/sd-daemon.c index 87e7f7842..755ba7501 100644 --- a/src/libelogind/sd-daemon/sd-daemon.c +++ b/src/libelogind/sd-daemon/sd-daemon.c @@ -148,7 +148,6 @@ _public_ int sd_listen_fds_with_names(int unset_environment, char ***names) { return n_fds; } -#if 0 /// UNNEEDED by elogind _public_ int sd_is_fifo(int fd, const char *path) { struct stat st_fd; @@ -213,7 +212,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; @@ -284,7 +282,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); @@ -428,6 +425,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; @@ -587,17 +585,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; @@ -633,7 +628,6 @@ _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) { /* We test whether the runtime unit file directory has been diff --git a/src/libelogind/sd-event/sd-event.c b/src/libelogind/sd-event/sd-event.c index 7c0e436f0..2c5c2ebb4 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; @@ -2732,7 +2714,6 @@ finish: return r; } -#if 0 /// UNNEEDED by elogind _public_ int sd_event_get_fd(sd_event *e) { assert_return(e, -EINVAL); @@ -2740,7 +2721,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); @@ -2749,7 +2729,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); @@ -2761,7 +2740,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); @@ -2825,7 +2803,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); @@ -2838,7 +2815,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; @@ -2892,14 +2868,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/systemd/sd-bus.h b/src/systemd/sd-bus.h index ca44a4412..1990dd6c5 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,16 +142,12 @@ 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); @@ -173,7 +162,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 +169,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 +193,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 +216,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 +225,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 +237,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 +248,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 +258,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 +291,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 +302,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 +326,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 +337,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 +369,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 +426,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,10 +438,8 @@ 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); diff --git a/src/systemd/sd-daemon.h b/src/systemd/sd-daemon.h index 959e2804c..f698e92cc 100644 --- a/src/systemd/sd-daemon.h +++ b/src/systemd/sd-daemon.h @@ -77,7 +77,6 @@ int sd_listen_fds(int unset_environment); int sd_listen_fds_with_names(int unset_environment, char ***names); -#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 @@ -101,7 +100,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 @@ -119,7 +117,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 @@ -162,6 +159,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, @@ -236,7 +234,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. @@ -270,7 +267,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..f0e83cc93 100644 --- a/src/systemd/sd-event.h +++ b/src/systemd/sd-event.h @@ -98,65 +98,62 @@ 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); -- cgit v1.2.3