From 14b435a43ab54a718f1a899573fe1ce6bb06fe7a Mon Sep 17 00:00:00 2001 From: Duncaen Date: Sun, 25 Oct 2015 15:30:09 +0100 Subject: libtrace: only include fopen64, freopen64 and stat64 if __GLIBC__ is defined --- src/libtrace/libtrace.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/libtrace/libtrace.c b/src/libtrace/libtrace.c index 1eb1cf931..12a8c7f4a 100644 --- a/src/libtrace/libtrace.c +++ b/src/libtrace/libtrace.c @@ -312,6 +312,7 @@ FILE *fopen(const char *pathname, const char *mode) { return rv; } +#ifdef __GLIBC__ FILE *fopen64(const char *pathname, const char *mode) { if (!orig_fopen64) orig_fopen64 = (orig_fopen_t)dlsym(RTLD_NEXT, "fopen64"); @@ -320,6 +321,7 @@ FILE *fopen64(const char *pathname, const char *mode) { printf("%u:%s:fopen64 %s\n", pid(), name(), pathname); return rv; } +#endif /* __GLIBC__ */ // freopen @@ -334,6 +336,7 @@ FILE *freopen(const char *pathname, const char *mode, FILE *stream) { return rv; } +#ifdef __GLIBC__ typedef FILE *(*orig_freopen64_t)(const char *pathname, const char *mode, FILE *stream); static orig_freopen64_t orig_freopen64 = NULL; FILE *freopen64(const char *pathname, const char *mode, FILE *stream) { @@ -344,6 +347,7 @@ FILE *freopen64(const char *pathname, const char *mode, FILE *stream) { printf("%u:%s:freopen64 %s\n", pid(), name(), pathname); return rv; } +#endif /* __GLIBC__ */ // unlink typedef int (*orig_unlink_t)(const char *pathname); @@ -414,6 +418,7 @@ int stat(const char *pathname, struct stat *buf) { return rv; } +#ifdef __GLIBC__ typedef int (*orig_stat64_t)(const char *pathname, struct stat64 *buf); static orig_stat64_t orig_stat64 = NULL; int stat64(const char *pathname, struct stat64 *buf) { @@ -424,6 +429,7 @@ int stat64(const char *pathname, struct stat64 *buf) { printf("%u:%s:stat %s\n", pid(), name(), pathname); return rv; } +#endif /* __GLIBC__ */ // access @@ -625,4 +631,4 @@ int setresgid(gid_t rgid, gid_t egid, gid_t sgid) { printf("%u:%s:setresgid %d %d %d\n", pid(), name(), rgid, egid, sgid); return rv; -} \ No newline at end of file +} -- cgit v1.2.3-54-g00ecf