along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <string.h>
-#include <unistd.h>
-#include <errno.h>
-#include <stdlib.h>
-#include <signal.h>
-#include <libintl.h>
-#include <stdio.h>
-#include <syslog.h>
-#include <sched.h>
-#include <sys/resource.h>
-#include <linux/sched.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <dirent.h>
-#include <sys/ioctl.h>
-#include <stdarg.h>
-#include <poll.h>
-#include <ctype.h>
-#include <sys/prctl.h>
-#include <sys/utsname.h>
-#include <pwd.h>
-#include <netinet/ip.h>
-#include <sys/wait.h>
-#include <sys/time.h>
-#include <glob.h>
-#include <grp.h>
-#include <sys/mman.h>
-#include <sys/vfs.h>
-#include <sys/mount.h>
-#include <linux/magic.h>
-#include <limits.h>
-#include <langinfo.h>
-#include <locale.h>
-#include <sys/personality.h>
-#include <sys/xattr.h>
-#include <sys/statvfs.h>
-#include <sys/file.h>
-#include <linux/fs.h>
+// #include <string.h>
+// #include <unistd.h>
+#include <errno.h>
+// #include <stdlib.h>
+// #include <signal.h>
+// #include <libintl.h>
+// #include <stdio.h>
+// #include <syslog.h>
+// #include <sched.h>
+// #include <sys/resource.h>
+// #include <linux/sched.h>
+// #include <sys/types.h>
+// #include <sys/stat.h>
+// #include <fcntl.h>
+// #include <dirent.h>
+// #include <sys/ioctl.h>
+// #include <stdarg.h>
+#include <poll.h>
+// #include <ctype.h>
+#include <sys/prctl.h>
+// #include <sys/utsname.h>
+#include <pwd.h>
+#include <netinet/ip.h>
+// #include <sys/wait.h>
+// #include <sys/time.h>
+// #include <glob.h>
+#include <grp.h>
+// #include <sys/mman.h>
+// #include <sys/vfs.h>
+// #include <sys/mount.h>
+#include <linux/magic.h>
+// #include <limits.h>
+#include <langinfo.h>
+// #include <locale.h>
+// #include <sys/personality.h>
+#include <sys/xattr.h>
+// #include <sys/statvfs.h>
+// #include <sys/file.h>
+#include <linux/fs.h>
/* When we include libgen.h because we need dirname() we immediately
* undefine basename() since libgen.h defines it as a macro to the POSIX
* version which is really broken. We prefer GNU basename(). */
-#include <libgen.h>
-#undef basename
+// #include <libgen.h>
+// #undef basename
#ifdef HAVE_SYS_AUXV_H
#include <sys/auxv.h>
#endif
-#include "config.h"
-#include "macro.h"
-#include "util.h"
-#include "ioprio.h"
-#include "missing.h"
-#include "log.h"
-#include "strv.h"
-#include "mkdir.h"
-#include "path-util.h"
-#include "exit-status.h"
-#include "hashmap.h"
-#include "env-util.h"
-#include "fileio.h"
-#include "device-nodes.h"
-#include "utf8.h"
-#include "gunicode.h"
-#include "virt.h"
-#include "def.h"
-#include "sparse-endian.h"
-#include "formats-util.h"
-#include "process-util.h"
-#include "random-util.h"
-#include "terminal-util.h"
-#include "hostname-util.h"
-#include "signal-util.h"
+#include "config.h"
+#include "macro.h"
+#include "util.h"
+#include "ioprio.h"
+// #include "missing.h"
+// #include "log.h"
+#include "strv.h"
+#include "mkdir.h"
+#include "path-util.h"
+// #include "exit-status.h"
+// #include "hashmap.h"
+// #include "env-util.h"
+#include "fileio.h"
+// #include "device-nodes.h"
+#include "utf8.h"
+#include "gunicode.h"
+#include "virt.h"
+// #include "def.h"
+#include "sparse-endian.h"
+// #include "formats-util.h"
+#include "process-util.h"
+#include "random-util.h"
+// #include "terminal-util.h"
+#include "hostname-util.h"
+#include "signal-util.h"
/* Put this test here for a lack of better place */
assert_cc(EAGAIN == EWOULDBLOCK);
return readlinkat_malloc(AT_FDCWD, p, ret);
}
+/// UNNEEDED by elogind
+#if 0
int readlink_value(const char *p, char **ret) {
_cleanup_free_ char *link = NULL;
char *value;
return 0;
}
+#endif // 0
int readlink_and_make_absolute(const char *p, char **r) {
_cleanup_free_ char *target = NULL;
return 0;
}
+/// UNNEEDED by elogind
+#if 0
int readlink_and_canonicalize(const char *p, char **r) {
char *t, *s;
int j;
return 0;
}
+#endif // 0
char *strstrip(char *s) {
char *e;
return ret;
}
+/// UNNEEDED by elogind
+#if 0
int rmdir_parents(const char *path, const char *stop) {
size_t l;
int r = 0;
return 0;
}
+#endif // 0
char hexchar(int x) {
static const char table[16] = "0123456789abcdef";
return r;
}
+/// UNNEEDED by elogind
+#if 0
char *ascii_strlower(char *t) {
char *p;
return t;
}
+#endif // 0
_pure_ static bool hidden_file_allow_backup(const char *filename) {
assert(filename);
return false;
}
+/// UNNEEDED by elogind
+#if 0
bool fstype_is_network(const char *fstype) {
static const char table[] =
"afs\0"
return nulstr_contains(table, fstype);
}
+#endif // 0
int flush_fd(int fd) {
struct pollfd pollfd = {
path_startswith(path, "/sys/");
}
+/// UNNEEDED by elogind
+#if 0
int dir_is_empty(const char *path) {
_cleanup_closedir_ DIR *d;
}
}
}
+#endif // 0
char *lookup_uid(uid_t uid) {
long bufsize;
return name;
}
+/// UNNEEDED by elogind
+#if 0
char* getlogname_malloc(void) {
uid_t uid;
struct stat st;
return lookup_uid(getuid());
}
+#endif // 0
bool is_temporary_fs(const struct statfs *s) {
assert(s);
return 0;
}
-#endif // 0
cpu_set_t* cpu_set_malloc(unsigned *ncpus) {
cpu_set_t *r;
n *= 2;
}
}
+#endif // 0
int files_same(const char *filea, const char *fileb) {
struct stat a, b;
a.st_ino == b.st_ino;
}
+/// UNNEEDED by elogind
+#if 0
int running_in_chroot(void) {
int ret;
return ret == 0;
}
+#endif // 0
static char *ascii_ellipsize_mem(const char *s, size_t old_length, size_t new_length, unsigned percent) {
size_t x;
return 0;
}
+/// UNNEEDED by elogind
+#if 0
int symlink_atomic(const char *from, const char *to) {
_cleanup_free_ char *t = NULL;
int r;
return 0;
}
-/// UNNEEDED by elogind
-#if 0
int symlink_idempotent(const char *from, const char *to) {
_cleanup_free_ char *p = NULL;
int r;
return in_gid(gid);
}
-#endif // 0
int glob_exists(const char *path) {
_cleanup_globfree_ glob_t g = {};
return errno ? -errno : -EIO;
}
-/// UNNEEDED by elogind
-#if 0
int glob_extend(char ***strv, const char *path) {
_cleanup_globfree_ glob_t g = {};
int k;
return cached > 0;
}
+/// UNNEEDED by elogind
+#if 0
int block_get_whole_disk(dev_t d, dev_t *ret) {
char *p, *s;
int r;
return -ENOENT;
}
+#endif // 0
static const char *const ioprio_class_table[] = {
[IOPRIO_CLASS_NONE] = "none",
return -EINVAL;
}
}
-#endif // 0
+
char *format_bytes(char *buf, size_t l, off_t t) {
unsigned i;
return buf;
}
+#endif // 0
void* memdup(const void *p, size_t l) {
void *r;
_exit(EXIT_FAILURE);
}
+/// UNNEEDED by elogind
+#if 0
int setrlimit_closest(int resource, const struct rlimit *rlim) {
struct rlimit highest, fixed;
return 0;
}
-/// UNNEEDED by elogind
-#if 0
bool http_etag_is_valid(const char *etag) {
if (isempty(etag))
return false;
return 0;
}
+/// UNNEEDED by elogind
+#if 0
int get_shell(char **_s) {
struct passwd *p;
const char *e;
*_s = s;
return 0;
}
+#endif // 0
bool filename_is_valid(const char *p) {
return draw_table[!is_locale_utf8()][ch];
}
+/// UNNEEDED by elogind
+#if 0
char *strreplace(const char *text, const char *old_string, const char *new_string) {
const char *f;
char *t, *r;
return found_online || !found_offline;
}
+#endif // 0
static int search_and_fopen_internal(const char *path, const char *mode, const char *root, char **search, FILE **_f) {
char **i;
return 0;
}
-/// UNNEEDED by elogind
-#if 0
int get_proc_cmdline_key(const char *key, char **value) {
_cleanup_free_ char *line = NULL, *ret = NULL;
bool found = false;
return found;
}
-#endif // 0
+/// UNNEEDED by elogind
+#if 0
int container_get_leader(const char *machine, pid_t *pid) {
_cleanup_free_ char *s = NULL, *class = NULL;
const char *p;
*pid = leader;
return 0;
}
+#endif // 0
int namespace_open(pid_t pid, int *pidns_fd, int *mntns_fd, int *netns_fd, int *root_fd) {
_cleanup_close_ int pidnsfd = -1, mntnsfd = -1, netnsfd = -1;
return fd;
}
+/// UNNEEDED by elogind
+#if 0
int open_tmpfile(const char *path, int flags) {
char *p;
int fd;
unlink(p);
return fd;
}
+#endif // 0
int fd_warn_permissions(const char *path, int fd) {
struct stat st;
}
#endif // 0
+/// UNNEEDED by elogind
+#if 0
const char* personality_to_string(unsigned long p) {
#if defined(__x86_64__)
return NULL;
}
+#endif // 0
uint64_t physical_memory(void) {
long mem;
s -= 16;
}
}
-#endif // 0
int update_reboot_param_file(const char *param) {
int r = 0;
}
}
}
+#endif // 0
int fflush_and_check(FILE *f) {
assert(f);
return fd;
}
-#endif // 0
int is_symlink(const char *path) {
struct stat info;
return !!S_ISLNK(info.st_mode);
}
+#endif // 0
int is_dir(const char* path, bool follow) {
struct stat st;
return 1;
}
+/// UNNEEDED by elogind
+#if 0
int unquote_first_word_and_warn(
const char **p,
char **ret,
return r;
}
-/// UNNEEDED by elogind
-#if 0
int unquote_many_words(const char **p, UnquoteFlags flags, ...) {
va_list ap;
char **l;
return 1;
}
+/// UNNEEDED by elogind
+#if 0
int ptsname_malloc(int fd, char **ret) {
size_t l = 100;
}
}
-/// UNNEEDED by elogind
-#if 0
int openpt_in_namespace(pid_t pid, int flags) {
_cleanup_close_ int pidnsfd = -1, mntnsfd = -1, rootfd = -1;
_cleanup_close_pair_ int pair[2] = { -1, -1 };
return parse_crtime(le, usec);
}
+/// UNNEEDED by elogind
+#if 0
int fd_getcrtime_at(int dirfd, const char *name, usec_t *usec, int flags) {
le64_t le;
ssize_t n;
return parse_crtime(le, usec);
}
-/// UNNEEDED by elogind
-#if 0
int path_getcrtime(const char *p, usec_t *usec) {
le64_t le;
ssize_t n;
return parse_crtime(le, usec);
}
-#endif // 0
int fd_setcrtime(int fd, usec_t usec) {
le64_t le;
return fa == fb;
}
+#endif // 0
int chattr_fd(int fd, unsigned value, unsigned mask) {
unsigned old_attr, new_attr;
return 1;
}
+/// UNNEEDED by elogind
+#if 0
int chattr_path(const char *p, unsigned value, unsigned mask) {
_cleanup_close_ int fd = -1;
return chattr_fd(fd, value, mask);
}
+#endif // 0
int read_attr_fd(int fd, unsigned *ret) {
struct stat st;
return 0;
}
+/// UNNEEDED by elogind
+#if 0
int read_attr_path(const char *p, unsigned *ret) {
_cleanup_close_ int fd = -1;
return read_attr_fd(fd, ret);
}
-/// UNNEEDED by elogind
-#if 0
static size_t nul_length(const uint8_t *p, size_t sz) {
size_t n = 0;
return -1;
}
+/// UNNEEDED by elogind
+#if 0
void cmsg_close_all(struct msghdr *mh) {
struct cmsghdr *cmsg;
return 0;
}
+#endif // 0
char *shell_maybe_quote(const char *s) {
const char *p;
return 0;
}
+/// UNNEEDED by elogind
+#if 0
int mount_move_root(const char *path) {
assert(path);
return 0;
}
+#endif // 0
int reset_uid_gid(void) {