| From aa3568e6ac28f377e75ce16b11e3c7738a373e53 Mon Sep 17 00:00:00 2001 |
| From: Khem Raj <raj.khem@gmail.com> |
| Date: Fri, 8 Jan 2016 06:57:04 +0000 |
| Subject: [PATCH 20/32] getdents: define getdents/getdents64 only for glibc |
| |
| 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 |
| |