Skip to content

Commit 1f1b2a2

Browse files
committed
tests: e2e: add syscall wrappers for new APIs in setuserns
1 parent 18d17d0 commit 1f1b2a2

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

tests/e2e/setuserns.c

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,38 @@
1212
#include <stdio.h>
1313
#include <stdlib.h>
1414
#include <string.h>
15-
#include <sys/mount.h>
1615
#include <sys/socket.h>
1716
#include <sys/un.h>
1817
#include <unistd.h>
1918

2019
#include "bpfilter/helper.h"
2120
#include "bpfilter/logger.h"
2221

22+
static inline int fsopen(const char *fsname, unsigned int flags)
23+
{
24+
return (int)syscall(__NR_fsopen, fsname, flags);
25+
}
26+
27+
static inline int fsconfig(int fd, unsigned int cmd, const char *key,
28+
const char *value, int aux)
29+
{
30+
return (int)syscall(__NR_fsconfig, fd, cmd, key, value, aux);
31+
}
32+
33+
static inline int fsmount(int fd, unsigned int flags,
34+
unsigned int attr_flags)
35+
{
36+
return (int)syscall(__NR_fsmount, fd, flags, attr_flags);
37+
}
38+
39+
static inline int move_mount(int from_dirfd, const char *from_pathname,
40+
int to_dirfd, const char *to_pathname,
41+
unsigned int flags)
42+
{
43+
return (int)syscall(__NR_move_mount, from_dirfd, from_pathname,
44+
to_dirfd, to_pathname, flags);
45+
}
46+
2347
#define CMD_LEN 64
2448
static char cmd[CMD_LEN];
2549

0 commit comments

Comments
 (0)