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.213 by root, Tue Apr 10 05:01:33 2012 UTC vs.
Revision 1.217 by root, Fri Jul 27 17:24:06 2012 UTC

983 const_eio (SYNC_FILE_RANGE_WAIT_BEFORE) 983 const_eio (SYNC_FILE_RANGE_WAIT_BEFORE)
984 const_eio (SYNC_FILE_RANGE_WRITE) 984 const_eio (SYNC_FILE_RANGE_WRITE)
985 const_eio (SYNC_FILE_RANGE_WAIT_AFTER) 985 const_eio (SYNC_FILE_RANGE_WAIT_AFTER)
986 986
987 const_eio (FALLOC_FL_KEEP_SIZE) 987 const_eio (FALLOC_FL_KEEP_SIZE)
988 const_eio (FALLOC_FL_PUNCH_HOLE)
988 989
989 const_eio (READDIR_DENTS) 990 const_eio (READDIR_DENTS)
990 const_eio (READDIR_DIRS_FIRST) 991 const_eio (READDIR_DIRS_FIRST)
991 const_eio (READDIR_STAT_ORDER) 992 const_eio (READDIR_STAT_ORDER)
992 const_eio (READDIR_FOUND_UNKNOWN) 993 const_eio (READDIR_FOUND_UNKNOWN)
1215 } 1216 }
1216 else 1217 else
1217 { 1218 {
1218 /* read: check type and grow scalar as necessary */ 1219 /* read: check type and grow scalar as necessary */
1219 SvUPGRADE (data, SVt_PV); 1220 SvUPGRADE (data, SVt_PV);
1221 if (SvLEN (data) >= SvCUR (data))
1220 svptr = SvGROW (data, len + dataoffset + 1); 1222 svptr = SvGROW (data, len + dataoffset + 1);
1223 else if (SvCUR (data) < len + dataoffset)
1224 croak ("length + dataoffset outside of scalar, and cannot grow");
1221 } 1225 }
1222 1226
1223 { 1227 {
1224 dREQ; 1228 dREQ;
1225 1229
1528 1532
1529void 1533void
1530aio_fiemap (SV *fh, off_t start, SV *length, U32 flags, SV *count, SV *callback=&PL_sv_undef) 1534aio_fiemap (SV *fh, off_t start, SV *length, U32 flags, SV *count, SV *callback=&PL_sv_undef)
1531 PPCODE: 1535 PPCODE:
1532{ 1536{
1533 int fd = s_fileno_croak (fh, 0); 1537 int fd = s_fileno_croak (fh, 0);
1534 dREQ; 1538 dREQ;
1535 1539
1536 req->type = EIO_CUSTOM; 1540 req->type = EIO_CUSTOM;
1537 req->sv1 = newSVsv (fh); 1541 req->sv1 = newSVsv (fh);
1538 req->int1 = fd; 1542 req->int1 = fd;
1686 RETVAL = eio_sendfile_sync (ofh, ifh, offset, count); 1690 RETVAL = eio_sendfile_sync (ofh, ifh, offset, count);
1687 OUTPUT: 1691 OUTPUT:
1688 RETVAL 1692 RETVAL
1689 1693
1690void 1694void
1691mmap (SV *scalar, size_t length, int prot, int flags, SV *fh, off_t offset = 0) 1695mmap (SV *scalar, size_t length, int prot, int flags, SV *fh = &PL_sv_undef, off_t offset = 0)
1692 PPCODE: 1696 PPCODE:
1693 sv_unmagic (scalar, MMAP_MAGIC); 1697 sv_unmagic (scalar, MMAP_MAGIC);
1694{ 1698{
1695 int fd = SvOK (fh) ? s_fileno_croak (fh, flags & PROT_WRITE) : -1; 1699 int fd = SvOK (fh) ? s_fileno_croak (fh, flags & PROT_WRITE) : -1;
1696 void *addr = (void *)mmap (0, length, prot, flags, fd, offset); 1700 void *addr = (void *)mmap (0, length, prot, flags, fd, offset);
1729 ALIAS: 1733 ALIAS:
1730 mprotect = 1 1734 mprotect = 1
1731 CODE: 1735 CODE:
1732{ 1736{
1733 STRLEN svlen; 1737 STRLEN svlen;
1734 void *addr = SvPVbyte (scalar, svlen); 1738 void *addr = SvPVbyte (scalar, svlen);
1735 size_t len = SvUV (length); 1739 size_t len = SvUV (length);
1736 1740
1737 if (offset < 0) 1741 if (offset < 0)
1738 offset += svlen; 1742 offset += svlen;
1739 1743

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines