[T106][ZXW-22]7520V3SCV2.01.01.02P42U09_VEC_V0.8_AP_VEC origin source commit
Change-Id: Ic6e05d89ecd62fc34f82b23dcf306c93764aec4b
diff --git a/ap/build/uClibc/libc/stdlib/canonicalize.c b/ap/build/uClibc/libc/stdlib/canonicalize.c
new file mode 100644
index 0000000..06e710a
--- /dev/null
+++ b/ap/build/uClibc/libc/stdlib/canonicalize.c
@@ -0,0 +1,38 @@
+/*
+ * canonicalize.c -- Return a malloc'd string containing the canonical
+ * absolute name of the named file. The last file name component need
+ * not exist, and may be a symlink to a nonexistent file.
+ * Copyright (C) 2009 STMicroelectronics
+ * Author: Salvatore Cro <salvatore.cro@st.com>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <stdlib.h>
+#include <limits.h>
+
+#ifdef __USE_GNU
+
+#ifndef PATH_MAX
+# ifdef _POSIX_VERSION
+# define PATH_MAX _POSIX_PATH_MAX
+# else
+# ifdef MAXPATHLEN
+# define PATH_MAX MAXPATHLEN
+# else
+# define PATH_MAX 1024
+# endif
+# endif
+#endif
+
+char * canonicalize_file_name (const char *name)
+{
+ char *buf = (char *) malloc(PATH_MAX);
+
+ if(unlikely(buf == NULL))
+ return NULL;
+
+ *buf='\0';
+ return realpath (name, buf);
+}
+#endif