--- IO-AIO/AIO.xs 2010/08/04 16:06:54 1.169 +++ IO-AIO/AIO.xs 2010/08/04 16:09:36 1.170 @@ -142,6 +142,10 @@ # define POSIX_FADV_DONTNEED 0 #endif +#if _XOPEN_SOURCE < 600 || NO_FADVISE +# define posix_fadvise(a,b,c,d) errno = ENOSYS /* also return ENOSYS */ +#endif + #ifndef POSIX_MADV_NORMAL # define POSIX_MADV_NORMAL 0 # define NO_MADVISE 1 @@ -159,6 +163,10 @@ # define POSIX_MADV_DONTNEED 0 #endif +#if _XOPEN_SOURCE < 600 || NO_MADVISE +# define posix_madvise(a,b,c) errno = ENOSYS /* also return ENOSYS */ +#endif + #ifndef ST_NODEV # define ST_NODEV 0 #endif @@ -1387,11 +1395,7 @@ fadvise (aio_rfd fh, off_t offset, off_t length, IV advice) PROTOTYPE: $$$$ CODE: -#if _XOPEN_SOURCE >= 600 && !NO_FADVISE RETVAL = posix_fadvise (fh, offset, length, advice); -#else - RETVAL = errno = ENOSYS; /* yes, this is actually correct */ -#endif OUTPUT: RETVAL @@ -1455,11 +1459,7 @@ if (addr >= SvEND (scalar) || length <= 0) XSRETURN_EMPTY; - #if _XOPEN_SOURCE >= 600 && !NO_MADVISE RETVAL = posix_madvise (addr, length, advice); - #else - RETVAL = errno = ENOSYS; /* yes, this is actually correct */ - #endif } OUTPUT: RETVAL