Index: /trunk/src/lib/restartable-syscall-wrappers.c
===================================================================
--- /trunk/src/lib/restartable-syscall-wrappers.c	(revision 2469)
+++ /trunk/src/lib/restartable-syscall-wrappers.c	(revision 2470)
@@ -37,4 +37,11 @@
 *******************************************************************************/
 #include <sys/types.h>
+#ifdef KBUILD_OS_SOLARIS
+# include <string.h> /* Try drag in feature_tests.h. */
+# include <ctype.h>
+# undef  _RESTRICT_KYWD
+# define _RESTRICT_KYWD 
+# undef  __PRAGMA_REDEFINE_EXTNAME
+#endif
 #include <sys/stat.h>
 #include <utime.h>
@@ -44,7 +51,4 @@
 #include <stdarg.h>
 #include <stddef.h>
-#ifdef KBUILD_OS_SOLARIS
-# undef __PRAGMA_REDEFINE_EXTNAME
-#endif
 #include <stdio.h>
 
@@ -144,5 +148,5 @@
 
 
-
+#undef open
 int open(const char *pszPath, int fFlags, ...)
 {
@@ -170,4 +174,5 @@
 }
 
+#undef open64
 int open64(const char *pszPath, int fFlags, ...)
 {
@@ -235,11 +240,11 @@
 #undef stat
 WRAP_FN(stat, (const char *pszPath, struct stat *pStBuf), (pszPath, pStBuf), int, -1);
-#undef stat64
-WRAP_FN(stat64, (const char *pszPath, struct stat *pStBuf), (pszPath, pStBuf), int, -1);
-
 #undef lstat
 WRAP_FN(lstat, (const char *pszPath, struct stat *pStBuf), (pszPath, pStBuf), int, -1);
+
+#undef stat64
+WRAP_FN(stat64, (const char *pszPath, struct stat64 *pStBuf), (pszPath, pStBuf), int, -1);
 #undef lstat64
-WRAP_FN(lstat64, (const char *pszPath, struct stat *pStBuf), (pszPath, pStBuf), int, -1);
+WRAP_FN(lstat64, (const char *pszPath, struct stat64 *pStBuf), (pszPath, pStBuf), int, -1);
 
 #undef read
@@ -273,3 +278,5 @@
 WRAP_FN(pathconf, (const char *pszPath, int iCfgNm), (pszPath, iCfgNm), long, -1);
 
-
+#undef readlink
+WRAP_FN(readlink, (const char *pszPath, char *pszBuf, size_t cbBuf), (pszPath, pszBuf, cbBuf), ssize_t, -1);
+
