Skip to content

Commit

Permalink
Define the mount_attr struct ourselves since some toolchains don't ha…
Browse files Browse the repository at this point in the history
…ve it yet
  • Loading branch information
rocallahan committed Jan 27, 2025
1 parent 033ab32 commit 9b4ce68
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/test/fsmount.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,15 @@
#include "nsutils.h"
#include "util.h"

#include <linux/mount.h>
#include <sys/mount.h>

struct rr_mount_attr {
uint64_t attr_set;
uint64_t attr_clr;
uint64_t propagation;
uint64_t userns_fd;
};

int main(void) {
if (try_setup_ns(CLONE_NEWNS) < 0) {
atomic_puts("EXIT-SUCCESS");
Expand All @@ -24,7 +30,7 @@ int main(void) {
ret = syscall(RR_move_mount, mnt_fd, "", AT_FDCWD, "/tmp", MOVE_MOUNT_F_EMPTY_PATH);
test_assert(ret == 0);

struct mount_attr attr;
struct rr_mount_attr attr;
memset(&attr, 0, sizeof(attr));
ret = syscall(RR_mount_setattr, mnt_fd, "", AT_EMPTY_PATH, &attr, sizeof(attr));
test_assert(ret == 0);
Expand Down

0 comments on commit 9b4ce68

Please sign in to comment.