aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <m@maandree.se>2025-01-29 17:13:01 +0100
committerMattias Andrée <m@maandree.se>2025-01-29 17:13:01 +0100
commit6f482050228eef81a2021dad887fd9b7d8563120 (patch)
treefa5e25c6ef28293ac1819c6de3428cb87da162b9
parentUpdate e-mail (diff)
downloadalsause-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.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/alsause.c b/alsause.c
index e157e71..57d9ff7 100644
--- a/alsause.c
+++ b/alsause.c
@@ -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)
{