Imported Upstream version 2.13.0
[platform/upstream/fontconfig.git] / src / fccompat.c
index 31d80be..16f108d 100644 (file)
@@ -37,6 +37,9 @@
 #if HAVE_FCNTL_H
 #include <fcntl.h>
 #endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
 #include <stdarg.h>
 #include <stdlib.h>
 #include <string.h>
@@ -256,6 +259,22 @@ FcMakeDirectory (const FcChar8 *dir)
     return ret;
 }
 
+ssize_t
+FcReadLink (const FcChar8 *pathname,
+           FcChar8       *buf,
+           size_t         bufsiz)
+{
+#ifdef HAVE_READLINK
+    return readlink ((const char *) pathname, (char *)buf, bufsiz);
+#else
+    /* XXX: this function is only used for FcConfigRealFilename() so far
+     * and returning -1 as an error still just works.
+     */
+    errno = ENOSYS;
+    return -1;
+#endif
+}
+
 #define __fccompat__
 #include "fcaliastail.h"
 #undef __fccompat__