Commit 69c9139b authored by gregor herrmann's avatar gregor herrmann

Imported Upstream version 4.11

parent 6eceba75
This diff is collapsed.
This diff is collapsed.
......@@ -7,6 +7,24 @@ TODO: splice/tee/vmsplice? (http://kerneltrap.org/node/6505 http://lwn.net/Artic
TODO: aio_fcntl, at least for file-locking
TODO: aio_mincore?
TODO: getxattr etc.?
TODO: F_DUPFD_CLOEXEC
4.11 Mon Oct 10 00:24:11 CEST 2011
- libeio didn't compile on !linux (Paul Howarth).
4.1 Sun Oct 9 10:24:11 CEST 2011
- IO::AIO did access uninitialised memory on unsuccessful stats.
- (libeio) added syncfs syscall wrapper.
- (libeio) set thread name on linux (ps -L/Hcx, top, gdb).
- (libeio) support multiple indepenent working directories.
- applied speling corrections by Nicholas Bamber.
- tune treescan #threads and #outstanding requests a bit.
- reduce the number of file descriptors in use at any one time
in treescan, to avoid running out of them (and using too much ram).
- take advantage of working directoriy abstractions
in aio_scandir and treescan.
- reduce compiled size by ~10% by not inlining some key functionality.
- added --progress switch to treescan.
4.0 Mon Jul 18 05:01:10 CEST 2011
- INCOMPATIBLE CHANGE: fork is no longer supported (indeed, it never was),
......
......@@ -4,7 +4,7 @@
"unknown"
],
"dynamic_config" : 1,
"generated_by" : "ExtUtils::MakeMaker version 6.58, CPAN::Meta::Converter version 2.110930001",
"generated_by" : "ExtUtils::MakeMaker version 6.59, CPAN::Meta::Converter version 2.112150",
"license" : [
"unknown"
],
......@@ -37,5 +37,5 @@
}
},
"release_status" : "stable",
"version" : "4.0"
"version" : "4.11"
}
......@@ -7,7 +7,7 @@ build_requires:
configure_requires:
ExtUtils::MakeMaker: 0
dynamic_config: 1
generated_by: 'ExtUtils::MakeMaker version 6.58, CPAN::Meta::Converter version 2.110930001'
generated_by: 'ExtUtils::MakeMaker version 6.59, CPAN::Meta::Converter version 2.112150'
license: unknown
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
......@@ -19,4 +19,4 @@ no_index:
- inc
requires:
common::sense: 0
version: 4.0
version: 4.11
......@@ -74,7 +74,7 @@ if ($^O =~ /linux/ && $Config{usemymalloc} eq "y") {
***
*** WARNING:
***
*** Your perl uses it's own memory allocator (-Dusemymalloc=y),
*** Your perl uses its own memory allocator (-Dusemymalloc=y),
*** which is known not to be threadsafe on GNU/Linux and probably
*** other platforms (even when not used concurrently, it trashes
*** the data structures of the system malloc running concurrently),
......
This diff is collapsed.
......@@ -5,27 +5,33 @@
use strict;
use Getopt::Long;
use Time::HiRes ();
use IO::AIO;
our $VERSION = $IO::AIO::VERSION;
Getopt::Long::Configure ("bundling", "no_ignore_case", "require_order", "auto_help", "auto_version");
my ($opt_silent, $opt_print0, $opt_stat, $opt_nodirs, $opt_nofiles, $opt_grep);
my ($opt_silent, $opt_print0, $opt_stat, $opt_nodirs,
$opt_nofiles, $opt_grep, $opt_progress);
GetOptions
"quiet|q" => \$opt_silent,
"print0|0" => \$opt_print0,
"stat|s" => \$opt_stat,
"dirs|d" => \$opt_nofiles,
"files|f" => \$opt_nodirs,
"grep|g=s" => \$opt_grep,
"quiet|q" => \$opt_silent,
"print0|0" => \$opt_print0,
"stat|s" => \$opt_stat,
"dirs|d" => \$opt_nofiles,
"files|f" => \$opt_nodirs,
"grep|g=s" => \$opt_grep,
"progress|p" => \$opt_progress,
or die "Usage: try $0 --help";
@ARGV = "." unless @ARGV;
$opt_grep &&= qr{$opt_grep}s;
my ($n_dirs, $n_files, $n_stats) = (0, 0, 0);
my ($n_last, $n_start) = (Time::HiRes::time) x 2;
sub printfn {
my ($prefix, $files, $suffix) = @_;
......@@ -45,23 +51,44 @@ sub scan {
$path .= "/";
IO::AIO::poll_cb;
if ($opt_progress and $n_last + 1 < Time::HiRes::time) {
$n_last = Time::HiRes::time;
my $d = $n_last - $n_start;
printf STDERR "\r%d dirs (%g/s) %d files (%g/s) %d stats (%g/s) ",
$n_dirs, $n_dirs / $d,
$n_files, $n_files / $d,
$n_stats, $n_stats / $d
if $opt_progress;
}
aioreq_pri -1;
++$n_dirs;
aio_scandir $path, 8, sub {
my ($dirs, $files) = @_;
my ($dirs, $files) = @_
or warn "$path: $!\n";
printfn "", [$path] unless $opt_nodirs;
printfn $path, $files unless $opt_nofiles;
$n_files += @$files;
if ($opt_stat) {
aio_lstat "$path$_" for @$files;
aio_wd $path, sub {
my $wd = shift;
aio_lstat [$wd, $_] for @$files;
$n_stats += @$files;
};
}
&scan ("$path$_") for @$dirs;
};
}
IO::AIO::max_outstanding 64;
IO::AIO::min_parallel 32;
IO::AIO::max_outstanding 100; # two fds per directory, so limit accordingly
IO::AIO::min_parallel 20;
for my $seed (@ARGV) {
$seed =~ s/\/+$//;
......
......@@ -3174,12 +3174,13 @@ fi
done
for ac_header in stdint.h
for ac_header in stdint.h sys/syscall.h sys/prctl.h
do :
ac_fn_c_check_header_mongrel "$LINENO" "stdint.h" "ac_cv_header_stdint_h" "$ac_includes_default"
if test "x$ac_cv_header_stdint_h" = x""yes; then :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_STDINT_H 1
#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
fi
......@@ -3536,6 +3537,66 @@ test $ac_cv_fallocate = yes &&
$as_echo "#define HAVE_FALLOCATE 1" >>confdefs.h
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sys_syncfs" >&5
$as_echo_n "checking for sys_syncfs... " >&6; }
if test "${ac_cv_sys_syncfs+set}" = set; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <unistd.h>
#include <sys/syscall.h>
int main (void)
{
int res = syscall (__NR_syncfs, (int)0);
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_sys_syncfs=yes
else
ac_cv_sys_syncfs=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_syncfs" >&5
$as_echo "$ac_cv_sys_syncfs" >&6; }
test $ac_cv_sys_syncfs = yes &&
$as_echo "#define HAVE_SYS_SYNCFS 1" >>confdefs.h
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for prctl_set_name" >&5
$as_echo_n "checking for prctl_set_name... " >&6; }
if test "${ac_cv_prctl_set_name+set}" = set; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <sys/prctl.h>
int main (void)
{
char name = "test123";
int res = prctl (PR_SET_NAME, (unsigned long)name, 0, 0, 0);
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_prctl_set_name=yes
else
ac_cv_prctl_set_name=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prctl_set_name" >&5
$as_echo "$ac_cv_prctl_set_name" >&6; }
test $ac_cv_prctl_set_name = yes &&
$as_echo "#define HAVE_PRCTL_SET_NAME 1" >>confdefs.h
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for posix_madvise" >&5
$as_echo_n "checking for posix_madvise... " >&6; }
......
......@@ -24,6 +24,9 @@
/* posix_madvise(2) is available */
#undef HAVE_POSIX_MADVISE
/* prctl(PR_SET_NAME) is available */
#undef HAVE_PRCTL_SET_NAME
/* pread(2) and pwrite(2) are available */
#undef HAVE_PREADWRITE
......@@ -48,9 +51,18 @@
/* sync_file_range(2) is available */
#undef HAVE_SYNC_FILE_RANGE
/* Define to 1 if you have the <sys/prctl.h> header file. */
#undef HAVE_SYS_PRCTL_H
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* syscall(__NR_syncfs) is available */
#undef HAVE_SYS_SYNCFS
/* Define to 1 if you have the <sys/syscall.h> header file. */
#undef HAVE_SYS_SYSCALL_H
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
......
......@@ -50,7 +50,7 @@
/* many compilers define _GNUC_ to some versions but then only implement
* what their idiot authors think are the "more important" extensions,
* causing enourmous grief in return for some better fake benchmark numbers.
* causing enormous grief in return for some better fake benchmark numbers.
* or so.
* we try to detect these and simply assume they are not gcc - if they have
* an issue with that they should have done it right in the first place.
......@@ -65,42 +65,74 @@
/*****************************************************************************/
/* ECB_NO_THREADS - ecb is not used by multiple threads, ever */
/* ECB_NO_SMP - ecb might be used in multiple threads, but only on a single cpu */
#if ECB_NO_THREADS || ECB_NO_SMP
#define ECB_MEMORY_FENCE do { } while (0)
#endif
#ifndef ECB_MEMORY_FENCE
#if ECB_GCC_VERSION(2,5)
#if __x86
#define ECB_MEMORY_FENCE __asm__ __volatile__ ("lock; or.b $0, -1(%%esp)" : : : "memory")
#define ECB_MEMORY_FENCE_ACQUIRE ECB_MEMORY_FENCE
#define ECB_MEMORY_FENCE_RELEASE ECB_MEMORY_FENCE /* better be safe than sorry */
#if ECB_GCC_VERSION(2,5) || defined(__INTEL_COMPILER) || defined(__clang__)
#if __i386__
#define ECB_MEMORY_FENCE __asm__ __volatile__ ("lock; orb $0, -1(%%esp)" : : : "memory")
#define ECB_MEMORY_FENCE_ACQUIRE ECB_MEMORY_FENCE /* non-lock xchg might be enough */
#define ECB_MEMORY_FENCE_RELEASE do { } while (0) /* unlikely to change in future cpus */
#elif __amd64
#define ECB_MEMORY_FENCE __asm__ __volatile__ ("mfence" : : : "memory")
#define ECB_MEMORY_FENCE_ACQUIRE __asm__ __volatile__ ("lfence" : : : "memory")
#define ECB_MEMORY_FENCE_RELEASE __asm__ __volatile__ ("sfence")
#define ECB_MEMORY_FENCE_RELEASE __asm__ __volatile__ ("sfence") /* play safe - not needed in any current cpu */
#elif __powerpc__ || __ppc__ || __powerpc64__ || __ppc64__
#define ECB_MEMORY_FENCE __asm__ __volatile__ ("sync" : : : "memory")
#elif defined(__ARM_ARCH_6__ ) || defined(__ARM_ARCH_6J__ ) \
|| defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6ZK__)
#define ECB_MEMORY_FENCE __asm__ __volatile__ ("mcr p15,0,%0,c7,c10,5" : : "r" (0) : "memory")
#elif defined(__ARM_ARCH_7__ ) || defined(__ARM_ARCH_7A__ ) \
|| defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7R__ )
#define ECB_MEMORY_FENCE __asm__ __volatile__ ("dmb" : : : "memory")
#endif
#endif
#endif
#ifndef ECB_MEMORY_FENCE
#if ECB_GCC_VERSION(4,4)
#if ECB_GCC_VERSION(4,4) || defined(__INTEL_COMPILER) || defined(__clang__)
#define ECB_MEMORY_FENCE __sync_synchronize ()
#define ECB_MEMORY_FENCE_ACQUIRE ({ char dummy = 0; __sync_lock_test_and_set (&dummy, 1); })
#define ECB_MEMORY_FENCE_RELEASE ({ char dummy = 1; __sync_lock_release (&dummy ); })
#elif _MSC_VER >= 1400
#define ECB_MEMORY_FENCE do { } while (0)
#define ECB_MEMORY_FENCE_ACQUIRE ECB_MEMORY_FENCE
#define ECB_MEMORY_FENCE_RELEASE ECB_MEMORY_FENCE
#elif defined(_WIN32) && defined(MemoryBarrier)
#define ECB_MEMORY_FENCE MemoryBarrier ()
#define ECB_MEMORY_FENCE_ACQUIRE ECB_MEMORY_FENCE
#define ECB_MEMORY_FENCE_RELEASE ECB_MEMORY_FENCE
/*#define ECB_MEMORY_FENCE_ACQUIRE ({ char dummy = 0; __sync_lock_test_and_set (&dummy, 1); }) */
/*#define ECB_MEMORY_FENCE_RELEASE ({ char dummy = 1; __sync_lock_release (&dummy ); }) */
#elif _MSC_VER >= 1400 /* VC++ 2005 */
#pragma intrinsic(_ReadBarrier,_WriteBarrier,_ReadWriteBarrier)
#define ECB_MEMORY_FENCE _ReadWriteBarrier ()
#define ECB_MEMORY_FENCE_ACQUIRE _ReadWriteBarrier () /* according to msdn, _ReadBarrier is not a load fence */
#define ECB_MEMORY_FENCE_RELEASE _WriteBarrier ()
#elif defined(_WIN32)
#include <WinNT.h>
#define ECB_MEMORY_FENCE MemoryBarrier () /* actually just xchg on x86... scary */
#endif
#endif
#ifndef ECB_MEMORY_FENCE
#include <pthread.h>
#if !ECB_AVOID_PTHREADS
/*
* if you get undefined symbol references to pthread_mutex_lock,
* or failure to find pthread.h, then you should implement
* the ECB_MEMORY_FENCE operations for your cpu/compiler
* OR provide pthread.h and link against the posix thread library
* of your system.
*/
#include <pthread.h>
#define ECB_NEEDS_PTHREADS 1
#define ECB_MEMORY_FENCE_NEEDS_PTHREADS 1
static pthread_mutex_t ecb_mf_lock = PTHREAD_MUTEX_INITIALIZER;
#define ECB_MEMORY_FENCE do { pthread_mutex_lock (&ecb_mf_lock); pthread_mutex_unlock (&ecb_mf_lock); } while (0)
#endif
#endif
static pthread_mutex_t ecb_mf_lock = PTHREAD_MUTEX_INITIALIZER;
#define ECB_MEMORY_FENCE do { pthread_mutex_lock (&ecb_mf_lock); pthread_mutex_unlock (&ecb_mf_lock); } while (0)
#if !defined(ECB_MEMORY_FENCE_ACQUIRE) && defined(ECB_MEMORY_FENCE)
#define ECB_MEMORY_FENCE_ACQUIRE ECB_MEMORY_FENCE
#endif
#if !defined(ECB_MEMORY_FENCE_RELEASE) && defined(ECB_MEMORY_FENCE)
#define ECB_MEMORY_FENCE_RELEASE ECB_MEMORY_FENCE
#endif
......@@ -234,9 +266,6 @@ typedef int ecb_bool;
return x >> 24;
}
/* you have the choice beetween something with a table lookup, */
/* something using lots of bit arithmetic and a simple loop */
/* we went for the loop */
ecb_function_ int ecb_ld32 (uint32_t x) ecb_const;
ecb_function_ int ecb_ld32 (uint32_t x)
{
......@@ -346,6 +375,22 @@ ecb_function_ ecb_bool ecb_little_endian (void) { return ecb_byteorder_helper ()
#define ecb_mod(m,n) ((m) < 0 ? ((n) - 1 - ((-1 - (m)) % (n))) : ((m) % (n)))
#endif
#if __cplusplus
template<typename T>
static inline T ecb_div_rd (T val, T div)
{
return val < 0 ? - ((-val + div - 1) / div) : (val ) / div;
}
template<typename T>
static inline T ecb_div_ru (T val, T div)
{
return val < 0 ? - ((-val ) / div) : (val + div - 1) / div;
}
#else
#define ecb_div_rd(val,div) ((val) < 0 ? - ((-(val) + (div) - 1) / (div)) : ((val) ) / (div))
#define ecb_div_ru(val,div) ((val) < 0 ? - ((-(val) ) / (div)) : ((val) + (div) - 1) / (div))
#endif
#if ecb_cplusplus_does_not_suck
/* does not work for local types (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2657.htm) */
template<typename T, int N>
......
This diff is collapsed.
......@@ -69,9 +69,13 @@ typedef int (*eio_cb)(eio_req *req);
#ifdef _WIN32
typedef int eio_uid_t;
typedef int eio_gid_t;
typedef intptr_t eio_ssize_t; /* or SSIZE_T */
#ifdef __MINGW32__ /* no intptr_t */
typedef ssize_t eio_ssize_t;
#else
typedef intptr_t eio_ssize_t; /* or SSIZE_T */
#endif
#if __GNUC__
typedef long long eio_ino_t;
typedef long long eio_ino_t; /* signed for compatibility to msvc */
#else
typedef __int64 eio_ino_t; /* unsigned not supported by msvc */
#endif
......@@ -86,6 +90,16 @@ typedef int (*eio_cb)(eio_req *req);
# define EIO_STRUCT_STATVFS struct statvfs
#endif
/* managing working directories */
typedef struct eio_pwd *eio_wd;
#define EIO_CWD 0 /* the current working directory of the process, guaranteed to be a null pointer */
#define EIO_INVALID_WD ((eio_wd)(int)-1) /* failure return for eio_wd_open */
eio_wd eio_wd_open_sync (eio_wd wd, const char *path);
void eio_wd_close_sync (eio_wd wd);
/* for readdir */
/* eio_readdir flags */
......@@ -166,23 +180,36 @@ typedef double eio_tstamp;
enum
{
EIO_CUSTOM,
EIO_OPEN, EIO_CLOSE, EIO_DUP2,
EIO_WD_OPEN, EIO_WD_CLOSE,
EIO_CLOSE, EIO_DUP2,
EIO_READ, EIO_WRITE,
EIO_READAHEAD, EIO_SENDFILE,
EIO_STAT, EIO_LSTAT, EIO_FSTAT,
EIO_STATVFS, EIO_FSTATVFS,
EIO_TRUNCATE, EIO_FTRUNCATE,
EIO_UTIME, EIO_FUTIME,
EIO_CHMOD, EIO_FCHMOD,
EIO_CHOWN, EIO_FCHOWN,
EIO_SYNC, EIO_FSYNC, EIO_FDATASYNC,
EIO_FSTAT, EIO_FSTATVFS,
EIO_FTRUNCATE, EIO_FUTIME, EIO_FCHMOD, EIO_FCHOWN,
EIO_SYNC, EIO_FSYNC, EIO_FDATASYNC, EIO_SYNCFS,
EIO_MSYNC, EIO_MTOUCH, EIO_SYNC_FILE_RANGE, EIO_FALLOCATE,
EIO_MLOCK, EIO_MLOCKALL,
EIO_UNLINK, EIO_RMDIR, EIO_MKDIR, EIO_RENAME,
EIO_MKNOD, EIO_READDIR,
EIO_LINK, EIO_SYMLINK, EIO_READLINK, EIO_REALPATH,
EIO_GROUP, EIO_NOP,
EIO_BUSY
EIO_BUSY,
/* these use wd + ptr1, but are emulated */
EIO_REALPATH,
EIO_STATVFS,
EIO_READDIR,
/* all the following requests use wd + ptr1 as path in xxxat functions */
EIO_OPEN,
EIO_STAT, EIO_LSTAT,
EIO_TRUNCATE,
EIO_UTIME,
EIO_CHMOD,
EIO_CHOWN,
EIO_UNLINK, EIO_RMDIR, EIO_MKDIR, EIO_RENAME,
EIO_MKNOD,
EIO_LINK, EIO_SYMLINK, EIO_READLINK,
EIO_REQ_TYPE_NUM
};
/* mlockall constants */
......@@ -207,6 +234,8 @@ struct eio_req
{
eio_req volatile *next; /* private ETP */
eio_wd wd; /* all applicable requests: working directory of pathname, old name; wd_open: return wd */
eio_ssize_t result; /* result of syscall, e.g. result = read (... */
off_t offs; /* read, write, truncate, readahead, sync_file_range, fallocate: file offset, mknod: dev_t */
size_t size; /* read, write, readahead, sendfile, msync, mlock, sync_file_range, fallocate: length */
......@@ -218,7 +247,7 @@ struct eio_req
int type; /* EIO_xxx constant ETP */
int int1; /* all applicable requests: file descriptor; sendfile: output fd; open, msync, mlockall, readdir: flags */
long int2; /* chown, fchown: uid; sendfile: input fd; open, chmod, mkdir, mknod: file mode, sync_file_range, fallocate: flags */
long int3; /* chown, fchown: gid */
long int3; /* chown, fchown: gid; rename, link: working directory of new name */
int errorno; /* errno value on syscall return */
#if __i386 || __amd64
......@@ -283,11 +312,14 @@ unsigned int eio_nthreads (void); /* number of worker threads in use currently *
/* convenience wrappers */
#ifndef EIO_NO_WRAPPERS
eio_req *eio_wd_open (const char *path, int pri, eio_cb cb, void *data); /* result=wd */
eio_req *eio_wd_close (eio_wd wd, int pri, eio_cb cb, void *data);
eio_req *eio_nop (int pri, eio_cb cb, void *data); /* does nothing except go through the whole process */
eio_req *eio_busy (eio_tstamp delay, int pri, eio_cb cb, void *data); /* ties a thread for this long, simulating busyness */
eio_req *eio_sync (int pri, eio_cb cb, void *data);
eio_req *eio_fsync (int fd, int pri, eio_cb cb, void *data);
eio_req *eio_fdatasync (int fd, int pri, eio_cb cb, void *data);
eio_req *eio_syncfs (int fd, int pri, eio_cb cb, void *data);
eio_req *eio_msync (void *addr, size_t length, int flags, int pri, eio_cb cb, void *data);
eio_req *eio_mtouch (void *addr, size_t length, int flags, int pri, eio_cb cb, void *data);
eio_req *eio_mlock (void *addr, size_t length, int pri, eio_cb cb, void *data);
......@@ -303,13 +335,13 @@ eio_req *eio_fstatvfs (int fd, int pri, eio_cb cb, void *data); /* stat buffer=
eio_req *eio_futime (int fd, eio_tstamp atime, eio_tstamp mtime, int pri, eio_cb cb, void *data);
eio_req *eio_ftruncate (int fd, off_t offset, int pri, eio_cb cb, void *data);
eio_req *eio_fchmod (int fd, mode_t mode, int pri, eio_cb cb, void *data);
eio_req *eio_fchown (int fd, uid_t uid, gid_t gid, int pri, eio_cb cb, void *data);
eio_req *eio_fchown (int fd, eio_uid_t uid, eio_gid_t gid, int pri, eio_cb cb, void *data);
eio_req *eio_dup2 (int fd, int fd2, int pri, eio_cb cb, void *data);
eio_req *eio_sendfile (int out_fd, int in_fd, off_t in_offset, size_t length, int pri, eio_cb cb, void *data);
eio_req *eio_open (const char *path, int flags, mode_t mode, int pri, eio_cb cb, void *data);
eio_req *eio_utime (const char *path, eio_tstamp atime, eio_tstamp mtime, int pri, eio_cb cb, void *data);
eio_req *eio_truncate (const char *path, off_t offset, int pri, eio_cb cb, void *data);
eio_req *eio_chown (const char *path, uid_t uid, gid_t gid, int pri, eio_cb cb, void *data);
eio_req *eio_chown (const char *path, eio_uid_t uid, eio_gid_t gid, int pri, eio_cb cb, void *data);
eio_req *eio_chmod (const char *path, mode_t mode, int pri, eio_cb cb, void *data);
eio_req *eio_mkdir (const char *path, mode_t mode, int pri, eio_cb cb, void *data);
eio_req *eio_readdir (const char *path, int flags, int pri, eio_cb cb, void *data); /* result=ptr2 allocated dynamically */
......
dnl openbsd in it's neverending brokenness requires stdint.h for intptr_t,
dnl but that header isn't very portable...
AC_CHECK_HEADERS([stdint.h])
AC_CHECK_HEADERS([stdint.h sys/syscall.h sys/prctl.h])
AC_SEARCH_LIBS(
pthread_create,
......@@ -138,6 +138,26 @@ int main (void)
],ac_cv_fallocate=yes,ac_cv_fallocate=no)])
test $ac_cv_fallocate = yes && AC_DEFINE(HAVE_FALLOCATE, 1, fallocate(2) is available)
AC_CACHE_CHECK(for sys_syncfs, ac_cv_sys_syncfs, [AC_LINK_IFELSE([
#include <unistd.h>
#include <sys/syscall.h>
int main (void)
{
int res = syscall (__NR_syncfs, (int)0);
}
],ac_cv_sys_syncfs=yes,ac_cv_sys_syncfs=no)])
test $ac_cv_sys_syncfs = yes && AC_DEFINE(HAVE_SYS_SYNCFS, 1, syscall(__NR_syncfs) is available)
AC_CACHE_CHECK(for prctl_set_name, ac_cv_prctl_set_name, [AC_LINK_IFELSE([
#include <sys/prctl.h>
int main (void)
{
char name[] = "test123";
int res = prctl (PR_SET_NAME, (unsigned long)name, 0, 0, 0);
}
],ac_cv_prctl_set_name=yes,ac_cv_prctl_set_name=no)])
test $ac_cv_prctl_set_name = yes && AC_DEFINE(HAVE_PRCTL_SET_NAME, 1, prctl(PR_SET_NAME) is available)
dnl #############################################################################
dnl # these checks exist for the benefit of IO::AIO
......
......@@ -16,7 +16,6 @@
/////////////////////////////////////////////////////////////////////////////
#ifdef _WIN32
typedef int ssize_t;
#define NTDDI_VERSION NTDDI_WIN2K // needed to get win2000 api calls
#define _WIN32_WINNT 0x400
......@@ -33,7 +32,6 @@ typedef int ssize_t;
#define pthread_sigmask(a,b,c)
#define sigaddset(a,b)
#define sigemptyset(s)
#define sigfillset(s)
typedef pthread_mutex_t xmutex_t;
#define X_MUTEX_INIT PTHREAD_MUTEX_INITIALIZER
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment