Skip to contentSkip to conversation

perf trace: Add conditional define for AT_FDCWD

tip:perf/core tip-bot for Arnaldo Carvalho de Melo 1 participant 1 message Jul 13, 2016 perf events

lore
Share & tools
lore
#0 lore raw
Commit-ID:  48e1f91ad2cadcb5689a2a3b6ed141d45009b45e
Gitweb:     http://git.kernel.org/tip/48e1f91ad2cadcb5689a2a3b6ed141d45009b45e
Author:     Arnaldo Carvalho de Melo <[email protected]>
AuthorDate: Tue, 5 Jul 2016 14:43:27 -0300
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Tue, 12 Jul 2016 15:19:53 -0300

perf trace: Add conditional define for AT_FDCWD

This one was only defined if _GNU_SOURCE was set in older glibc versions, check that and provide the define in such cases.

---
 tools/perf/builtin-trace.c | 4 ++++
 1 file changed, 4 insertions(+)
tools/perf/builtin-trace.c +4 -0
index e7e0b6e..570a78c 100644
@@ -334,6 +334,10 @@ static size_t syscall_arg__scnprintf_fd(char *bf, size_t size,
 
 #define SCA_FD syscall_arg__scnprintf_fd
 
+#ifndef AT_FDCWD
+#define AT_FDCWD	-100
+#endif
+
 static size_t syscall_arg__scnprintf_fd_at(char *bf, size_t size,
 					   struct syscall_arg *arg)
 {