--- /dev/null
+<?xml version='1.0'?> <!--*-nxml-*-->
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
+
+<!--
+ This file is part of systemd.
+
+ Copyright 2010 Lennart Poettering
+
+ systemd is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 of the License, or
+ (at your option) any later version.
+
+ systemd is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with systemd; If not, see <http://www.gnu.org/licenses/>.
+-->
+
+<refentry id="sd_booted"
+ xmlns:xi="http://www.w3.org/2001/XInclude">
+
+ <refentryinfo>
+ <title>sd_booted</title>
+ <productname>systemd</productname>
+
+ <authorgroup>
+ <author>
+ <contrib>Developer</contrib>
+ <firstname>Lennart</firstname>
+ <surname>Poettering</surname>
+ <email>lennart@poettering.net</email>
+ </author>
+ </authorgroup>
+ </refentryinfo>
+
+ <refmeta>
+ <refentrytitle>sd_booted</refentrytitle>
+ <manvolnum>3</manvolnum>
+ </refmeta>
+
+ <refnamediv>
+ <refname>sd_booted</refname>
+ <refpurpose>Test whether the system is running the systemd init system</refpurpose>
+ </refnamediv>
+
+ <refsynopsisdiv>
+ <funcsynopsis>
+ <funcsynopsisinfo>#include <systemd/sd-daemon.h></funcsynopsisinfo>
+
+ <funcprototype>
+ <funcdef>int <function>sd_booted</function></funcdef>
+ <paramdef>void</paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ </refsynopsisdiv>
+
+ <refsect1>
+ <title>Description</title>
+ <para><function>sd_booted()</function> checks whether the system
+ was booted up using the systemd init system.</para>
+ </refsect1>
+
+ <refsect1>
+ <title>Return Value</title>
+
+ <para>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.</para>
+ </refsect1>
+
+ <refsect1>
+ <title>Notes</title>
+
+ <xi:include href="libelogind-pkgconfig.xml" xpointer="pkgconfig-text"/>
+
+ <para>Internally, this function checks whether the directory
+ <filename>/run/systemd/system/</filename> exists. A simple check
+ like this can also be implemented trivially in shell or any other
+ language.</para>
+ </refsect1>
+
+ <refsect1>
+ <title>See Also</title>
+ <para>
+ <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
+ <citerefentry><refentrytitle>sd-daemon</refentrytitle><manvolnum>3</manvolnum></citerefentry>
+ </para>
+ </refsect1>
+
+</refentry>
return (wanted = r > 0 ? !b : is_default);
}
#else
+bool cg_is_unified_wanted(void) {
+ return false;
+}
bool cg_is_legacy_wanted(void) {
return true;
}
+bool cg_is_hybrid_wanted(void) {
+ return false;
+}
#endif // 0
#if 0 /// UNNEEDED by elogind
int cg_unified_controller(const char *controller);
int cg_unified_flush(void);
-#if 0 /// UNNEEDED by elogind
bool cg_is_unified_wanted(void);
-#endif // 0
bool cg_is_legacy_wanted(void);
-#if 0 /// UNNEEDED by elogind
bool cg_is_hybrid_wanted(void);
-#endif // 0
const char* cgroup_controller_to_string(CGroupController c) _const_;
CGroupController cgroup_controller_from_string(const char *s) _pure_;
return conf_files_list_strv_internal(strv, suffix, root, copy);
}
-#if 0 /// UNNEEDED by elogind
int conf_files_list(char ***strv, const char *suffix, const char *root, const char *dir, ...) {
_cleanup_strv_free_ char **dirs = NULL;
va_list ap;
return conf_files_list_strv_internal(strv, suffix, root, dirs);
}
-#endif // 0
int conf_files_list_nulstr(char ***strv, const char *suffix, const char *root, const char *d) {
_cleanup_strv_free_ char **dirs = NULL;
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#if 0 /// UNNEEDED by elogind
int conf_files_list(char ***ret, const char *suffix, const char *root, const char *dir, ...);
-#endif // 0
int conf_files_list_strv(char ***ret, const char *suffix, const char *root, const char* const* dirs);
int conf_files_list_nulstr(char ***ret, const char *suffix, const char *root, const char *dirs);
return 0;
}
+#endif // 0
int readlink_and_make_absolute(const char *p, char **r) {
_cleanup_free_ char *target = NULL;
return 0;
}
+#if 0 /// UNNEEDED by elogind
int readlink_and_canonicalize(const char *p, const char *root, char **ret) {
char *t, *s;
int r;
int readlink_malloc(const char *p, char **r);
#if 0 /// UNNEEDED by elogind
int readlink_value(const char *p, char **ret);
+#endif // 0
int readlink_and_make_absolute(const char *p, char **r);
+#if 0 /// UNNEEDED by elogind
int readlink_and_canonicalize(const char *p, const char *root, char **r);
int readlink_and_make_absolute_root(const char *root, const char *path, char **ret);
#endif // 0
return sv;
}
-#if 0 /// UNNEEDED by elogind
void *ordered_hashmap_next(OrderedHashmap *h, const void *key) {
struct ordered_hashmap_entry *e;
unsigned hash, idx;
return NULL;
return ordered_bucket_at(h, e->iterate_next)->p.value;
}
-#endif // 0
int set_consume(Set *s, void *value) {
int r;
return internal_hashmap_first(HASHMAP_BASE(h));
}
-#if 0 /// UNNEEDED by elogind
/* no hashmap_next */
void *ordered_hashmap_next(OrderedHashmap *h, const void *key);
-#endif // 0
char **internal_hashmap_get_strv(HashmapBase *h);
static inline char **hashmap_get_strv(Hashmap *h) {
*upper = u;
return 0;
}
+#endif // 0
char *format_bytes(char *buf, size_t l, uint64_t t) {
unsigned i;
return buf;
}
-#endif // 0
int safe_atou(const char *s, unsigned *ret_u) {
char *x = NULL;
int parse_size(const char *t, uint64_t base, uint64_t *size);
#if 0 /// UNNEEDED by elogind
int parse_range(const char *t, unsigned *lower, unsigned *upper);
+#endif // 0
#define FORMAT_BYTES_MAX 8
char *format_bytes(char *buf, size_t l, uint64_t t);
-#endif // 0
int safe_atou(const char *s, unsigned *ret_u);
int safe_atoi(const char *s, int *ret_i);
return path_equal(a, b) || files_same(a, b) > 0;
}
-#if 0 /// UNNEEDED by elogind
char* path_join(const char *root, const char *path, const char *rest) {
assert(path);
return last_error;
}
+#if 0 /// UNNEEDED by elogind
bool paths_check_timestamp(const char* const* paths, usec_t *timestamp, bool update) {
bool changed = false;
const char* const* i;
int path_compare(const char *a, const char *b) _pure_;
bool path_equal(const char *a, const char *b) _pure_;
bool path_equal_or_files_same(const char *a, const char *b);
-#if 0 /// UNNEEDED by elogind
char* path_join(const char *root, const char *path, const char *rest);
static inline bool path_equal_ptr(const char *a, const char *b) {
return !!a == !!b && (!a || path_equal(a, b));
}
-#endif // 0
/* Note: the search terminates on the first NULL item. */
#define PATH_IN_SET(p, ...) \
char** path_strv_resolve(char **l, const char *root);
char** path_strv_resolve_uniq(char **l, const char *root);
-#if 0 /// UNNEEDED by elogind
int find_binary(const char *name, char **filename);
+#if 0 /// UNNEEDED by elogind
bool paths_check_timestamp(const char* const* paths, usec_t *paths_ts_usec, bool update);
int fsck_exists(const char *fstype);
return getuid() == 0;
}
-#if 0 /// UNNEEDED by elogind
void mac_selinux_retest(void) {
#ifdef HAVE_SELINUX
cached_use = -1;
#endif
}
-#endif // 0
int mac_selinux_init(void) {
int r = 0;
return r;
}
-#if 0 /// UNNEEDED by elogind
void mac_selinux_finish(void) {
#ifdef HAVE_SELINUX
label_hnd = NULL;
#endif
}
-#endif // 0
int mac_selinux_fix(const char *path, bool ignore_enoent, bool ignore_erofs) {
bool mac_selinux_use(void);
bool mac_selinux_have(void);
-#if 0 /// UNNEEDED by elogind
void mac_selinux_retest(void);
-#endif // 0
int mac_selinux_init(void);
-#if 0 /// UNNEEDED by elogind
void mac_selinux_finish(void);
-#endif // 0
int mac_selinux_fix(const char *path, bool ignore_enoent, bool ignore_erofs);
#if 0 /// UNNEEDED by elogind
return r;
}
-#if 0 /// UNNEEDED by elogind
int default_signals(int sig, ...) {
static const struct sigaction sa = {
return r;
}
-#endif // 0
static int sigset_add_many_ap(sigset_t *ss, va_list ap) {
int sig, r = 0;
int reset_signal_mask(void);
int ignore_signals(int sig, ...);
-#if 0 /// UNNEEDED by elogind
int default_signals(int sig, ...);
+#if 0 /// UNNEEDED by elogind
int sigaction_many(const struct sigaction *sa, ...);
#endif // 0
return l;
}
-#if 0 /// UNNEEDED by elogind
bool strv_equal(char **a, char **b) {
if (strv_isempty(a))
puts(*s);
}
+#if 0 /// UNNEEDED by elogind
int strv_extendf(char ***l, const char *format, ...) {
va_list ap;
char *x;
char **strv_uniq(char **l);
#if 0 /// UNNEEDED by elogind
bool strv_is_uniq(char **l);
+#endif // 0
bool strv_equal(char **a, char **b);
-#endif // 0
#define strv_contains(l, s) (!!strv_find((l), (s)))
for ((x) = (l), (y) = (x+1); (x) && *(x) && *(y); (x) += 2, (y) = (x + 1))
char **strv_sort(char **l);
-#if 0 /// UNNEEDED by elogind
void strv_print(char **l);
-#endif // 0
#define STRV_MAKE(...) ((char**) ((const char*[]) { __VA_ARGS__, NULL }))
* this mkdir really needs to stay for good, otherwise software that copied sd-daemon.c into their sources will
* misdetect systemd. */
(void) mkdir_label("/run/systemd", 0755);
+#if 0 /// Yeah, but elogind is not used with systemd, so this directory would be toxic.
(void) mkdir_label("/run/systemd/system", 0755);
+#endif // 0
/* Set up inaccessible items */
(void) mkdir_label("/run/systemd/inaccessible", 0000);
/* sd_journal_open_container; */
/* sd-daemon */
- /* sd_booted; */
+ sd_booted;
/* sd_is_fifo; */
/* sd_is_mq; */
sd_is_socket;
sd_bus_set_fd;
/* sd_bus_set_exec; */
/* sd_bus_get_address; */
- /* sd_bus_set_bus_client; */
+ sd_bus_set_bus_client;
/* sd_bus_is_bus_client; */
- /* sd_bus_set_server; */
+ sd_bus_set_server;
/* sd_bus_is_server; */
- /* sd_bus_set_anonymous; */
+ sd_bus_set_anonymous;
/* sd_bus_is_anonymous; */
/* sd_bus_set_trusted; */
/* sd_bus_is_trusted; */
/* sd_bus_get_description; */
/* sd_bus_negotiate_creds; */
/* sd_bus_negotiate_timestamp; */
- /* sd_bus_negotiate_fds; */
+ sd_bus_negotiate_fds;
sd_bus_can_send;
/* sd_bus_get_creds_mask; */
sd_bus_set_allow_interactive_authorization;
/* sd_bus_message_get_seqnum; */
sd_bus_message_get_bus;
sd_bus_message_get_creds;
- /* sd_bus_message_is_signal; */
+ 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_append;
sd_bus_message_append_basic;
/* sd_bus_message_append_array; */
- /* sd_bus_message_append_array_space; */
+ 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_event_add_io;
sd_event_add_time;
sd_event_add_signal;
- /* sd_event_add_child; */
- /* sd_event_add_defer; */
+ sd_event_add_child;
+ sd_event_add_defer;
sd_event_add_post;
sd_event_add_exit;
sd_event_prepare;
sd_event_wait;
sd_event_dispatch;
sd_event_run;
- /* sd_event_loop; */
+ sd_event_loop;
sd_event_exit;
- /* sd_event_now; */
+ sd_event_now;
/* sd_event_get_fd; */
sd_event_get_state;
/* sd_event_get_tid; */
/* sd_event_source_get_description; */
sd_event_source_set_prepare;
/* sd_event_source_get_pending; */
- /* sd_event_source_get_priority; */
+ sd_event_source_get_priority;
sd_event_source_set_priority;
/* sd_event_source_get_enabled; */
sd_event_source_set_enabled;
return m;
}
-#if 0 /// UNNEEDED by elogind
int bus_kernel_create_bus(const char *name, bool world, char **s) {
struct kdbus_cmd *make;
struct kdbus_item *n;
return fd;
}
-#endif // 0
int bus_kernel_open_bus_fd(const char *bus, char **path) {
char *p;
int bus_kernel_open_bus_fd(const char *bus, char **path);
-#if 0 /// UNNEEDED by elogind
int bus_kernel_create_bus(const char *name, bool world, char **s);
+#if 0 /// UNNEEDED by elogind
int bus_kernel_create_endpoint(const char *bus_name, const char *ep_name, char **path);
#endif // 0
return &m->creds;
}
-#if 0 /// UNNEEDED by elogind
_public_ int sd_bus_message_is_signal(
sd_bus_message *m,
const char *interface,
return 1;
}
-#endif // 0
_public_ int sd_bus_message_is_method_call(
sd_bus_message *m,
return r;
}
-#if 0 /// UNNEEDED by elogind
_public_ int sd_bus_message_append_array_space(
sd_bus_message *m,
char type,
return 0;
}
+#if 0 /// UNNEEDED by elogind
_public_ int sd_bus_message_append_array(
sd_bus_message *m,
char type,
return 0;
}
+#endif // 0
_public_ int sd_bus_set_bus_client(sd_bus *bus, int b) {
assert_return(bus, -EINVAL);
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);
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);
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);
return 0;
}
+#endif // 0
_public_ int sd_bus_set_server(sd_bus *bus, int b, sd_id128_t server_id) {
assert_return(bus, -EINVAL);
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);
#include "alloc-util.h"
#include "fd-util.h"
-//#include "fs-util.h"
+#include "fs-util.h"
#include "parse-util.h"
#include "path-util.h"
#include "socket-util.h"
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
return laccess("/run/systemd/system/", F_OK) >= 0;
}
-#endif // 0
_public_ int sd_watchdog_enabled(int unset_environment, uint64_t *usec) {
const char *s, *p = ""; /* p is set to dummy value to do unsetting */
return 0;
}
-#if 0 /// UNNEEDED by elogind
_public_ int sd_event_add_child(
sd_event *e,
sd_event_source **ret,
return 0;
}
-#endif // 0
_public_ int sd_event_add_post(
sd_event *e,
return s->signal.sig;
}
+#endif // 0
_public_ int sd_event_source_get_priority(sd_event_source *s, int64_t *priority) {
assert_return(s, -EINVAL);
*priority = s->priority;
return 0;
}
-#endif // 0
_public_ int sd_event_source_set_priority(sd_event_source *s, int64_t priority) {
int r;
return r;
}
-#if 0 /// UNNEEDED by elogind
_public_ int sd_event_loop(sd_event *e) {
int r;
return r;
}
+#if 0 /// UNNEEDED by elogind
_public_ int sd_event_get_fd(sd_event *e) {
assert_return(e, -EINVAL);
return 0;
}
-#if 0 /// UNNEEDED by elogind
_public_ int sd_event_now(sd_event *e, clockid_t clock, uint64_t *usec) {
assert_return(e, -EINVAL);
assert_return(usec, -EINVAL);
*usec = triple_timestamp_by_clock(&e->timestamp, clock);
return 0;
}
-#endif // 0
_public_ int sd_event_default(sd_event **ret) {
return id128_read_fd(fd, f, ret);
}
-#if 0 /// UNNEEDED by elogind
int id128_write_fd(int fd, Id128Format f, sd_id128_t id, bool do_sync) {
char buffer[36 + 2];
size_t sz;
return r;
}
+#if 0 /// UNNEEDED by elogind
int id128_write(const char *p, Id128Format f, sd_id128_t id, bool do_sync) {
_cleanup_close_ int fd = -1;
int id128_read_fd(int fd, Id128Format f, sd_id128_t *ret);
int id128_read(const char *p, Id128Format f, sd_id128_t *ret);
-#if 0 /// UNNEEDED by elogind
int id128_write_fd(int fd, Id128Format f, sd_id128_t id, bool do_sync);
+#if 0 /// UNNEEDED by elogind
int id128_write(const char *p, Id128Format f, sd_id128_t id, bool do_sync);
void id128_hash_func(const void *p, struct siphash *state);
--- /dev/null
+/***
+ This file is part of systemd.
+
+ Copyright 2016 Lennart Poettering
+
+ systemd is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 of the License, or
+ (at your option) any later version.
+
+ systemd is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with systemd; If not, see <http://www.gnu.org/licenses/>.
+***/
+
+#include <alloc-util.h>
+#include <fs-util.h>
+#include <libgen.h>
+#include <stdlib.h>
+#include <util.h>
+
+#include "tests.h"
+#include "path-util.h"
+
+char* setup_fake_runtime_dir(void) {
+ char t[] = "/tmp/fake-xdg-runtime-XXXXXX", *p;
+
+ assert_se(mkdtemp(t));
+ assert_se(setenv("XDG_RUNTIME_DIR", t, 1) >= 0);
+ assert_se(p = strdup(t));
+
+ return p;
+}
+
+const char* get_testdata_dir(const char *suffix) {
+ const char *env;
+ /* convenience: caller does not need to free result */
+ static char testdir[PATH_MAX];
+
+ /* if the env var is set, use that */
+ env = getenv("SYSTEMD_TEST_DATA");
+ testdir[sizeof(testdir) - 1] = '\0';
+ if (env) {
+ if (access(env, F_OK) < 0) {
+ fputs("ERROR: $SYSTEMD_TEST_DATA directory does not exist\n", stderr);
+ exit(1);
+ }
+ strncpy(testdir, env, sizeof(testdir) - 1);
+ } else {
+ _cleanup_free_ char *exedir = NULL;
+ assert_se(readlink_and_make_absolute("/proc/self/exe", &exedir) >= 0);
+
+ /* Check if we're running from the builddir. If so, use the compiled in path. */
+ if (path_startswith(exedir, ABS_BUILD_DIR))
+ assert_se(snprintf(testdir, sizeof(testdir), "%s/test", ABS_SRC_DIR) > 0);
+ else
+ /* Try relative path, according to the install-test layout */
+ assert_se(snprintf(testdir, sizeof(testdir), "%s/testdata", dirname(exedir)) > 0);
+
+ /* test this without the suffix, as it may contain a glob */
+ if (access(testdir, F_OK) < 0) {
+ fputs("ERROR: Cannot find testdata directory, set $SYSTEMD_TEST_DATA\n", stderr);
+ exit(1);
+ }
+ }
+
+ strncpy(testdir + strlen(testdir), suffix, sizeof(testdir) - strlen(testdir) - 1);
+ return testdir;
+}
--- /dev/null
+#pragma once
+
+/***
+ This file is part of systemd.
+
+ Copyright 2016 Lennart Poettering
+
+ systemd is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 of the License, or
+ (at your option) any later version.
+
+ systemd is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with systemd; If not, see <http://www.gnu.org/licenses/>.
+***/
+
+char* setup_fake_runtime_dir(void);
+const char* get_testdata_dir(const char *suffix);
#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);
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);
-int sd_bus_negotiate_fds(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);
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 */
-#if 0 /// UNNEEDED by elogind
int sd_bus_message_is_signal(sd_bus_message *m, const char *interface, const char *member);
-#endif // 0
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_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_pid_notify_with_fds(pid_t pid, int unset_environment, const char *state, const int *fds, unsigned n_fds);
-#if 0 /// UNNEEDED by elogind
/*
Returns > 0 if the system was booted with systemd. Returns < 0 on
error. Returns 0 if the system was not booted with systemd. Note
See sd_booted(3) for more information.
*/
int sd_booted(void);
-#endif // 0
/*
Returns > 0 if the service manager expects watchdog keep-alive
int sd_event_add_io(sd_event *e, sd_event_source **s, int fd, uint32_t events, sd_event_io_handler_t callback, void *userdata);
int sd_event_add_time(sd_event *e, sd_event_source **s, clockid_t clock, uint64_t usec, uint64_t accuracy, sd_event_time_handler_t callback, void *userdata);
int sd_event_add_signal(sd_event *e, sd_event_source **s, int sig, sd_event_signal_handler_t callback, void *userdata);
-#if 0 /// UNNEEDED by elogind
int sd_event_add_child(sd_event *e, sd_event_source **s, pid_t pid, int options, sd_event_child_handler_t callback, void *userdata);
int sd_event_add_defer(sd_event *e, sd_event_source **s, sd_event_handler_t callback, void *userdata);
-#endif // 0
int sd_event_add_post(sd_event *e, sd_event_source **s, sd_event_handler_t callback, void *userdata);
int sd_event_add_exit(sd_event *e, sd_event_source **s, sd_event_handler_t callback, void *userdata);
int sd_event_wait(sd_event *e, uint64_t usec);
int sd_event_dispatch(sd_event *e);
int sd_event_run(sd_event *e, uint64_t usec);
-#if 0 /// UNNEEDED by elogind
int sd_event_loop(sd_event *e);
-#endif // 0
int sd_event_exit(sd_event *e, int code);
-#if 0 /// UNNEEDED by elogind
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);
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);
-int sd_event_source_get_priority(sd_event_source *s, int64_t *priority);
#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);