diff options
Diffstat (limited to 'meta/recipes-extended/ltp/ltp/0020-getdents-define-getdents-getdents64-only-for-glibc.patch')
-rw-r--r-- | meta/recipes-extended/ltp/ltp/0020-getdents-define-getdents-getdents64-only-for-glibc.patch | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/meta/recipes-extended/ltp/ltp/0020-getdents-define-getdents-getdents64-only-for-glibc.patch b/meta/recipes-extended/ltp/ltp/0020-getdents-define-getdents-getdents64-only-for-glibc.patch new file mode 100644 index 0000000000..0e4e4586ca --- /dev/null +++ b/meta/recipes-extended/ltp/ltp/0020-getdents-define-getdents-getdents64-only-for-glibc.patch | |||
@@ -0,0 +1,48 @@ | |||
1 | From aa3568e6ac28f377e75ce16b11e3c7738a373e53 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Fri, 8 Jan 2016 06:57:04 +0000 | ||
4 | Subject: [PATCH 20/32] getdents: define getdents/getdents64 only for glibc | ||
5 | |||
6 | getdents/getdents64 are implemented in musl and when we define static | ||
7 | functions with same name, it errors out. | ||
8 | |||
9 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
10 | --- | ||
11 | testcases/kernel/syscalls/getdents/getdents.h | 6 ++++-- | ||
12 | 1 file changed, 4 insertions(+), 2 deletions(-) | ||
13 | |||
14 | diff --git a/testcases/kernel/syscalls/getdents/getdents.h b/testcases/kernel/syscalls/getdents/getdents.h | ||
15 | index abea655..db63d89 100644 | ||
16 | --- a/testcases/kernel/syscalls/getdents/getdents.h | ||
17 | +++ b/testcases/kernel/syscalls/getdents/getdents.h | ||
18 | @@ -34,12 +34,13 @@ struct linux_dirent { | ||
19 | char d_name[]; | ||
20 | }; | ||
21 | |||
22 | +#ifdef __GLIBC__ | ||
23 | static inline int | ||
24 | getdents(unsigned int fd, struct linux_dirent *dirp, unsigned int size) | ||
25 | { | ||
26 | return ltp_syscall(__NR_getdents, fd, dirp, size); | ||
27 | } | ||
28 | - | ||
29 | +#endif | ||
30 | struct linux_dirent64 { | ||
31 | uint64_t d_ino; | ||
32 | int64_t d_off; | ||
33 | @@ -48,10 +49,11 @@ struct linux_dirent64 { | ||
34 | char d_name[]; | ||
35 | }; | ||
36 | |||
37 | +#ifdef __GLIBC__ | ||
38 | static inline int | ||
39 | getdents64(unsigned int fd, struct linux_dirent64 *dirp64, unsigned int size) | ||
40 | { | ||
41 | return ltp_syscall(__NR_getdents64, fd, dirp64, size); | ||
42 | } | ||
43 | - | ||
44 | +#endif | ||
45 | #endif /* GETDENTS_H */ | ||
46 | -- | ||
47 | 2.7.0 | ||
48 | |||