ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/IO-AIO/AIO.xs
(Generate patch)

Comparing IO-AIO/AIO.xs (file contents):
Revision 1.184 by root, Tue Jul 5 20:34:42 2011 UTC vs.
Revision 1.186 by root, Thu Jul 14 22:36:17 2011 UTC

11#include <stddef.h> 11#include <stddef.h>
12#include <stdlib.h> 12#include <stdlib.h>
13#include <errno.h> 13#include <errno.h>
14#include <sys/types.h> 14#include <sys/types.h>
15#include <sys/stat.h> 15#include <sys/stat.h>
16#include <sys/statvfs.h>
17#include <limits.h> 16#include <limits.h>
18#include <fcntl.h> 17#include <fcntl.h>
19#include <sched.h> 18#include <sched.h>
20 19
21#if _POSIX_MEMLOCK || _POSIX_MEMLOCK_RANGE || _POSIX_MAPPED_FILES 20#if _POSIX_MEMLOCK || _POSIX_MEMLOCK_RANGE || _POSIX_MAPPED_FILES
47# undef unlink 46# undef unlink
48# undef rmdir 47# undef rmdir
49# undef rename 48# undef rename
50# undef lseek 49# undef lseek
51 50
52# define chown(a,b,c) (errno = ENOSYS, -1)
53# define fchown(a,b,c) (errno = ENOSYS, -1)
54# define fchmod(a,b) (errno = ENOSYS, -1)
55# define symlink(a,b) (errno = ENOSYS, -1)
56# define readlink(a,b,c) (errno = ENOSYS, -1)
57# define mknod(a,b,c) (errno = ENOSYS, -1)
58# define truncate(a,b) (errno = ENOSYS, -1)
59# define ftruncate(fd,o) chsize ((fd), (o))
60# define fsync(fd) _commit (fd)
61# define opendir(fd) (errno = ENOSYS, 0) 51# define opendir(fd) (errno = ENOSYS, 0)
62# define readdir(fd) (errno = ENOSYS, -1) 52# define readdir(fd) (errno = ENOSYS, -1)
63# define closedir(fd) (errno = ENOSYS, -1) 53# define closedir(fd) (errno = ENOSYS, -1)
64# define mkdir(a,b) mkdir (a)
65 54
66#else 55#else
67 56
68# include <sys/time.h> 57# include <sys/time.h>
69# include <sys/select.h> 58# include <sys/select.h>
891 880
892 const_eio (SYNC_FILE_RANGE_WAIT_BEFORE) 881 const_eio (SYNC_FILE_RANGE_WAIT_BEFORE)
893 const_eio (SYNC_FILE_RANGE_WRITE) 882 const_eio (SYNC_FILE_RANGE_WRITE)
894 const_eio (SYNC_FILE_RANGE_WAIT_AFTER) 883 const_eio (SYNC_FILE_RANGE_WAIT_AFTER)
895 884
885 const_eio (FALLOC_FL_KEEP_SIZE)
886
896 const_eio (READDIR_DENTS) 887 const_eio (READDIR_DENTS)
897 const_eio (READDIR_DIRS_FIRST) 888 const_eio (READDIR_DIRS_FIRST)
898 const_eio (READDIR_STAT_ORDER) 889 const_eio (READDIR_STAT_ORDER)
899 const_eio (READDIR_FOUND_UNKNOWN) 890 const_eio (READDIR_FOUND_UNKNOWN)
900 891
1012 req->sv1 = newSVsv (fh); 1003 req->sv1 = newSVsv (fh);
1013 req->int1 = fd; 1004 req->int1 = fd;
1014 req->offs = offset; 1005 req->offs = offset;
1015 req->size = nbytes; 1006 req->size = nbytes;
1016 req->int2 = flags; 1007 req->int2 = flags;
1008
1009 REQ_SEND (req);
1010}
1011
1012void
1013aio_fallocate (SV *fh, int mode, off_t offset, size_t len, SV *callback=&PL_sv_undef)
1014 PPCODE:
1015{
1016 int fd = s_fileno_croak (fh, 0);
1017 dREQ;
1018
1019 req->type = EIO_FALLOCATE;
1020 req->sv1 = newSVsv (fh);
1021 req->int1 = fd;
1022 req->int2 = mode;
1023 req->offs = offset;
1024 req->size = len;
1017 1025
1018 REQ_SEND (req); 1026 REQ_SEND (req);
1019} 1027}
1020 1028
1021void 1029void

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines