cpan Linux::AIO 1.3 broken (fwd)
Brad Fitzpatrick
brad at danga.com
Mon Oct 25 11:54:12 PDT 2004
I've mailed the Linux::AIO author about 1.3 being broken. When he added
AMD64 support, he must not have recompiled on a IA32 box.
Here's a patch which should work:
--- Linux-AIO-1.3.orig/AIO.xs Fri Aug 6 10:11:20 2004
+++ Linux-AIO-1.3/AIO.xs Mon Oct 25 11:50:53 2004
@@ -254,8 +254,8 @@
_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
- _syscall4(int,pread,int,fd,char *,buf,size_t,count,offset_t,offset)
- _syscall4(int,pwrite,int,fd,char *,buf,size_t,count,offset_t,offset)
+ _syscall4(int,pread,int,fd,char *,buf,size_t,count,off_t,offset)
+ _syscall4(int,pwrite,int,fd,char *,buf,size_t,count,off_t,offset)
#else
# error "neither pread nor pread64 defined"
#endif
@@ -286,6 +286,12 @@
switch (req->type)
{
+#ifdef __NR_stat64
+ struct stat64 statdata;
+#else
+ struct stat statdata;
+#endif
+
#ifdef __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;
@@ -294,12 +300,10 @@
case REQ_WRITE: req->result = pwrite (req->fd, req->dataptr, req->length, req->offset); break;
#endif
#ifdef __NR_stat64
- struct stat64 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;
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;
More information about the perlbal
mailing list