From: Khem Raj <raj.khem@gmail.com>
Date: Thu, 7 Jan 2016 22:37:48 +0000
Subject: [PATCH 3/3] canonicalize_file_name is specific to glibc

When on Linux and not using glibc then we need to define
canonicalize_file_name() API, therefore add a check for finding out if
its not glibc

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 agent/tcf/framework/mdep.c | 2 +-
 agent/tcf/framework/mdep.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/agent/tcf/framework/mdep.c b/agent/tcf/framework/mdep.c
index cf5771e5f016..ccdea09b8817 100644
--- a/agent/tcf/framework/mdep.c
+++ b/agent/tcf/framework/mdep.c
@@ -1086,7 +1086,7 @@ char * canonicalize_file_name(const char * path) {
     return strdup(res);
 }
 
-#elif defined(__UCLIBC__)
+#elif defined(__UCLIBC__) || !defined(__GLIBC__)
 
 char * canonicalize_file_name(const char * path) {
     return realpath(path, NULL);
diff --git a/agent/tcf/framework/mdep.h b/agent/tcf/framework/mdep.h
index fec94d787224..52c41256cd92 100644
--- a/agent/tcf/framework/mdep.h
+++ b/agent/tcf/framework/mdep.h
@@ -288,7 +288,7 @@ extern int loc_clock_gettime(int, struct timespec *);
 
 #define O_BINARY 0
 
-#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__) || defined(__sun__)
+#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__) || defined(__sun__) || !defined(__GLIBC__)
 #  define O_LARGEFILE 0
 extern char ** environ;
 extern char * canonicalize_file_name(const char * path);
