static inline void* memcpy(void* dest, const void* src, size_t n);
static inline void* memset(void* s, int c, size_t n);
static inline int mprotect(void* addr, size_t len, int prot);
+ static inline ssize_t readlink(const char* path, char* buf, size_t bufsiz);
static inline int scandir(const char* dir, struct dirent*** namelist, int(*filter)(const struct dirent*), int(*compar)(const void*, const void*));
static inline int setsockopt(int s, int level, int optname, const void* optval, socklen_t optlen);
static inline int shutdown(int s, int how);
#endif
}
+inline ssize_t os::readlink(const char* path, char* buf, size_t bufsiz)
+{
+#if defined(HAVE_READLINK)
+ return ::readlink(path, buf, bufsiz);
+#else
+# error readlink not available
+#endif
+}
+
inline static void *system_realloc(void *ptr, size_t size)
{
#if defined(HAVE_REALLOC)