- src/basic/capability-util.[hc]
- src/basic/cgroup-util.[hc]
- src/basic/fd-util.[hc]
- src/basic/fs-util.[hc]
- src/basic/memfd-util.[hc]
- src/basic/path-util.[hc]
- src/basic/socket-util.[hc]
- src/basic/terminal-util.[hc]
- src/basic/user-util.[hc]
- src/basic/xattr-util.[hc]
19 files changed:
#include "parse-util.h"
#include "util.h"
#include "parse-util.h"
#include "util.h"
+/// UNNEEDED by elogind
+#if 0
int have_effective_cap(int value) {
_cleanup_cap_free_ cap_t cap;
cap_flag_value_t fv;
int have_effective_cap(int value) {
_cleanup_cap_free_ cap_t cap;
cap_flag_value_t fv;
else
return fv == CAP_SET;
}
else
return fv == CAP_SET;
}
unsigned long cap_last_cap(void) {
static thread_local unsigned long saved;
unsigned long cap_last_cap(void) {
static thread_local unsigned long saved;
+/// UNNEEDED by elogind
+#if 0
int capability_bounding_set_drop(uint64_t drop, bool right_now) {
_cleanup_cap_free_ cap_t after_cap = NULL;
cap_flag_value_t fv;
int capability_bounding_set_drop(uint64_t drop, bool right_now) {
_cleanup_cap_free_ cap_t after_cap = NULL;
cap_flag_value_t fv;
#include "util.h"
unsigned long cap_last_cap(void);
#include "util.h"
unsigned long cap_last_cap(void);
-int have_effective_cap(int value);
-int capability_bounding_set_drop(uint64_t drop, bool right_now);
-int capability_bounding_set_drop_usermode(uint64_t drop);
+// UNNEEDED int have_effective_cap(int value);
+// UNNEEDED int capability_bounding_set_drop(uint64_t drop, bool right_now);
+// UNNEEDED int capability_bounding_set_drop_usermode(uint64_t drop);
-int drop_privileges(uid_t uid, gid_t gid, uint64_t keep_capabilities);
+// UNNEEDED int drop_privileges(uid_t uid, gid_t gid, uint64_t keep_capabilities);
-int drop_capability(cap_value_t cv);
+// UNNEEDED int drop_capability(cap_value_t cv);
+/// UNNEEDED by elogind
+#if 0
DEFINE_TRIVIAL_CLEANUP_FUNC(cap_t, cap_free);
#define _cleanup_cap_free_ _cleanup_(cap_freep)
DEFINE_TRIVIAL_CLEANUP_FUNC(cap_t, cap_free);
#define _cleanup_cap_free_ _cleanup_(cap_freep)
cap_free(*p);
}
#define _cleanup_cap_free_charp_ _cleanup_(cap_free_charpp)
cap_free(*p);
}
#define _cleanup_cap_free_charp_ _cleanup_(cap_free_charpp)
// UNNEEDED int cg_slice_to_path(const char *unit, char **ret);
// UNNEEDED int cg_slice_to_path(const char *unit, char **ret);
-typedef const char* (*cg_migrate_callback_t)(CGroupMask mask, void *userdata);
+// UNNEEDED typedef const char* (*cg_migrate_callback_t)(CGroupMask mask, void *userdata);
// UNNEEDED int cg_create_everywhere(CGroupMask supported, CGroupMask mask, const char *path);
// UNNEEDED int cg_attach_everywhere(CGroupMask supported, const char *path, pid_t pid, cg_migrate_callback_t callback, void *userdata);
// UNNEEDED int cg_create_everywhere(CGroupMask supported, CGroupMask mask, const char *path);
// UNNEEDED int cg_attach_everywhere(CGroupMask supported, const char *path, pid_t pid, cg_migrate_callback_t callback, void *userdata);
+/// UNNEEDED by elogind
+#if 0
DIR* safe_closedir(DIR *d) {
if (d) {
DIR* safe_closedir(DIR *d) {
if (d) {
int fd_nonblock(int fd, bool nonblock) {
int flags, nflags;
int fd_nonblock(int fd, bool nonblock) {
int flags, nflags;
+/// UNNEEDED by elogind
+#if 0
int same_fd(int a, int b) {
struct stat sta, stb;
pid_t pid;
int same_fd(int a, int b) {
struct stat sta, stb;
pid_t pid;
int fclose_nointr(FILE *f);
FILE* safe_fclose(FILE *f);
int fclose_nointr(FILE *f);
FILE* safe_fclose(FILE *f);
-DIR* safe_closedir(DIR *f);
+// UNNEEDED DIR* safe_closedir(DIR *f);
static inline void closep(int *fd) {
safe_close(*fd);
static inline void closep(int *fd) {
safe_close(*fd);
int close_all_fds(const int except[], unsigned n_except);
int close_all_fds(const int except[], unsigned n_except);
-int same_fd(int a, int b);
+// UNNEEDED int same_fd(int a, int b);
-void cmsg_close_all(struct msghdr *mh);
+// UNNEEDED void cmsg_close_all(struct msghdr *mh);
-bool fdname_is_valid(const char *s);
+// UNNEEDED bool fdname_is_valid(const char *s);
int readlink_and_make_absolute(const char *p, char **r) {
_cleanup_free_ char *target = NULL;
int readlink_and_make_absolute(const char *p, char **r) {
_cleanup_free_ char *target = NULL;
-/// UNNEEDED by elogind
-#if 0
int readlink_and_canonicalize(const char *p, char **r) {
char *t, *s;
int j;
int readlink_and_canonicalize(const char *p, char **r) {
char *t, *s;
int j;
+/// UNNEEDED by elogind
+#if 0
int fchmod_and_fchown(int fd, mode_t mode, uid_t uid, gid_t gid) {
assert(fd >= 0);
int fchmod_and_fchown(int fd, mode_t mode, uid_t uid, gid_t gid) {
assert(fd >= 0);
int fchmod_umask(int fd, mode_t m) {
mode_t u;
int fchmod_umask(int fd, mode_t m) {
mode_t u;
return touch_file(path, false, USEC_INFINITY, UID_INVALID, GID_INVALID, MODE_INVALID);
}
return touch_file(path, false, USEC_INFINITY, UID_INVALID, GID_INVALID, MODE_INVALID);
}
+/// UNNEEDED by elogind
+#if 0
int symlink_idempotent(const char *from, const char *to) {
_cleanup_free_ char *p = NULL;
int r;
int symlink_idempotent(const char *from, const char *to) {
_cleanup_free_ char *p = NULL;
int r;
int get_files_in_directory(const char *path, char ***list) {
_cleanup_closedir_ DIR *d = NULL;
int get_files_in_directory(const char *path, char ***list) {
_cleanup_closedir_ DIR *d = NULL;
int readlinkat_malloc(int fd, const char *p, char **ret);
int readlink_malloc(const char *p, char **r);
// UNNEEDED int readlink_value(const char *p, char **ret);
int readlinkat_malloc(int fd, const char *p, char **ret);
int readlink_malloc(const char *p, char **r);
// UNNEEDED int readlink_value(const char *p, char **ret);
-int readlink_and_make_absolute(const char *p, char **r);
+// UNNEEDED int readlink_and_make_absolute(const char *p, char **r);
// UNNEEDED int readlink_and_canonicalize(const char *p, char **r);
// UNNEEDED int readlink_and_make_absolute_root(const char *root, const char *path, char **ret);
int chmod_and_chown(const char *path, mode_t mode, uid_t uid, gid_t gid);
// UNNEEDED int readlink_and_canonicalize(const char *p, char **r);
// UNNEEDED int readlink_and_make_absolute_root(const char *root, const char *path, char **ret);
int chmod_and_chown(const char *path, mode_t mode, uid_t uid, gid_t gid);
-int fchmod_and_fchown(int fd, mode_t mode, uid_t uid, gid_t gid);
+// UNNEEDED int fchmod_and_fchown(int fd, mode_t mode, uid_t uid, gid_t gid);
int fchmod_umask(int fd, mode_t mode);
int fchmod_umask(int fd, mode_t mode);
int touch_file(const char *path, bool parents, usec_t stamp, uid_t uid, gid_t gid, mode_t mode);
int touch(const char *path);
int touch_file(const char *path, bool parents, usec_t stamp, uid_t uid, gid_t gid, mode_t mode);
int touch(const char *path);
-int symlink_idempotent(const char *from, const char *to);
+// UNNEEDED int symlink_idempotent(const char *from, const char *to);
-int symlink_atomic(const char *from, const char *to);
-int mknod_atomic(const char *path, mode_t mode, dev_t dev);
-int mkfifo_atomic(const char *path, mode_t mode);
+// UNNEEDED int symlink_atomic(const char *from, const char *to);
+// UNNEEDED int mknod_atomic(const char *path, mode_t mode, dev_t dev);
+// UNNEEDED int mkfifo_atomic(const char *path, mode_t mode);
int get_files_in_directory(const char *path, char ***list);
int get_files_in_directory(const char *path, char ***list);
+/// UNNEEDED by elogind
+#if 0
#define INOTIFY_EVENT_MAX (sizeof(struct inotify_event) + NAME_MAX + 1)
#define FOREACH_INOTIFY_EVENT(e, buffer, sz) \
#define INOTIFY_EVENT_MAX (sizeof(struct inotify_event) + NAME_MAX + 1)
#define FOREACH_INOTIFY_EVENT(e, buffer, sz) \
struct inotify_event ev;
uint8_t raw[INOTIFY_EVENT_MAX];
};
struct inotify_event ev;
uint8_t raw[INOTIFY_EVENT_MAX];
};
+/// UNNEEDED by elogind
+#if 0
int memfd_get_sealed(int fd) {
int r;
int memfd_get_sealed(int fd) {
int r;
// UNNEEDED int memfd_map(int fd, uint64_t offset, size_t size, void **p);
int memfd_set_sealed(int fd);
// UNNEEDED int memfd_map(int fd, uint64_t offset, size_t size, void **p);
int memfd_set_sealed(int fd);
-int memfd_get_sealed(int fd);
+// UNNEEDED int memfd_get_sealed(int fd);
// UNNEEDED int memfd_get_size(int fd, uint64_t *sz);
int memfd_set_size(int fd, uint64_t sz);
// UNNEEDED int memfd_get_size(int fd, uint64_t *sz);
int memfd_set_size(int fd, uint64_t sz);
char *path_make_absolute(const char *p, const char *prefix) {
assert(p);
char *path_make_absolute(const char *p, const char *prefix) {
assert(p);
return strjoin(prefix, "/", p, NULL);
}
return strjoin(prefix, "/", p, NULL);
}
int path_make_absolute_cwd(const char *p, char **ret) {
char *c;
int path_make_absolute_cwd(const char *p, char **ret) {
char *c;
strcpy(p, path);
return n;
}
strcpy(p, path);
return n;
}
int parse_path_argument_and_warn(const char *path, bool suppress_root, char **arg) {
char *p;
int parse_path_argument_and_warn(const char *path, bool suppress_root, char **arg) {
char *p;
char* dirname_malloc(const char *path) {
char *d, *dir, *dir2;
char* dirname_malloc(const char *path) {
char *d, *dir, *dir2;
return hidden_file_allow_backup(filename);
}
return hidden_file_allow_backup(filename);
}
+/// UNNEEDED by elogind
+#if 0
bool is_device_path(const char *path) {
/* Returns true on paths that refer to a device, either in
bool is_device_path(const char *path) {
/* Returns true on paths that refer to a device, either in
path_startswith(path, "/dev/") ||
path_startswith(path, "/sys/");
}
path_startswith(path, "/dev/") ||
path_startswith(path, "/sys/");
}
bool is_path(const char *p) _pure_;
// UNNEEDED int path_split_and_make_absolute(const char *p, char ***ret);
bool path_is_absolute(const char *p) _pure_;
bool is_path(const char *p) _pure_;
// UNNEEDED int path_split_and_make_absolute(const char *p, char ***ret);
bool path_is_absolute(const char *p) _pure_;
-char* path_make_absolute(const char *p, const char *prefix);
+// UNNEEDED char* path_make_absolute(const char *p, const char *prefix);
int path_make_absolute_cwd(const char *p, char **ret);
// UNNEEDED int path_make_relative(const char *from_dir, const char *to_path, char **_r);
char* path_kill_slashes(char *path);
int path_make_absolute_cwd(const char *p, char **ret);
// UNNEEDED int path_make_relative(const char *from_dir, const char *to_path, char **_r);
char* path_kill_slashes(char *path);
// UNNEEDED bool paths_check_timestamp(const char* const* paths, usec_t *paths_ts_usec, bool update);
// UNNEEDED int fsck_exists(const char *fstype);
// UNNEEDED bool paths_check_timestamp(const char* const* paths, usec_t *paths_ts_usec, bool update);
// UNNEEDED int fsck_exists(const char *fstype);
-int mkfs_exists(const char *fstype);
+// UNNEEDED int mkfs_exists(const char *fstype);
/* Iterates through the path prefixes of the specified path, going up
* the tree, to root. Also returns "" (and not "/"!) for the root
/* Iterates through the path prefixes of the specified path, going up
* the tree, to root. Also returns "" (and not "/"!) for the root
-int parse_path_argument_and_warn(const char *path, bool suppress_root, char **arg);
+// UNNEEDED int parse_path_argument_and_warn(const char *path, bool suppress_root, char **arg);
char* dirname_malloc(const char *path);
char* dirname_malloc(const char *path);
bool hidden_file_allow_backup(const char *filename);
bool hidden_file(const char *filename) _pure_;
bool hidden_file_allow_backup(const char *filename);
bool hidden_file(const char *filename) _pure_;
-bool is_device_path(const char *path);
+// UNNEEDED bool is_device_path(const char *path);
#include "user-util.h"
#include "util.h"
#include "user-util.h"
#include "util.h"
+/// UNNEEDED by elogind
+#if 0
int socket_address_parse(SocketAddress *a, const char *s) {
char *e, *n;
unsigned u;
int socket_address_parse(SocketAddress *a, const char *s) {
char *e, *n;
unsigned u;
return a->sockaddr.un.sun_path;
}
return a->sockaddr.un.sun_path;
}
bool socket_ipv6_is_supported(void) {
_cleanup_free_ char *l = NULL;
bool socket_ipv6_is_supported(void) {
_cleanup_free_ char *l = NULL;
+/// UNNEEDED by elogind
+#if 0
bool socket_address_matches_fd(const SocketAddress *a, int fd) {
SocketAddress b;
socklen_t solen;
bool socket_address_matches_fd(const SocketAddress *a, int fd) {
SocketAddress b;
socklen_t solen;
int fd_inc_sndbuf(int fd, size_t n) {
int r, value;
int fd_inc_sndbuf(int fd, size_t n) {
int r, value;
+/// UNNEEDED by elogind
+#if 0
static const char* const ip_tos_table[] = {
[IPTOS_LOWDELAY] = "low-delay",
[IPTOS_THROUGHPUT] = "throughput",
static const char* const ip_tos_table[] = {
[IPTOS_LOWDELAY] = "low-delay",
[IPTOS_THROUGHPUT] = "throughput",
};
DEFINE_STRING_TABLE_LOOKUP_WITH_FALLBACK(ip_tos, int, 0xff);
};
DEFINE_STRING_TABLE_LOOKUP_WITH_FALLBACK(ip_tos, int, 0xff);
int getpeercred(int fd, struct ucred *ucred) {
socklen_t n = sizeof(struct ucred);
int getpeercred(int fd, struct ucred *ucred) {
socklen_t n = sizeof(struct ucred);
+/// UNNEEDED by elogind
+#if 0
int receive_one_fd(int transport_fd, int flags) {
union {
struct cmsghdr cmsghdr;
int receive_one_fd(int transport_fd, int flags) {
union {
struct cmsghdr cmsghdr;
return *(int*) CMSG_DATA(found);
}
return *(int*) CMSG_DATA(found);
}
struct sockaddr_ll ll;
};
struct sockaddr_ll ll;
};
+/// UNNEEDED by elogind
+#if 0
typedef struct SocketAddress {
union sockaddr_union sockaddr;
typedef struct SocketAddress {
union sockaddr_union sockaddr;
} SocketAddressBindIPv6Only;
#define socket_address_family(a) ((a)->sockaddr.sa.sa_family)
} SocketAddressBindIPv6Only;
#define socket_address_family(a) ((a)->sockaddr.sa.sa_family)
-int socket_address_parse(SocketAddress *a, const char *s);
-int socket_address_parse_and_warn(SocketAddress *a, const char *s);
-int socket_address_parse_netlink(SocketAddress *a, const char *s);
-int socket_address_print(const SocketAddress *a, char **p);
-int socket_address_verify(const SocketAddress *a) _pure_;
-int socket_address_unlink(SocketAddress *a);
+// UNNEEDED int socket_address_parse(SocketAddress *a, const char *s);
+// UNNEEDED int socket_address_parse_and_warn(SocketAddress *a, const char *s);
+// UNNEEDED int socket_address_parse_netlink(SocketAddress *a, const char *s);
+// UNNEEDED int socket_address_print(const SocketAddress *a, char **p);
+// UNNEEDED int socket_address_verify(const SocketAddress *a) _pure_;
+// UNNEEDED int socket_address_unlink(SocketAddress *a);
-bool socket_address_can_accept(const SocketAddress *a) _pure_;
+// UNNEEDED bool socket_address_can_accept(const SocketAddress *a) _pure_;
+/// UNNEEDED by elogind
+#if 0
int socket_address_listen(
const SocketAddress *a,
int flags,
int socket_address_listen(
const SocketAddress *a,
int flags,
mode_t socket_mode,
const char *label);
int make_socket_fd(int log_level, const char* address, int flags);
mode_t socket_mode,
const char *label);
int make_socket_fd(int log_level, const char* address, int flags);
-bool socket_address_is(const SocketAddress *a, const char *s, int type);
-bool socket_address_is_netlink(const SocketAddress *a, const char *s);
+// UNNEEDED bool socket_address_is(const SocketAddress *a, const char *s, int type);
+// UNNEEDED bool socket_address_is_netlink(const SocketAddress *a, const char *s);
-bool socket_address_matches_fd(const SocketAddress *a, int fd);
+// UNNEEDED bool socket_address_matches_fd(const SocketAddress *a, int fd);
-bool socket_address_equal(const SocketAddress *a, const SocketAddress *b) _pure_;
+// UNNEEDED bool socket_address_equal(const SocketAddress *a, const SocketAddress *b) _pure_;
-const char* socket_address_get_path(const SocketAddress *a);
+// UNNEEDED const char* socket_address_get_path(const SocketAddress *a);
bool socket_ipv6_is_supported(void);
bool socket_ipv6_is_supported(void);
-int sockaddr_port(const struct sockaddr *_sa) _pure_;
+// UNNEEDED int sockaddr_port(const struct sockaddr *_sa) _pure_;
-int sockaddr_pretty(const struct sockaddr *_sa, socklen_t salen, bool translate_ipv6, bool include_port, char **ret);
-int getpeername_pretty(int fd, char **ret);
-int getsockname_pretty(int fd, char **ret);
+// UNNEEDED Sint sockaddr_pretty(const struct sockaddr *_sa, socklen_t salen, bool translate_ipv6, bool include_port, char **ret);
+// UNNEEDED int getpeername_pretty(int fd, char **ret);
+// UNNEEDED int getsockname_pretty(int fd, char **ret);
-int socknameinfo_pretty(union sockaddr_union *sa, socklen_t salen, char **_ret);
-int getnameinfo_pretty(int fd, char **ret);
+// UNNEEDED int socknameinfo_pretty(union sockaddr_union *sa, socklen_t salen, char **_ret);
+// UNNEEDED int getnameinfo_pretty(int fd, char **ret);
-const char* socket_address_bind_ipv6_only_to_string(SocketAddressBindIPv6Only b) _const_;
-SocketAddressBindIPv6Only socket_address_bind_ipv6_only_from_string(const char *s) _pure_;
+// UNNEEDED const char* socket_address_bind_ipv6_only_to_string(SocketAddressBindIPv6Only b) _const_;
+// UNNEEDED SocketAddressBindIPv6Only socket_address_bind_ipv6_only_from_string(const char *s) _pure_;
-int netlink_family_to_string_alloc(int b, char **s);
-int netlink_family_from_string(const char *s) _pure_;
+// UNNEEDED int netlink_family_to_string_alloc(int b, char **s);
+// UNNEEDED int netlink_family_from_string(const char *s) _pure_;
-bool sockaddr_equal(const union sockaddr_union *a, const union sockaddr_union *b);
+// UNNEEDED bool sockaddr_equal(const union sockaddr_union *a, const union sockaddr_union *b);
int fd_inc_sndbuf(int fd, size_t n);
int fd_inc_rcvbuf(int fd, size_t n);
int fd_inc_sndbuf(int fd, size_t n);
int fd_inc_rcvbuf(int fd, size_t n);
-int ip_tos_to_string_alloc(int i, char **s);
-int ip_tos_from_string(const char *s);
+// UNNEEDED int ip_tos_to_string_alloc(int i, char **s);
+// UNNEEDED int ip_tos_from_string(const char *s);
int getpeercred(int fd, struct ucred *ucred);
int getpeersec(int fd, char **ret);
int send_one_fd(int transport_fd, int fd, int flags);
int getpeercred(int fd, struct ucred *ucred);
int getpeersec(int fd, char **ret);
int send_one_fd(int transport_fd, int fd, int flags);
-int receive_one_fd(int transport_fd, int flags);
+// UNNEEDED int receive_one_fd(int transport_fd, int flags);
#define CMSG_FOREACH(cmsg, mh) \
for ((cmsg) = CMSG_FIRSTHDR(mh); (cmsg); (cmsg) = CMSG_NXTHDR((mh), (cmsg)))
#define CMSG_FOREACH(cmsg, mh) \
for ((cmsg) = CMSG_FIRSTHDR(mh); (cmsg); (cmsg) = CMSG_NXTHDR((mh), (cmsg)))
+/// UNNEEDED by elogind
+#if 0
int read_one_char(FILE *f, char *ret, usec_t t, bool *need_nl) {
struct termios old_termios, new_termios;
char c, line[LINE_MAX];
int read_one_char(FILE *f, char *ret, usec_t t, bool *need_nl) {
struct termios old_termios, new_termios;
char c, line[LINE_MAX];
-/// UNNEEDED by elogind
-#if 0
int ask_char(char *ret, const char *replies, const char *text, ...) {
int r;
int ask_char(char *ret, const char *replies, const char *text, ...) {
int r;
int reset_terminal_fd(int fd, bool switch_to_text) {
struct termios termios;
int reset_terminal_fd(int fd, bool switch_to_text) {
struct termios termios;
return reset_terminal_fd(fd, true);
}
return reset_terminal_fd(fd, true);
}
int open_terminal(const char *name, int mode) {
int fd, r;
int open_terminal(const char *name, int mode) {
int fd, r;
+/// UNNEEDED by elogind
+#if 0
int acquire_terminal(
const char *name,
bool fail,
int acquire_terminal(
const char *name,
bool fail,
/// UNNEEDED by elogind
#if 0
/// UNNEEDED by elogind
#if 0
int terminal_vhangup_fd(int fd) {
assert(fd >= 0);
int terminal_vhangup_fd(int fd) {
assert(fd >= 0);
-/// UNNEEDED by elogind
-#if 0
int make_console_stdio(void) {
int fd, r;
int make_console_stdio(void) {
int fd, r;
+/// UNNEEDED by elogind
+#if 0
char *resolve_dev_console(char **active) {
char *tty;
char *resolve_dev_console(char **active) {
char *tty;
-/// UNNEEDED by elogind
-#if 0
const char *default_term_for_tty(const char *tty) {
assert(tty);
const char *default_term_for_tty(const char *tty) {
assert(tty);
/* Set cursor to top left corner and clear screen */
#define ANSI_HOME_CLEAR "\x1B[H\x1B[2J"
/* Set cursor to top left corner and clear screen */
#define ANSI_HOME_CLEAR "\x1B[H\x1B[2J"
-int reset_terminal_fd(int fd, bool switch_to_text);
-int reset_terminal(const char *name);
+// UNNEEDED int reset_terminal_fd(int fd, bool switch_to_text);
+// UNNEEDED int reset_terminal(const char *name);
int open_terminal(const char *name, int mode);
int open_terminal(const char *name, int mode);
-int acquire_terminal(const char *name, bool fail, bool force, bool ignore_tiocstty_eperm, usec_t timeout);
+// UNNEEDED int acquire_terminal(const char *name, bool fail, bool force, bool ignore_tiocstty_eperm, usec_t timeout);
// UNNEEDED int release_terminal(void);
// UNNEEDED int release_terminal(void);
-int terminal_vhangup_fd(int fd);
-int terminal_vhangup(const char *name);
+// UNNEEDED int terminal_vhangup_fd(int fd);
+// UNNEEDED int terminal_vhangup(const char *name);
-int read_one_char(FILE *f, char *ret, usec_t timeout, bool *need_nl);
+// UNNEEDED int read_one_char(FILE *f, char *ret, usec_t timeout, bool *need_nl);
// UNNEEDED int ask_char(char *ret, const char *replies, const char *text, ...) _printf_(3, 4);
// UNNEEDED int ask_string(char **ret, const char *text, ...) _printf_(2, 3);
// UNNEEDED int ask_char(char *ret, const char *replies, const char *text, ...) _printf_(3, 4);
// UNNEEDED int ask_string(char **ret, const char *text, ...) _printf_(2, 3);
-int vt_disallocate(const char *name);
+// UNNEEDED int vt_disallocate(const char *name);
-char *resolve_dev_console(char **active);
+// UNNEEDED char *resolve_dev_console(char **active);
bool tty_is_vc(const char *tty);
bool tty_is_vc(const char *tty);
-bool tty_is_vc_resolve(const char *tty);
+// UNNEEDED bool tty_is_vc_resolve(const char *tty);
bool tty_is_console(const char *tty) _pure_;
int vtnr_from_tty(const char *tty);
// UNNEEDED const char *default_term_for_tty(const char *tty);
bool tty_is_console(const char *tty) _pure_;
int vtnr_from_tty(const char *tty);
// UNNEEDED const char *default_term_for_tty(const char *tty);
+/// UNNEEDED by elogind
+#if 0
char* getlogname_malloc(void) {
uid_t uid;
struct stat st;
char* getlogname_malloc(void) {
uid_t uid;
struct stat st;
return uid_to_name(getuid());
}
return uid_to_name(getuid());
}
int get_user_creds(
const char **username,
int get_user_creds(
const char **username,
+/// UNNEEDED by elogind
+#if 0
int in_gid(gid_t gid) {
gid_t *gids;
int ngroups_max, r, i;
int in_gid(gid_t gid) {
gid_t *gids;
int ngroups_max, r, i;
int reset_uid_gid(void) {
int reset_uid_gid(void) {
+/// UNNEEDED by elogind
+#if 0
int take_etc_passwd_lock(const char *root) {
struct flock flock = {
int take_etc_passwd_lock(const char *root) {
struct flock flock = {
return parse_uid(s, (uid_t*) ret_gid);
}
return parse_uid(s, (uid_t*) ret_gid);
}
-char* getlogname_malloc(void);
-char* getusername_malloc(void);
+// UNNEEDED char* getlogname_malloc(void);
+// UNNEEDED char* getusername_malloc(void);
int get_user_creds(const char **username, uid_t *uid, gid_t *gid, const char **home, const char **shell);
int get_group_creds(const char **groupname, gid_t *gid);
int get_user_creds(const char **username, uid_t *uid, gid_t *gid, const char **home, const char **shell);
int get_group_creds(const char **groupname, gid_t *gid);
char* uid_to_name(uid_t uid);
char* gid_to_name(gid_t gid);
char* uid_to_name(uid_t uid);
char* gid_to_name(gid_t gid);
-int in_gid(gid_t gid);
-int in_group(const char *name);
+// UNNEEDED int in_gid(gid_t gid);
+// UNNEEDED int in_group(const char *name);
-int get_home_dir(char **ret);
-int get_shell(char **_ret);
+// UNNEEDED int get_home_dir(char **ret);
+// UNNEEDED int get_shell(char **_ret);
-int take_etc_passwd_lock(const char *root);
+// UNNEEDED int take_etc_passwd_lock(const char *root);
#define UID_INVALID ((uid_t) -1)
#define GID_INVALID ((gid_t) -1)
#define UID_INVALID ((uid_t) -1)
#define GID_INVALID ((gid_t) -1)
+/// UNNEEDED by elogind
+#if 0
ssize_t fgetxattrat_fake(int dirfd, const char *filename, const char *attribute, void *value, size_t size, int flags) {
char fn[strlen("/proc/self/fd/") + DECIMAL_STR_MAX(int) + 1];
_cleanup_close_ int fd = -1;
ssize_t fgetxattrat_fake(int dirfd, const char *filename, const char *attribute, void *value, size_t size, int flags) {
char fn[strlen("/proc/self/fd/") + DECIMAL_STR_MAX(int) + 1];
_cleanup_close_ int fd = -1;
-/// UNNEEDED by elogind
-#if 0
static int parse_crtime(le64_t le, usec_t *usec) {
uint64_t u;
static int parse_crtime(le64_t le, usec_t *usec) {
uint64_t u;
int getxattr_malloc(const char *path, const char *name, char **value, bool allow_symlink);
int fgetxattr_malloc(int fd, const char *name, char **value);
int getxattr_malloc(const char *path, const char *name, char **value, bool allow_symlink);
int fgetxattr_malloc(int fd, const char *name, char **value);
-ssize_t fgetxattrat_fake(int dirfd, const char *filename, const char *attribute, void *value, size_t size, int flags);
+// UNNEEDED ssize_t fgetxattrat_fake(int dirfd, const char *filename, const char *attribute, void *value, size_t size, int flags);
// UNNEEDED int fd_setcrtime(int fd, usec_t usec);
// UNNEEDED int fd_setcrtime(int fd, usec_t usec);