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.179 by root, Fri Jan 7 21:47:15 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:
636/*****************************************************************************/ 637/*****************************************************************************/
637 638
638#if !_POSIX_MAPPED_FILES 639#if !_POSIX_MAPPED_FILES
639# define mmap(addr,length,prot,flags,fd,offs) (errno = ENOSYS, -1) 640# define mmap(addr,length,prot,flags,fd,offs) (errno = ENOSYS, -1)
640# define munmap(addr,length) (errno = ENOSYS, -1) 641# define munmap(addr,length) (errno = ENOSYS, -1)
642#endif
643
644#if !_POSIX_MEMORY_PROTECTION
641# define mprotect(addr,len,prot) (errno = ENOSYS, -1) 645# define mprotect(addr,len,prot) (errno = ENOSYS, -1)
642# define PROT_NONE 0 646# define PROT_NONE 0
643# define PROT_WRITE 0 647# define PROT_WRITE 0
644# define MAP_PRIVATE 0 648# define MAP_PRIVATE 0
645# define MAP_SHARED 0 649# define MAP_SHARED 0
1523 if (!SvOK (length) || len + offset > svlen) 1527 if (!SvOK (length) || len + offset > svlen)
1524 len = svlen - offset; 1528 len = svlen - offset;
1525 1529
1526 addr = (void *)(((intptr_t)addr) + offset); 1530 addr = (void *)(((intptr_t)addr) + offset);
1527 eio_page_align (&addr, &len); 1531 eio_page_align (&addr, &len);
1528#if _POSIX_MEMLOCK 1532#if _POSIX_MEMLOCK_RANGE
1529 RETVAL = munlock (addr, len); 1533 RETVAL = munlock (addr, len);
1530#else 1534#else
1531 RETVAL = ((errno = ENOSYS), -1); 1535 RETVAL = ((errno = ENOSYS), -1);
1532#endif 1536#endif
1533} 1537}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines