summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/ltp/ltp/0020-getdents-define-getdents-getdents64-only-for-glibc.patch
blob: 7060a64b1a26f77273be0dc261687ac77058509c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
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>

Upstream-Status: Pending
---
 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