summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorroot <root>2008-05-30 04:50:21 +0000
committerroot <root>2008-05-30 04:50:21 +0000
commit37ad6568e8e787c9a79add8e6d2ea9f12b7712a8 (patch)
treeaefd449b3516ccfbfbd1cbb7f250bb9eacc2923d
parente2bfb1cf1563d34049aa7a2e967aa660cc4a08a5 (diff)
*** empty log message ***
-rw-r--r--config.h.in44
-rw-r--r--eio.c47
-rw-r--r--libeio.m412
3 files changed, 3 insertions, 100 deletions
diff --git a/config.h.in b/config.h.in
index 1dedbb4..5149ce5 100644
--- a/config.h.in
+++ b/config.h.in
@@ -1,7 +1,4 @@
-/* config.h.in. Generated from configure.ac by autoheader. */
-
-/* Define to 1 if you have the <dlfcn.h> header file. */
-#undef HAVE_DLFCN_H
+/* libeio/config.h.in. Generated from configure.ac by autoheader. */
/* fdatasync(2) is available */
#undef HAVE_FDATASYNC
@@ -9,48 +6,15 @@
/* futimes(2) is available */
#undef HAVE_FUTIMES
-/* Define to 1 if you have the <inttypes.h> header file. */
-#undef HAVE_INTTYPES_H
-
-/* Define to 1 if you have the <memory.h> header file. */
-#undef HAVE_MEMORY_H
-
/* pread(2) and pwrite(2) are available */
#undef HAVE_PREADWRITE
/* readahead(2) is available (linux) */
#undef HAVE_READAHEAD
-/* readdir_r is available */
-#undef HAVE_READDIR_R
-
/* sendfile(2) is available and supported */
#undef HAVE_SENDFILE
-/* Define to 1 if you have the <stdint.h> header file. */
-#undef HAVE_STDINT_H
-
-/* Define to 1 if you have the <stdlib.h> header file. */
-#undef HAVE_STDLIB_H
-
-/* Define to 1 if you have the <strings.h> header file. */
-#undef HAVE_STRINGS_H
-
-/* Define to 1 if you have the <string.h> header file. */
-#undef HAVE_STRING_H
-
-/* Define to 1 if you have the <sys/stat.h> header file. */
-#undef HAVE_SYS_STAT_H
-
-/* Define to 1 if you have the <sys/types.h> header file. */
-#undef HAVE_SYS_TYPES_H
-
-/* Define to 1 if you have the <unistd.h> header file. */
-#undef HAVE_UNISTD_H
-
-/* Name of package */
-#undef PACKAGE
-
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
@@ -65,9 +29,3 @@
/* Define to the version of this package. */
#undef PACKAGE_VERSION
-
-/* Define to 1 if you have the ANSI C header files. */
-#undef STDC_HEADERS
-
-/* Version number of package */
-#undef VERSION
diff --git a/eio.c b/eio.c
index 810c510..a00d303 100644
--- a/eio.c
+++ b/eio.c
@@ -316,16 +316,10 @@ static void etp_atfork_prepare (void)
#if !HAVE_PREADWRITE
X_LOCK (preadwritelock);
#endif
-#if !HAVE_READDIR_R
- X_LOCK (readdirlock);
-#endif
}
static void etp_atfork_parent (void)
{
-#if !HAVE_READDIR_R
- X_UNLOCK (readdirlock);
-#endif
#if !HAVE_PREADWRITE
X_UNLOCK (preadwritelock);
#endif
@@ -803,37 +797,6 @@ eio__readahead (int fd, off_t offset, size_t count, worker *self)
#endif
-#if !HAVE_READDIR_R
-# define readdir_r eio__readdir_r
-
-static mutex_t readdirlock = X_MUTEX_INIT;
-
-static int
-eio__readdir_r (DIR *dirp, EIO_STRUCT_DIRENT *ent, EIO_STRUCT_DIRENT **res)
-{
- EIO_STRUCT_DIRENT *e;
- int errorno;
-
- X_LOCK (readdirlock);
-
- e = readdir (dirp);
- errorno = errno;
-
- if (e)
- {
- *res = ent;
- strcpy (ent->d_name, e->d_name);
- }
- else
- *res = 0;
-
- X_UNLOCK (readdirlock);
-
- errno = errorno;
- return e ? 0 : -1;
-}
-#endif
-
/* sendfile always needs emulation */
static ssize_t
eio__sendfile (int ofd, int ifd, off_t offset, size_t count, etp_worker *self)
@@ -933,11 +896,6 @@ static void
eio__scandir (eio_req *req, etp_worker *self)
{
DIR *dirp;
- union
- {
- EIO_STRUCT_DIRENT d;
- char b [offsetof (EIO_STRUCT_DIRENT, d_name) + NAME_MAX + 1];
- } *u;
EIO_STRUCT_DIRENT *entp;
char *name, *names;
int memlen = 4096;
@@ -946,16 +904,15 @@ eio__scandir (eio_req *req, etp_worker *self)
X_LOCK (wrklock);
self->dirp = dirp = opendir (req->ptr1);
- self->dbuf = u = malloc (sizeof (*u));
req->flags |= EIO_FLAG_PTR2_FREE;
req->ptr2 = names = malloc (memlen);
X_UNLOCK (wrklock);
- if (dirp && u && names)
+ if (dirp && names)
for (;;)
{
errno = 0;
- readdir_r (dirp, &u->d, &entp);
+ entp = readdir (dirp);
if (!entp)
break;
diff --git a/libeio.m4 b/libeio.m4
index 3c8cd6c..8a87b2d 100644
--- a/libeio.m4
+++ b/libeio.m4
@@ -60,18 +60,6 @@ int main(void)
],ac_cv_preadwrite=yes,ac_cv_preadwrite=no)])
test $ac_cv_preadwrite = yes && AC_DEFINE(HAVE_PREADWRITE, 1, pread(2) and pwrite(2) are available)
-AC_CACHE_CHECK(for readdir_r, ac_cv_readdir_r, [AC_LINK_IFELSE([
-#include <dirent.h>
-int main(void)
-{
- DIR *dir = 0;
- struct dirent ent, *eres;
- int res = readdir_r (dir, &ent, &eres);
- return 0;
-}
-],ac_cv_readdir_r=yes,ac_cv_readdir_r=no)])
-test $ac_cv_readdir_r = yes && AC_DEFINE(HAVE_READDIR_R, 1, readdir_r is available)
-
AC_CACHE_CHECK(for sendfile, ac_cv_sendfile, [AC_LINK_IFELSE([
# include <sys/types.h>
#if __linux