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.176 by root, Thu Dec 2 10:04:47 2010 UTC vs.
Revision 1.178 by root, Fri Jan 7 21:45:42 2011 UTC

16#include <sys/statvfs.h> 16#include <sys/statvfs.h>
17#include <limits.h> 17#include <limits.h>
18#include <fcntl.h> 18#include <fcntl.h>
19#include <sched.h> 19#include <sched.h>
20 20
21#if _POSIX_MEMLOCK || _POSIX_MAPPED_FILES 21#if _POSIX_MEMLOCK || _POSIX_MEMLOCK_RANGE || _POSIX_MAPPED_FILES
22# include <sys/mman.h> 22# include <sys/mman.h>
23#endif 23#endif
24 24
25/* perl namespace pollution */ 25/* perl namespace pollution */
26#undef VERSION 26#undef VERSION
353 /* do not recreate the result IV from scratch each time */ 353 /* do not recreate the result IV from scratch each time */
354 if (expect_true (sv_result_cache)) 354 if (expect_true (sv_result_cache))
355 { 355 {
356 sv_result = sv_result_cache; sv_result_cache = 0; 356 sv_result = sv_result_cache; sv_result_cache = 0;
357 SvIV_set (sv_result, req->result); 357 SvIV_set (sv_result, req->result);
358 SvIOK_only (sv_result);
358 } 359 }
359 else 360 else
360 { 361 {
361 sv_result = newSViv (req->result); 362 sv_result = newSViv (req->result);
362 SvREADONLY_on (sv_result); 363 SvREADONLY_on (sv_result);
526 SvSETMAGIC (req->sv2); 527 SvSETMAGIC (req->sv2);
527 PUSHs (sv_result); 528 PUSHs (sv_result);
528 } 529 }
529 break; 530 break;
530 531
531 case EIO_DUP2: /* EIO_DUP2 actually means aio_close(), su fudge result value */ 532 case EIO_DUP2: /* EIO_DUP2 actually means aio_close(), so fudge result value */
532 if (req->result > 0) 533 if (req->result > 0)
533 SvIV_set (sv_result, 0); 534 SvIV_set (sv_result, 0);
534 /* FALLTHROUGH */ 535 /* FALLTHROUGH */
535 536
536 default: 537 default:
1523 if (!SvOK (length) || len + offset > svlen) 1524 if (!SvOK (length) || len + offset > svlen)
1524 len = svlen - offset; 1525 len = svlen - offset;
1525 1526
1526 addr = (void *)(((intptr_t)addr) + offset); 1527 addr = (void *)(((intptr_t)addr) + offset);
1527 eio_page_align (&addr, &len); 1528 eio_page_align (&addr, &len);
1528#if _POSIX_MEMLOCK 1529#if _POSIX_MEMLOCK_RANGE
1529 RETVAL = munlock (addr, len); 1530 RETVAL = munlock (addr, len);
1530#else 1531#else
1531 RETVAL = ((errno = ENOSYS), -1); 1532 RETVAL = ((errno = ENOSYS), -1);
1532#endif 1533#endif
1533} 1534}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines