[LTP] [PATCH v2 3/4] mkdirat: Remove mkdirat fallback definition

Yang Xu xuyang2018.jy@fujitsu.com
Tue Oct 17 08:34:50 CEST 2023


According to man mkdir(2), glibc wrapper for mkdirat() was in glibc
2.4 (long time ago, the minimal glibc version we support is 2.17, see
doc/supported-kernel-libc-versions.txt). Therefore removed the fallback.

Reviewed-by: Petr Vorel <pvorel@suse.cz>
Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com>
---
 configure.ac                                  |  1 -
 include/lapi/mkdirat.h                        | 20 -------------------
 testcases/kernel/syscalls/mkdirat/mkdirat01.c |  1 -
 testcases/kernel/syscalls/mkdirat/mkdirat02.c |  1 -
 4 files changed, 23 deletions(-)
 delete mode 100644 include/lapi/mkdirat.h

diff --git a/configure.ac b/configure.ac
index ad216983a..4cada09ed 100644
--- a/configure.ac
+++ b/configure.ac
@@ -112,7 +112,6 @@ AC_CHECK_FUNCS_ONCE([ \
     mallinfo \
     mallinfo2 \
     mallopt \
-    mkdirat \
     mknodat \
     modify_ldt \
     mount_setattr \
diff --git a/include/lapi/mkdirat.h b/include/lapi/mkdirat.h
deleted file mode 100644
index 72eb7f647..000000000
--- a/include/lapi/mkdirat.h
+++ /dev/null
@@ -1,20 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-or-later
-/*
- * Copyright (c) 2014 Cyril Hrubis <chrubis@suse.cz>
- */
-
-#ifndef LAPI_MKDIRAT_H__
-#define LAPI_MKDIRAT_H__
-
-#include "config.h"
-#include "lapi/syscalls.h"
-#include "lapi/fcntl.h"
-
-#ifndef HAVE_MKDIRAT
-static inline int mkdirat(int dirfd, const char *dirname, int mode)
-{
-	return tst_syscall(__NR_mkdirat, dirfd, dirname, mode);
-}
-#endif
-
-#endif /* LAPI_MKDIRAT_H__ */
diff --git a/testcases/kernel/syscalls/mkdirat/mkdirat01.c b/testcases/kernel/syscalls/mkdirat/mkdirat01.c
index a323ed5b3..ca536bdab 100644
--- a/testcases/kernel/syscalls/mkdirat/mkdirat01.c
+++ b/testcases/kernel/syscalls/mkdirat/mkdirat01.c
@@ -35,7 +35,6 @@
 #include <string.h>
 #include <signal.h>
 #include "test.h"
-#include "lapi/mkdirat.h"
 #include "safe_macros.h"
 
 static void setup(void);
diff --git a/testcases/kernel/syscalls/mkdirat/mkdirat02.c b/testcases/kernel/syscalls/mkdirat/mkdirat02.c
index ebc0ed16b..2bd8fe9c0 100644
--- a/testcases/kernel/syscalls/mkdirat/mkdirat02.c
+++ b/testcases/kernel/syscalls/mkdirat/mkdirat02.c
@@ -11,7 +11,6 @@
 
 #define _GNU_SOURCE
 #include "tst_test.h"
-#include "lapi/mkdirat.h"
 
 #define MNT_POINT	"mntpoint"
 #define TEST_DIR	"mntpoint/test_dir"
-- 
2.39.1



More information about the ltp mailing list