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.168 by root, Wed Aug 4 14:02:58 2010 UTC vs.
Revision 1.170 by root, Wed Aug 4 16:09:36 2010 UTC

138#ifndef POSIX_FADV_WILLNEED 138#ifndef POSIX_FADV_WILLNEED
139# define POSIX_FADV_WILLNEED 0 139# define POSIX_FADV_WILLNEED 0
140#endif 140#endif
141#ifndef POSIX_FADV_DONTNEED 141#ifndef POSIX_FADV_DONTNEED
142# define POSIX_FADV_DONTNEED 0 142# define POSIX_FADV_DONTNEED 0
143#endif
144
145#if _XOPEN_SOURCE < 600 || NO_FADVISE
146# define posix_fadvise(a,b,c,d) errno = ENOSYS /* also return ENOSYS */
147#endif
148
149#ifndef POSIX_MADV_NORMAL
150# define POSIX_MADV_NORMAL 0
151# define NO_MADVISE 1
152#endif
153#ifndef POSIX_MADV_SEQUENTIAL
154# define POSIX_MADV_SEQUENTIAL 0
155#endif
156#ifndef POSIX_MADV_RANDOM
157# define POSIX_MADV_RANDOM 0
158#endif
159#ifndef POSIX_MADV_WILLNEED
160# define POSIX_MADV_WILLNEED 0
161#endif
162#ifndef POSIX_MADV_DONTNEED
163# define POSIX_MADV_DONTNEED 0
164#endif
165
166#if _XOPEN_SOURCE < 600 || NO_MADVISE
167# define posix_madvise(a,b,c) errno = ENOSYS /* also return ENOSYS */
143#endif 168#endif
144 169
145#ifndef ST_NODEV 170#ifndef ST_NODEV
146# define ST_NODEV 0 171# define ST_NODEV 0
147#endif 172#endif
699 const_niv (FADV_RANDOM , POSIX_FADV_RANDOM) 724 const_niv (FADV_RANDOM , POSIX_FADV_RANDOM)
700 const_niv (FADV_NOREUSE , POSIX_FADV_NOREUSE) 725 const_niv (FADV_NOREUSE , POSIX_FADV_NOREUSE)
701 const_niv (FADV_WILLNEED , POSIX_FADV_WILLNEED) 726 const_niv (FADV_WILLNEED , POSIX_FADV_WILLNEED)
702 const_niv (FADV_DONTNEED , POSIX_FADV_DONTNEED) 727 const_niv (FADV_DONTNEED , POSIX_FADV_DONTNEED)
703 728
729 const_niv (MADV_NORMAL , POSIX_MADV_NORMAL)
730 const_niv (MADV_SEQUENTIAL, POSIX_MADV_SEQUENTIAL)
731 const_niv (MADV_RANDOM , POSIX_MADV_RANDOM)
732 const_niv (MADV_WILLNEED , POSIX_MADV_WILLNEED)
733 const_niv (MADV_DONTNEED , POSIX_MADV_DONTNEED)
734
704 const_iv (ST_RDONLY) 735 const_iv (ST_RDONLY)
705 const_iv (ST_NOSUID) 736 const_iv (ST_NOSUID)
706 const_iv (ST_NODEV) 737 const_iv (ST_NODEV)
707 const_iv (ST_NOEXEC) 738 const_iv (ST_NOEXEC)
708 const_iv (ST_SYNCHRONOUS) 739 const_iv (ST_SYNCHRONOUS)
1362 1393
1363int 1394int
1364fadvise (aio_rfd fh, off_t offset, off_t length, IV advice) 1395fadvise (aio_rfd fh, off_t offset, off_t length, IV advice)
1365 PROTOTYPE: $$$$ 1396 PROTOTYPE: $$$$
1366 CODE: 1397 CODE:
1367#if _XOPEN_SOURCE >= 600 && !NO_FADVISE
1368 RETVAL = posix_fadvise (fh, offset, length, advice); 1398 RETVAL = posix_fadvise (fh, offset, length, advice);
1369#else
1370 RETVAL = errno = ENOSYS; /* yes, this is actually correct */
1371#endif
1372 OUTPUT: 1399 OUTPUT:
1373 RETVAL 1400 RETVAL
1374 1401
1375ssize_t 1402ssize_t
1376sendfile (aio_wfd ofh, aio_rfd ifh, off_t offset, size_t count) 1403sendfile (aio_wfd ofh, aio_rfd ifh, off_t offset, size_t count)
1416void 1443void
1417munmap (SV *scalar) 1444munmap (SV *scalar)
1418 PROTOTYPE: $ 1445 PROTOTYPE: $
1419 CODE: 1446 CODE:
1420 sv_unmagic (scalar, MMAP_MAGIC); 1447 sv_unmagic (scalar, MMAP_MAGIC);
1448
1449int
1450madvise (SV *scalar, off_t offset, off_t length, IV advice)
1451 PROTOTYPE: $$$$
1452 CODE:
1453{
1454 char *addr = SvPV_nolen (scalar) + offset;
1455
1456 if (!SvOK (ST (2)))
1457 length = SvCUR (scalar) - offset;
1458
1459 if (addr >= SvEND (scalar) || length <= 0)
1460 XSRETURN_EMPTY;
1461
1462 RETVAL = posix_madvise (addr, length, advice);
1463}
1464 OUTPUT:
1465 RETVAL
1421 1466
1422int 1467int
1423mlockall (int flags) 1468mlockall (int flags)
1424 PROTOTYPE: $ 1469 PROTOTYPE: $
1425 CODE: 1470 CODE:

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines