[LTP] [PATCH V2 20/32] getdents: define getdents/getdents64 only for glibc

Khem Raj raj.khem@gmail.com
Sat Jan 9 02:14:08 CET 2016


getdents/getdents64 are implemented in musl and when we define static
functions with same name, it errors out.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 testcases/kernel/syscalls/getdents/getdents.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/testcases/kernel/syscalls/getdents/getdents.h b/testcases/kernel/syscalls/getdents/getdents.h
index abea655..db63d89 100644
--- a/testcases/kernel/syscalls/getdents/getdents.h
+++ b/testcases/kernel/syscalls/getdents/getdents.h
@@ -34,12 +34,13 @@ struct linux_dirent {
 	char            d_name[];
 };
 
+#ifdef __GLIBC__
 static inline int
 getdents(unsigned int fd, struct linux_dirent *dirp, unsigned int size)
 {
 	return ltp_syscall(__NR_getdents, fd, dirp, size);
 }
-
+#endif
 struct linux_dirent64 {
 	uint64_t	d_ino;
 	int64_t		d_off;
@@ -48,10 +49,11 @@ struct linux_dirent64 {
 	char		d_name[];
 };
 
+#ifdef __GLIBC__
 static inline int
 getdents64(unsigned int fd, struct linux_dirent64 *dirp64, unsigned int size)
 {
 	return ltp_syscall(__NR_getdents64, fd, dirp64, size);
 }
-
+#endif
 #endif /* GETDENTS_H */
-- 
2.7.0



More information about the Ltp mailing list