aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--System/Posix/Directory.hsc4
-rw-r--r--System/Posix/Directory/ByteString.hsc4
-rw-r--r--System/Posix/Directory/Common.hsc8
-rw-r--r--configure.ac2
4 files changed, 18 insertions, 0 deletions
diff --git a/System/Posix/Directory.hsc b/System/Posix/Directory.hsc
index 71a70ce..d0ef4c0 100644
--- a/System/Posix/Directory.hsc
+++ b/System/Posix/Directory.hsc
@@ -29,8 +29,12 @@ module System.Posix.Directory (
rewindDirStream,
closeDirStream,
DirStreamOffset,
+#ifdef HAVE_TELLDIR
tellDirStream,
+#endif
+#ifdef HAVE_SEEKDIR
seekDirStream,
+#endif
-- * The working dirctory
getWorkingDirectory,
diff --git a/System/Posix/Directory/ByteString.hsc b/System/Posix/Directory/ByteString.hsc
index 3ac642b..bb9100c 100644
--- a/System/Posix/Directory/ByteString.hsc
+++ b/System/Posix/Directory/ByteString.hsc
@@ -29,8 +29,12 @@ module System.Posix.Directory.ByteString (
rewindDirStream,
closeDirStream,
DirStreamOffset,
+#ifdef HAVE_TELLDIR
tellDirStream,
+#endif
+#ifdef HAVE_SEEKDIR
seekDirStream,
+#endif
-- * The working dirctory
getWorkingDirectory,
diff --git a/System/Posix/Directory/Common.hsc b/System/Posix/Directory/Common.hsc
index a608be3..7e2dfc6 100644
--- a/System/Posix/Directory/Common.hsc
+++ b/System/Posix/Directory/Common.hsc
@@ -22,8 +22,12 @@ module System.Posix.Directory.Common (
DirStream(..), CDir, CDirent, DirStreamOffset(..),
rewindDirStream,
closeDirStream,
+#ifdef HAVE_SEEKDIR
seekDirStream,
+#endif
+#ifdef HAVE_TELLDIR
tellDirStream,
+#endif
changeWorkingDirectoryFd,
) where
@@ -57,13 +61,16 @@ foreign import ccall unsafe "closedir"
newtype DirStreamOffset = DirStreamOffset COff
+#ifdef HAVE_SEEKDIR
seekDirStream :: DirStream -> DirStreamOffset -> IO ()
seekDirStream (DirStream dirp) (DirStreamOffset off) =
c_seekdir dirp off
foreign import ccall unsafe "seekdir"
c_seekdir :: Ptr CDir -> COff -> IO ()
+#endif
+#ifdef HAVE_TELLDIR
tellDirStream :: DirStream -> IO DirStreamOffset
tellDirStream (DirStream dirp) = do
off <- c_telldir dirp
@@ -71,6 +78,7 @@ tellDirStream (DirStream dirp) = do
foreign import ccall unsafe "telldir"
c_telldir :: Ptr CDir -> IO COff
+#endif
changeWorkingDirectoryFd :: Fd -> IO ()
changeWorkingDirectoryFd (Fd fd) =
diff --git a/configure.ac b/configure.ac
index 7528c3e..e1eb68c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -33,6 +33,8 @@ AC_CHECK_FUNCS([nanosleep])
AC_CHECK_FUNCS([ptsname])
AC_CHECK_FUNCS([setitimer])
AC_CHECK_FUNCS([readdir_r])
+dnl not available on android so check for it
+AC_CHECK_FUNCS([telldir seekdir])
AC_CHECK_MEMBERS([struct stat.st_atim])
AC_CHECK_MEMBERS([struct stat.st_mtim])