Whamcloud - gitweb
* now commit the sles10 build fix, after reverting previous shenanigans
authormjmac <mjmac>
Thu, 28 Dec 2006 04:53:41 +0000 (04:53 +0000)
committermjmac <mjmac>
Thu, 28 Dec 2006 04:53:41 +0000 (04:53 +0000)
libsysio/configure.in
libsysio/include/sysio.h
libsysio/src/readlink.c

index c6b6e30..85a0aee 100644 (file)
@@ -209,6 +209,20 @@ if test "$machine" = rs6000; then
        machine="powerpc"
 fi
 
        machine="powerpc"
 fi
 
+AC_MSG_CHECKING(if readlink returns ssize_t)
+AC_TRY_COMPILE([
+       include <unistd.h>
+],[
+       ssize_t readlink(const char *, char *, size_t);
+],
+       readlink_returns_ssize_t="yes",
+       readlink_returns_ssize_t="no"
+)
+AC_MSG_RESULT($readlink_returns_ssize_t)
+if test x$readlink_returns_ssize_t = xyes; then
+       AC_DEFINE(HAVE_POSIX_1003_READLINK, 1, [readlink returns ssize_t])
+fi
+
 # If we can't provoke the declaration of stat64 then we assume the
 # environment supports 64-bit file support naturally. Beware!
 AC_MSG_CHECKING(whether _LARGEFILE64_SOURCE definition is required)
 # If we can't provoke the declaration of stat64 then we assume the
 # environment supports 64-bit file support naturally. Beware!
 AC_MSG_CHECKING(whether _LARGEFILE64_SOURCE definition is required)
index 770d741..bae86c2 100644 (file)
@@ -247,7 +247,11 @@ extern int SYSIO_INTERFACE_NAME(ftruncate64)(int fd, off64_t length);
 #endif
 extern int SYSIO_INTERFACE_NAME(rmdir)(const char *path);
 extern int SYSIO_INTERFACE_NAME(symlink)(const char *path1, const char *path2);
 #endif
 extern int SYSIO_INTERFACE_NAME(rmdir)(const char *path);
 extern int SYSIO_INTERFACE_NAME(symlink)(const char *path1, const char *path2);
+#ifdef HAVE_POSIX_1003_READLINK
+extern ssize_t SYSIO_INTERFACE_NAME(readlink)(const char *path,
+#else
 extern int SYSIO_INTERFACE_NAME(readlink)(const char *path,
 extern int SYSIO_INTERFACE_NAME(readlink)(const char *path,
+#endif
                                char *buf,
                                size_t bufsiz);
 extern int SYSIO_INTERFACE_NAME(link)(const char *oldpath, const char *newpath);
                                char *buf,
                                size_t bufsiz);
 extern int SYSIO_INTERFACE_NAME(link)(const char *oldpath, const char *newpath);
index 8693dc3..2497dfd 100644 (file)
 #include "inode.h"
 #include "sysio-symbols.h"
 
 #include "inode.h"
 #include "sysio-symbols.h"
 
+#ifdef HAVE_POSIX_1003_READLINK
+ssize_t
+#else
 int
 int
+#endif
 SYSIO_INTERFACE_NAME(readlink)(const char *path, char *buf, size_t bufsiz)
 {
        struct intent intent;
 SYSIO_INTERFACE_NAME(readlink)(const char *path, char *buf, size_t bufsiz)
 {
        struct intent intent;