--- Linux-AIO/AIO.xs 2005/06/29 15:28:14 1.23 +++ Linux-AIO/AIO.xs 2005/07/07 22:24:09 1.25 @@ -15,7 +15,8 @@ typedef void *OutputStream; /* hack, but 5.6.1 is simply toooo old ;) */ typedef void *InOutStream; /* hack, but 5.6.1 is simply toooo old ;) */ -#define STACKSIZE (128 * sizeof (long)) /* yeah */ +// 128 seems to be enough most everywhere. alpha needs 256. +#define STACKSIZE (256 * sizeof (long)) enum { REQ_QUIT, @@ -234,6 +235,17 @@ #include #include +#if __alpha || __ia64 || __hppa || __sparc64__ || __v850__ +# define stat kernelstat +# define stat64 kernelstat64 +# include +# undef stat +# undef stat64 +#else +# define kernelstat stat +# define kernelstat64 stat64 +#endif + #define COPY_STATDATA \ req->statdata->st_dev = statdata.st_dev; \ req->statdata->st_ino = statdata.st_ino; \ @@ -264,7 +276,7 @@ _syscall3(int,open,char *,pathname,int,flags,mode_t,mode) _syscall1(int,close,int,fd) -#ifdef __NR_pread64 +#if __NR_pread64 _syscall5(int,pread64,int,fd,char *,buf,size_t,count,unsigned int,offset_lo,unsigned int,offset_hi) _syscall5(int,pwrite64,int,fd,char *,buf,size_t,count,unsigned int,offset_lo,unsigned int,offset_hi) #elif __NR_pread @@ -275,14 +287,14 @@ #endif -#ifdef __NR_stat64 - _syscall2(int,stat64, const char *, filename, struct stat64 *, buf) - _syscall2(int,lstat64, const char *, filename, struct stat64 *, buf) - _syscall2(int,fstat64, int, fd, struct stat64 *, buf) +#if __NR_stat64 + _syscall2(int,stat64, const char *, filename, struct kernelstat64 *, buf) + _syscall2(int,lstat64, const char *, filename, struct kernelstat64 *, buf) + _syscall2(int,fstat64, int, fd, struct kernelstat64 *, buf) #elif __NR_stat - _syscall2(int,stat, const char *, filename, struct stat *, buf) - _syscall2(int,lstat, const char *, filename, struct stat *, buf) - _syscall2(int,fstat, int, fd, struct stat *, buf) + _syscall2(int,stat, const char *, filename, struct kernelstat *, buf) + _syscall2(int,lstat, const char *, filename, struct kernelstat *, buf) + _syscall2(int,fstat, int, fd, struct kernelstat *, buf) #else # error "neither stat64 nor stat defined" #endif @@ -300,20 +312,20 @@ switch (req->type) { -#ifdef __NR_pread64 +#if __NR_pread64 case REQ_READ: req->result = pread64 (req->fd, req->dataptr, req->length, req->offset & 0xffffffff, req->offset >> 32); break; case REQ_WRITE: req->result = pwrite64(req->fd, req->dataptr, req->length, req->offset & 0xffffffff, req->offset >> 32); break; #else case REQ_READ: req->result = pread (req->fd, req->dataptr, req->length, req->offset); break; case REQ_WRITE: req->result = pwrite (req->fd, req->dataptr, req->length, req->offset); break; #endif -#ifdef __NR_stat64 - struct stat64 statdata; +#if __NR_stat64 + struct kernelstat64 statdata; case REQ_STAT: req->result = stat64 (req->dataptr, &statdata); COPY_STATDATA; break; case REQ_LSTAT: req->result = lstat64 (req->dataptr, &statdata); COPY_STATDATA; break; case REQ_FSTAT: req->result = fstat64 (req->fd, &statdata); COPY_STATDATA; break; #else - struct stat statdata; + struct kernelstat statdata; case REQ_STAT: req->result = stat (req->dataptr, &statdata); COPY_STATDATA; break; case REQ_LSTAT: req->result = lstat (req->dataptr, &statdata); COPY_STATDATA; break; case REQ_FSTAT: req->result = fstat (req->fd, &statdata); COPY_STATDATA; break;