aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--LICENSE2
-rw-r--r--alsause.c30
2 files changed, 30 insertions, 2 deletions
diff --git a/LICENSE b/LICENSE
index fccd785..46cd895 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,6 +1,6 @@
ISC License
-© 2024 Mattias Andrée <maandree@kth.se>
+© 2024, 2025 Mattias Andrée <m@maandree.se>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
diff --git a/alsause.c b/alsause.c
index e157e71..5cb923d 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
+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)
{
@@ -277,7 +305,7 @@ main(int argc, char *argv[])
treefd = open_tree(AT_FDCWD, temppath, OPEN_TREE_CLONE | OPEN_TREE_CLOEXEC);
if (treefd < 0) {
- weprintf("open_tree AT_FDCWD %s OPEN_TREE_CLONE:", temppath);
+ weprintf("open_tree AT_FDCWD %s OPEN_TREE_CLONE|OPEN_TREE_CLOEXEC:", temppath);
unlink(temppath);
exit(libsimple_default_failure_exit);
}