diff options
author | Mattias Andrée <m@maandree.se> | 2025-01-29 17:13:01 +0100 |
---|---|---|
committer | Mattias Andrée <m@maandree.se> | 2025-01-29 17:13:01 +0100 |
commit | 6f482050228eef81a2021dad887fd9b7d8563120 (patch) | |
tree | fa5e25c6ef28293ac1819c6de3428cb87da162b9 | |
parent | Update e-mail (diff) | |
download | alsause-6f482050228eef81a2021dad887fd9b7d8563120.tar.gz alsause-6f482050228eef81a2021dad887fd9b7d8563120.tar.bz2 alsause-6f482050228eef81a2021dad887fd9b7d8563120.tar.xz |
Fix support for when libc does not implement open_tree or move_mount
Signed-off-by: Mattias Andrée <m@maandree.se>
-rw-r--r-- | alsause.c | 28 |
1 files changed, 28 insertions, 0 deletions
@@ -1,5 +1,15 @@ /* See LICENSE file for copyright and license details. */ #include <sys/mount.h> +#ifndef OPEN_TREE_CLONE +# define MISSING_OPEN_TREE +#endif +#ifndef MOVE_MOUNT_F_EMPTY_PATH +# define MISSING_MOVE_MOUNT +#endif +#if defined(MISSING_OPEN_TREE) || defined(MISSING_MOVE_MOUNT) +# include <linux/mount.h> +# include <sys/syscall.h> +#endif #include <sched.h> #include <alsa/asoundlib.h> #include <libsimple.h> @@ -8,6 +18,24 @@ NUSAGE(125, "[(-r | name | card:device) [command [argument] ...]]"); +#ifdef MISSING_OPEN_TREE_CLONE +static int +open_tree(int dirfd, const char *path, int flags) +{ + return syscall(SYS_open_tree, dirfd, path, flags); +} +#endif + + +#ifdef MISSING_MOVE_MOUNT +static int +move_mount(int dirfd1, const char *path1, int dirfd2, const char *path2, int flags) +{ + return syscall(SYS_move_mount, dirfd1, path1, dirfd2, path2, flags); +} +#endif + + static char * get_config_path(void) { |