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.215 by root, Sun Jun 17 17:07:25 2012 UTC

1215 } 1215 }
1216 else 1216 else
1217 { 1217 {
1218 /* read: check type and grow scalar as necessary */ 1218 /* read: check type and grow scalar as necessary */
1219 SvUPGRADE (data, SVt_PV); 1219 SvUPGRADE (data, SVt_PV);
1220 if (SvLEN (data) >= SvCUR (data))
1220 svptr = SvGROW (data, len + dataoffset + 1); 1221 svptr = SvGROW (data, len + dataoffset + 1);
1222 else if (SvCUR (data) < len + dataoffset)
1223 croak ("length + dataoffset outside of scalar, and cannot grow");
1221 } 1224 }
1222 1225
1223 { 1226 {
1224 dREQ; 1227 dREQ;
1225 1228
1686 RETVAL = eio_sendfile_sync (ofh, ifh, offset, count); 1689 RETVAL = eio_sendfile_sync (ofh, ifh, offset, count);
1687 OUTPUT: 1690 OUTPUT:
1688 RETVAL 1691 RETVAL
1689 1692
1690void 1693void
1691mmap (SV *scalar, size_t length, int prot, int flags, SV *fh, off_t offset = 0) 1694mmap (SV *scalar, size_t length, int prot, int flags, SV *fh = &PL_sv_undef, off_t offset = 0)
1692 PPCODE: 1695 PPCODE:
1693 sv_unmagic (scalar, MMAP_MAGIC); 1696 sv_unmagic (scalar, MMAP_MAGIC);
1694{ 1697{
1695 int fd = SvOK (fh) ? s_fileno_croak (fh, flags & PROT_WRITE) : -1; 1698 int fd = SvOK (fh) ? s_fileno_croak (fh, flags & PROT_WRITE) : -1;
1696 void *addr = (void *)mmap (0, length, prot, flags, fd, offset); 1699 void *addr = (void *)mmap (0, length, prot, flags, fd, offset);
1729 ALIAS: 1732 ALIAS:
1730 mprotect = 1 1733 mprotect = 1
1731 CODE: 1734 CODE:
1732{ 1735{
1733 STRLEN svlen; 1736 STRLEN svlen;
1734 void *addr = SvPVbyte (scalar, svlen); 1737 void *addr = SvPVbyte (scalar, svlen);
1735 size_t len = SvUV (length); 1738 size_t len = SvUV (length);
1736 1739
1737 if (offset < 0) 1740 if (offset < 0)
1738 offset += svlen; 1741 offset += svlen;
1739 1742

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines