@@ -8,35 +8,17 @@
#define COMMON_H
#include "tst_test.h"
-#include "lapi/sched.h"
#define UID_MAP 0
#define GID_MAP 1
-static int dummy_child(void *v)
-{
- (void)v;
- return 0;
-}
-
-static inline void check_newuser(void)
-{
- int pid, status;
-
- pid = ltp_clone_quick(CLONE_NEWUSER | SIGCHLD, dummy_child, NULL);
- if (pid == -1)
- tst_brk(TCONF | TTERRNO, "CLONE_NEWUSER not supported");
-
- SAFE_WAIT(&status);
-}
-
static inline void updatemap(int cpid, int type, int idnum, int parentmappid)
{
char path[BUFSIZ];
char content[BUFSIZ];
int fd;
- switch(type) {
+ switch (type) {
case UID_MAP:
sprintf(path, "/proc/%d/uid_map", cpid);
break;
CLONE_NEWUSER is supported from kernel 3.8 and LTP supports all kernels >= 3.10. For this reason, we can remove any check for CLONE_NEWUSER support and to make userns common.h a bit simpler. Signed-off-by: Andrea Cervesato <andrea.cervesato@suse.com> --- testcases/kernel/containers/userns/common.h | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-)