From 6f482050228eef81a2021dad887fd9b7d8563120 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Wed, 29 Jan 2025 17:13:01 +0100 Subject: Fix support for when libc does not implement open_tree or move_mount MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- alsause.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) 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 +#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 +# include +#endif #include #include #include @@ -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) { -- cgit v1.2.3-70-g09d2