[LTP] [PATCH v2] syscalls/renameat: Remove renameat fallback definition

Yang Xu xuyang2018.jy@fujitsu.com
Fri Sep 15 11:36:27 CEST 2023


Looking at man renameat, it was added into kernel 2.6.16 and since the
oldest kernel we support is 3.10 (see doc/supported-kernel-libc-versions
.txt) we can as well completely drop this fallback definition.

Reviewed-by: Xiao Yang <yangx.jy@fujitsu.com>
Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com>
---
 configure.ac                                  |  1 -
 include/lapi/renameat.h                       | 23 -------------------
 .../kernel/syscalls/renameat/renameat01.c     |  1 -
 3 files changed, 25 deletions(-)
 delete mode 100644 include/lapi/renameat.h

diff --git a/configure.ac b/configure.ac
index 662c4c058..30a6f56e6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -135,7 +135,6 @@ AC_CHECK_FUNCS_ONCE([ \
     rand_r \
     readlinkat \
     recvmmsg \
-    renameat \
     renameat2 \
     sched_getcpu \
     sendmmsg \
diff --git a/include/lapi/renameat.h b/include/lapi/renameat.h
deleted file mode 100644
index abf4c1d6e..000000000
--- a/include/lapi/renameat.h
+++ /dev/null
@@ -1,23 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-or-later
-/*
- * Copyright (c) International Business Machines  Corp., 2007
- * Copyright (c) 2014 Fujitsu Ltd.
- */
-
-#ifndef LAPI_RENAMEAT_H__
-#define LAPI_RENAMEAT_H__
-
-#include <sys/types.h>
-#include "config.h"
-#include "lapi/syscalls.h"
-
-#if !defined(HAVE_RENAMEAT)
-static inline int renameat(int olddirfd, const char *oldpath, int newdirfd,
-                           const char *newpath)
-{
-	return tst_syscall(__NR_renameat, olddirfd, oldpath, newdirfd,
-					newpath);
-}
-#endif
-
-#endif /* LAPI_RENAMEAT_H__ */
diff --git a/testcases/kernel/syscalls/renameat/renameat01.c b/testcases/kernel/syscalls/renameat/renameat01.c
index 3de103563..c318a7971 100644
--- a/testcases/kernel/syscalls/renameat/renameat01.c
+++ b/testcases/kernel/syscalls/renameat/renameat01.c
@@ -50,7 +50,6 @@
 #include "test.h"
 #include "safe_macros.h"
 #include "lapi/fcntl.h"
-#include "lapi/renameat.h"
 
 #define MNTPOINT "mntpoint"
 #define TESTDIR "testdir"
-- 
2.39.1



More information about the ltp mailing list