chiark / gitweb /
Add support for building elogind against musl libc
[elogind.git] / src / basic / util.h
index afe5ec6a5e415fa7f2e8f302b6046fe2a8997273..254e94ce8054ac0f4dc1f75806701ac1c4bfacdc 100644 (file)
@@ -375,7 +375,7 @@ DEFINE_TRIVIAL_CLEANUP_FUNC(cpu_set_t*, CPU_FREE);
 
 int files_same(const char *filea, const char *fileb);
 
-// UNNEEDED int running_in_chroot(void);
+int running_in_chroot(void);
 
 char *ellipsize(const char *s, size_t length, unsigned percent);
                                    /* bytes                 columns */
@@ -394,7 +394,7 @@ DIR *xopendirat(int dirfd, const char *name, int flags);
 
 // UNNEEDED char *fstab_node_to_udev_node(const char *p);
 
-// UNNEEDED void execute_directories(const char* const* directories, usec_t timeout, char *argv[]);
+void execute_directories(const char* const* directories, usec_t timeout, char *argv[]);
 
 bool nulstr_contains(const char*nulstr, const char *needle);
 
@@ -890,7 +890,11 @@ union inotify_event_buffer {
         uint8_t raw[INOTIFY_EVENT_MAX];
 };
 
-#define laccess(path, mode) faccessat(AT_FDCWD, (path), (mode), AT_SYMLINK_NOFOLLOW)
+#ifdef __GLIBC__
+ #define laccess(path, mode) faccessat(AT_FDCWD, (path), (mode), AT_SYMLINK_NOFOLLOW)
+#else
+ #define laccess(path, mode) faccessat(AT_FDCWD, (path), (mode), 0)
+#endif
 
 // UNNEEDED int ptsname_malloc(int fd, char **ret);
 
@@ -924,8 +928,8 @@ void sigkill_wait(pid_t *pid);
 
 // UNNEEDED int rename_noreplace(int olddirfd, const char *oldpath, int newdirfd, const char *newpath);
 
-char *shell_escape(const char *s, const char *bad);
-char *shell_maybe_quote(const char *s);
+// UNNEEDED char *shell_escape(const char *s, const char *bad);
+// UNNEEDED char *shell_maybe_quote(const char *s);
 
 int parse_mode(const char *s, mode_t *ret);