… | |
… | |
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 |
21 | #if _POSIX_MEMLOCK || _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 |
… | |
… | |
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 |
143 | #endif |
144 | |
144 | |
|
|
145 | #ifndef POSIX_MADV_NORMAL |
|
|
146 | # define POSIX_MADV_NORMAL 0 |
|
|
147 | # define NO_MADVISE 1 |
|
|
148 | #endif |
|
|
149 | #ifndef POSIX_MADV_SEQUENTIAL |
|
|
150 | # define POSIX_MADV_SEQUENTIAL 0 |
|
|
151 | #endif |
|
|
152 | #ifndef POSIX_MADV_RANDOM |
|
|
153 | # define POSIX_MADV_RANDOM 0 |
|
|
154 | #endif |
|
|
155 | #ifndef POSIX_MADV_WILLNEED |
|
|
156 | # define POSIX_MADV_WILLNEED 0 |
|
|
157 | #endif |
|
|
158 | #ifndef POSIX_MADV_DONTNEED |
|
|
159 | # define POSIX_MADV_DONTNEED 0 |
|
|
160 | #endif |
|
|
161 | |
145 | #ifndef ST_NODEV |
162 | #ifndef ST_NODEV |
146 | # define ST_NODEV 0 |
163 | # define ST_NODEV 0 |
147 | #endif |
164 | #endif |
148 | #ifndef ST_NOEXEC |
165 | #ifndef ST_NOEXEC |
149 | # define ST_NOEXEC 0 |
166 | # define ST_NOEXEC 0 |
… | |
… | |
176 | #ifndef MCL_CURRENT |
193 | #ifndef MCL_CURRENT |
177 | # define MCL_CURRENT 0 |
194 | # define MCL_CURRENT 0 |
178 | #endif |
195 | #endif |
179 | #ifndef MCL_FUTURE |
196 | #ifndef MCL_FUTURE |
180 | # define MCL_FUTURE 0 |
197 | # define MCL_FUTURE 0 |
|
|
198 | #endif |
|
|
199 | |
|
|
200 | #ifndef MAP_ANONYMOUS |
|
|
201 | # ifdef MAP_ANON |
|
|
202 | # define MAP_ANONYMOUS MAP_ANON |
|
|
203 | # else |
|
|
204 | # define MAP_ANONYMOUS MAP_FIXED /* and hope this fails */ |
|
|
205 | # endif |
|
|
206 | #endif |
|
|
207 | #ifndef MAP_HUGETLB |
|
|
208 | # define MAP_HUGETLB 0 |
|
|
209 | #endif |
|
|
210 | #ifndef MAP_LOCKED |
|
|
211 | # define MAP_LOCKED 0 |
|
|
212 | #endif |
|
|
213 | #ifndef MAP_NORESERVE |
|
|
214 | # define MAP_NORESERVE 0 |
|
|
215 | #endif |
|
|
216 | #ifndef MAP_POPULATE |
|
|
217 | # define MAP_POPULATE 0 |
|
|
218 | #endif |
|
|
219 | #ifndef MAP_NONBLOCK |
|
|
220 | # define MAP_NONBLOCK 0 |
|
|
221 | #endif |
|
|
222 | |
|
|
223 | #ifndef PAGESIZE |
|
|
224 | # define PAGESIZE sysconf (_SC_PAGESIZE) |
181 | #endif |
225 | #endif |
182 | |
226 | |
183 | static int req_invoke (eio_req *req); |
227 | static int req_invoke (eio_req *req); |
184 | #define EIO_FINISH(req) req_invoke (req) |
228 | #define EIO_FINISH(req) req_invoke (req) |
185 | static void req_destroy (eio_req *grp); |
229 | static void req_destroy (eio_req *grp); |
… | |
… | |
277 | } |
321 | } |
278 | } |
322 | } |
279 | |
323 | |
280 | static int req_invoke (eio_req *req) |
324 | static int req_invoke (eio_req *req) |
281 | { |
325 | { |
282 | dSP; |
|
|
283 | |
|
|
284 | if (req->flags & FLAG_SV2_RO_OFF) |
326 | if (req->flags & FLAG_SV2_RO_OFF) |
285 | SvREADONLY_off (req->sv2); |
327 | SvREADONLY_off (req->sv2); |
286 | |
328 | |
287 | if (!EIO_CANCELLED (req) && req->callback) |
329 | if (!EIO_CANCELLED (req) && req->callback) |
288 | { |
330 | { |
|
|
331 | dSP; |
|
|
332 | static SV *sv_result_cache; /* caches the result integer SV */ |
|
|
333 | SV *sv_result; |
|
|
334 | |
289 | ENTER; |
335 | ENTER; |
290 | SAVETMPS; |
336 | SAVETMPS; |
291 | PUSHMARK (SP); |
337 | PUSHMARK (SP); |
292 | EXTEND (SP, 1); |
338 | EXTEND (SP, 1); |
|
|
339 | |
|
|
340 | /* do not recreate the result IV from scratch each time */ |
|
|
341 | if (expect_true (sv_result_cache)) |
|
|
342 | { |
|
|
343 | sv_result = sv_result_cache; sv_result_cache = 0; |
|
|
344 | SvIV_set (sv_result, req->result); |
|
|
345 | } |
|
|
346 | else |
|
|
347 | { |
|
|
348 | sv_result = newSViv (req->result); |
|
|
349 | SvREADONLY_on (sv_result); |
|
|
350 | } |
293 | |
351 | |
294 | switch (req->type) |
352 | switch (req->type) |
295 | { |
353 | { |
296 | case EIO_READDIR: |
354 | case EIO_READDIR: |
297 | { |
355 | { |
… | |
… | |
442 | case EIO_LSTAT: |
500 | case EIO_LSTAT: |
443 | case EIO_FSTAT: |
501 | case EIO_FSTAT: |
444 | PL_laststype = req->type == EIO_LSTAT ? OP_LSTAT : OP_STAT; |
502 | PL_laststype = req->type == EIO_LSTAT ? OP_LSTAT : OP_STAT; |
445 | PL_laststatval = req->result; |
503 | PL_laststatval = req->result; |
446 | PL_statcache = *(EIO_STRUCT_STAT *)(req->ptr2); |
504 | PL_statcache = *(EIO_STRUCT_STAT *)(req->ptr2); |
447 | PUSHs (sv_2mortal (newSViv (req->result))); |
505 | PUSHs (sv_result); |
448 | break; |
506 | break; |
449 | |
507 | |
450 | case EIO_READ: |
508 | case EIO_READ: |
451 | { |
509 | { |
452 | SvCUR_set (req->sv2, req->stroffset + (req->result > 0 ? req->result : 0)); |
510 | SvCUR_set (req->sv2, req->stroffset + (req->result > 0 ? req->result : 0)); |
453 | *SvEND (req->sv2) = 0; |
511 | *SvEND (req->sv2) = 0; |
454 | SvPOK_only (req->sv2); |
512 | SvPOK_only (req->sv2); |
455 | SvSETMAGIC (req->sv2); |
513 | SvSETMAGIC (req->sv2); |
456 | PUSHs (sv_2mortal (newSViv (req->result))); |
514 | PUSHs (sv_result); |
457 | } |
515 | } |
458 | break; |
516 | break; |
459 | |
517 | |
460 | case EIO_DUP2: |
518 | case EIO_DUP2: /* EIO_DUP2 actually means aio_close(), su fudge result value */ |
461 | if (req->result > 0) |
519 | if (req->result > 0) |
462 | req->result = 0; |
520 | SvIV_set (sv_result, 0); |
463 | /* FALLTHROUGH */ |
521 | /* FALLTHROUGH */ |
464 | |
522 | |
465 | default: |
523 | default: |
466 | PUSHs (sv_2mortal (newSViv (req->result))); |
524 | PUSHs (sv_result); |
467 | break; |
525 | break; |
468 | } |
526 | } |
469 | |
527 | |
470 | errno = req->errorno; |
528 | errno = req->errorno; |
471 | |
529 | |
472 | PUTBACK; |
530 | PUTBACK; |
473 | call_sv (req->callback, G_VOID | G_EVAL | G_DISCARD); |
531 | call_sv (req->callback, G_VOID | G_EVAL | G_DISCARD); |
474 | SPAGAIN; |
532 | SPAGAIN; |
|
|
533 | |
|
|
534 | if (expect_false (SvREFCNT (sv_result) != 1 || sv_result_cache)) |
|
|
535 | SvREFCNT_dec (sv_result); |
|
|
536 | else |
|
|
537 | sv_result_cache = sv_result; |
475 | |
538 | |
476 | FREETMPS; |
539 | FREETMPS; |
477 | LEAVE; |
540 | LEAVE; |
478 | |
541 | |
479 | PUTBACK; |
542 | PUTBACK; |
… | |
… | |
554 | |
617 | |
555 | static void atfork_child (void) |
618 | static void atfork_child (void) |
556 | { |
619 | { |
557 | create_respipe (); |
620 | create_respipe (); |
558 | } |
621 | } |
|
|
622 | |
|
|
623 | /*****************************************************************************/ |
|
|
624 | |
|
|
625 | #if !_POSIX_MAPPED_FILES |
|
|
626 | # define mmap(addr,length,prot,flags,fd,offs) (errno = ENOSYS, -1) |
|
|
627 | # define munmap(addr,length) (errno = ENOSYS, -1) |
|
|
628 | #endif |
|
|
629 | |
|
|
630 | #define MMAP_MAGIC PERL_MAGIC_ext |
|
|
631 | |
|
|
632 | static int |
|
|
633 | mmap_free (pTHX_ SV *sv, MAGIC *mg) |
|
|
634 | { |
|
|
635 | int old_errno = errno; |
|
|
636 | munmap (mg->mg_ptr, (size_t)mg->mg_obj); |
|
|
637 | errno = old_errno; |
|
|
638 | |
|
|
639 | mg->mg_obj = 0; /* just in case */ |
|
|
640 | |
|
|
641 | SvREADONLY_off (sv); |
|
|
642 | |
|
|
643 | if (SvPVX (sv) != mg->mg_ptr) |
|
|
644 | croak ("ERROR: IO::AIO::mmap-mapped scalar changed location, detected"); |
|
|
645 | |
|
|
646 | SvCUR_set (sv, 0); |
|
|
647 | SvPVX (sv) = 0; |
|
|
648 | SvOK_off (sv); |
|
|
649 | |
|
|
650 | return 0; |
|
|
651 | } |
|
|
652 | |
|
|
653 | static MGVTBL mmap_vtbl = { |
|
|
654 | 0, 0, 0, 0, mmap_free |
|
|
655 | }; |
|
|
656 | |
|
|
657 | /*****************************************************************************/ |
559 | |
658 | |
560 | static SV * |
659 | static SV * |
561 | get_cb (SV *cb_sv) |
660 | get_cb (SV *cb_sv) |
562 | { |
661 | { |
563 | SvGETMAGIC (cb_sv); |
662 | SvGETMAGIC (cb_sv); |
… | |
… | |
595 | { |
694 | { |
596 | static const struct { |
695 | static const struct { |
597 | const char *name; |
696 | const char *name; |
598 | IV iv; |
697 | IV iv; |
599 | } *civ, const_iv[] = { |
698 | } *civ, const_iv[] = { |
600 | # define const_iv(name, value) { # name, (IV) value }, |
699 | # define const_niv(name, value) { # name, (IV) value }, |
|
|
700 | # define const_iv(name) { # name, (IV) name }, |
601 | # define const_eio(name) { # name, (IV) EIO_ ## name }, |
701 | # define const_eio(name) { # name, (IV) EIO_ ## name }, |
602 | const_iv (EXDEV , EXDEV) |
702 | const_iv (EXDEV) |
603 | const_iv (ENOSYS , ENOSYS) |
703 | const_iv (ENOSYS) |
604 | const_iv (O_RDONLY, O_RDONLY) |
704 | const_iv (O_RDONLY) |
605 | const_iv (O_WRONLY, O_WRONLY) |
705 | const_iv (O_WRONLY) |
|
|
706 | const_iv (O_RDWR) |
606 | const_iv (O_CREAT , O_CREAT) |
707 | const_iv (O_CREAT) |
607 | const_iv (O_TRUNC , O_TRUNC) |
708 | const_iv (O_TRUNC) |
|
|
709 | const_iv (O_EXCL) |
|
|
710 | const_iv (O_APPEND) |
608 | #ifndef _WIN32 |
711 | #ifndef _WIN32 |
609 | const_iv (S_IFIFO , S_IFIFO) |
712 | const_iv (S_IFIFO) |
610 | #endif |
713 | #endif |
611 | const_iv (FADV_NORMAL , POSIX_FADV_NORMAL) |
714 | const_niv (FADV_NORMAL , POSIX_FADV_NORMAL) |
612 | const_iv (FADV_SEQUENTIAL, POSIX_FADV_SEQUENTIAL) |
715 | const_niv (FADV_SEQUENTIAL, POSIX_FADV_SEQUENTIAL) |
613 | const_iv (FADV_RANDOM , POSIX_FADV_RANDOM) |
716 | const_niv (FADV_RANDOM , POSIX_FADV_RANDOM) |
614 | const_iv (FADV_NOREUSE , POSIX_FADV_NOREUSE) |
717 | const_niv (FADV_NOREUSE , POSIX_FADV_NOREUSE) |
615 | const_iv (FADV_WILLNEED , POSIX_FADV_WILLNEED) |
718 | const_niv (FADV_WILLNEED , POSIX_FADV_WILLNEED) |
616 | const_iv (FADV_DONTNEED , POSIX_FADV_DONTNEED) |
719 | const_niv (FADV_DONTNEED , POSIX_FADV_DONTNEED) |
617 | |
720 | |
618 | const_iv (ST_RDONLY , ST_RDONLY) |
721 | const_niv (MADV_NORMAL , POSIX_MADV_NORMAL) |
619 | const_iv (ST_NOSUID , ST_NOSUID) |
722 | const_niv (MADV_SEQUENTIAL, POSIX_MADV_SEQUENTIAL) |
620 | const_iv (ST_NODEV , ST_NODEV) |
723 | const_niv (MADV_RANDOM , POSIX_MADV_RANDOM) |
621 | const_iv (ST_NOEXEC , ST_NOEXEC) |
724 | const_niv (MADV_WILLNEED , POSIX_MADV_WILLNEED) |
|
|
725 | const_niv (MADV_DONTNEED , POSIX_MADV_DONTNEED) |
|
|
726 | |
|
|
727 | const_iv (ST_RDONLY) |
|
|
728 | const_iv (ST_NOSUID) |
|
|
729 | const_iv (ST_NODEV) |
|
|
730 | const_iv (ST_NOEXEC) |
622 | const_iv (ST_SYNCHRONOUS , ST_SYNCHRONOUS) |
731 | const_iv (ST_SYNCHRONOUS) |
623 | const_iv (ST_MANDLOCK , ST_MANDLOCK) |
732 | const_iv (ST_MANDLOCK) |
624 | const_iv (ST_WRITE , ST_WRITE) |
733 | const_iv (ST_WRITE) |
625 | const_iv (ST_APPEND , ST_APPEND) |
734 | const_iv (ST_APPEND) |
626 | const_iv (ST_IMMUTABLE , ST_IMMUTABLE) |
735 | const_iv (ST_IMMUTABLE) |
627 | const_iv (ST_NOATIME , ST_NOATIME) |
736 | const_iv (ST_NOATIME) |
628 | const_iv (ST_NODIRATIME , ST_NODIRATIME) |
737 | const_iv (ST_NODIRATIME) |
629 | const_iv (ST_RELATIME , ST_RELATIME) |
738 | const_iv (ST_RELATIME) |
630 | |
739 | |
631 | const_iv (MCL_FUTURE , MCL_FUTURE) |
740 | const_iv (PROT_EXEC) |
|
|
741 | const_iv (PROT_NONE) |
|
|
742 | const_iv (PROT_READ) |
|
|
743 | const_iv (PROT_WRITE) |
|
|
744 | |
|
|
745 | /*const_iv (MAP_FIXED)*/ |
|
|
746 | const_iv (MAP_PRIVATE) |
|
|
747 | const_iv (MAP_SHARED) |
|
|
748 | const_iv (MAP_ANONYMOUS) |
|
|
749 | |
|
|
750 | /* linuxish */ |
|
|
751 | const_iv (MAP_HUGETLB) |
|
|
752 | const_iv (MAP_LOCKED) |
|
|
753 | const_iv (MAP_NORESERVE) |
|
|
754 | const_iv (MAP_POPULATE) |
|
|
755 | const_iv (MAP_NONBLOCK) |
|
|
756 | |
|
|
757 | const_iv (MCL_FUTURE) |
632 | const_iv (MCL_CURRENT , MCL_CURRENT) |
758 | const_iv (MCL_CURRENT) |
633 | |
759 | |
634 | const_eio (MS_ASYNC) |
760 | const_eio (MS_ASYNC) |
635 | const_eio (MS_INVALIDATE) |
761 | const_eio (MS_INVALIDATE) |
636 | const_eio (MS_SYNC) |
762 | const_eio (MS_SYNC) |
637 | |
763 | |
… | |
… | |
661 | aio_req_stash = gv_stashpv ("IO::AIO::REQ", 1); |
787 | aio_req_stash = gv_stashpv ("IO::AIO::REQ", 1); |
662 | aio_grp_stash = gv_stashpv ("IO::AIO::GRP", 1); |
788 | aio_grp_stash = gv_stashpv ("IO::AIO::GRP", 1); |
663 | |
789 | |
664 | for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ-- > const_iv; ) |
790 | for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ-- > const_iv; ) |
665 | newCONSTSUB (aio_stash, (char *)civ->name, newSViv (civ->iv)); |
791 | newCONSTSUB (aio_stash, (char *)civ->name, newSViv (civ->iv)); |
|
|
792 | |
|
|
793 | newCONSTSUB (aio_stash, "PAGESIZE", newSViv (PAGESIZE)); |
666 | |
794 | |
667 | create_respipe (); |
795 | create_respipe (); |
668 | |
796 | |
669 | if (eio_init (want_poll, done_poll) < 0) |
797 | if (eio_init (want_poll, done_poll) < 0) |
670 | croak ("IO::AIO: unable to initialise eio library"); |
798 | croak ("IO::AIO: unable to initialise eio library"); |
… | |
… | |
1260 | PROTOTYPE: $$$$ |
1388 | PROTOTYPE: $$$$ |
1261 | CODE: |
1389 | CODE: |
1262 | #if _XOPEN_SOURCE >= 600 && !NO_FADVISE |
1390 | #if _XOPEN_SOURCE >= 600 && !NO_FADVISE |
1263 | RETVAL = posix_fadvise (fh, offset, length, advice); |
1391 | RETVAL = posix_fadvise (fh, offset, length, advice); |
1264 | #else |
1392 | #else |
1265 | RETVAL = errno = ENOSYS; |
1393 | RETVAL = errno = ENOSYS; /* yes, this is actually correct */ |
1266 | #endif |
1394 | #endif |
1267 | OUTPUT: |
1395 | OUTPUT: |
1268 | RETVAL |
1396 | RETVAL |
1269 | |
1397 | |
1270 | ssize_t |
1398 | ssize_t |
1271 | sendfile (aio_wfd ofh, aio_rfd ifh, off_t offset, size_t count) |
1399 | sendfile (aio_wfd ofh, aio_rfd ifh, off_t offset, size_t count) |
1272 | PROTOTYPE: $$$$ |
1400 | PROTOTYPE: $$$$ |
1273 | CODE: |
1401 | CODE: |
1274 | RETVAL = eio_sendfile_sync (ofh, ifh, offset, count); |
1402 | RETVAL = eio_sendfile_sync (ofh, ifh, offset, count); |
|
|
1403 | OUTPUT: |
|
|
1404 | RETVAL |
|
|
1405 | |
|
|
1406 | void |
|
|
1407 | mmap (SV *scalar, size_t length, int prot, int flags, SV *fh, off_t offset = 0) |
|
|
1408 | PROTOTYPE: $$$$$;$ |
|
|
1409 | PPCODE: |
|
|
1410 | sv_unmagic (scalar, MMAP_MAGIC); |
|
|
1411 | { |
|
|
1412 | int fd = SvOK (fh) ? s_fileno_croak (fh, flags & PROT_WRITE) : -1; |
|
|
1413 | void *addr = (void *)mmap (0, length, prot, flags, fd, offset); |
|
|
1414 | if (addr == (void *)-1) |
|
|
1415 | XSRETURN_NO; |
|
|
1416 | |
|
|
1417 | sv_force_normal (scalar); |
|
|
1418 | |
|
|
1419 | /* we store the length in mg_obj, as namlen is I32 :/ */ |
|
|
1420 | sv_magicext (scalar, 0, MMAP_MAGIC, &mmap_vtbl, (char *)addr, 0) |
|
|
1421 | ->mg_obj = (SV *)length; |
|
|
1422 | |
|
|
1423 | SvUPGRADE (scalar, SVt_PV); /* nop... */ |
|
|
1424 | |
|
|
1425 | if (!(prot & PROT_WRITE)) |
|
|
1426 | SvREADONLY_on (scalar); |
|
|
1427 | |
|
|
1428 | if (SvLEN (scalar)) |
|
|
1429 | Safefree (SvPVX (scalar)); |
|
|
1430 | |
|
|
1431 | SvPVX (scalar) = (char *)addr; |
|
|
1432 | SvCUR_set (scalar, length); |
|
|
1433 | SvLEN_set (scalar, 0); |
|
|
1434 | SvPOK_only (scalar); |
|
|
1435 | |
|
|
1436 | XSRETURN_YES; |
|
|
1437 | } |
|
|
1438 | |
|
|
1439 | void |
|
|
1440 | munmap (SV *scalar) |
|
|
1441 | PROTOTYPE: $ |
|
|
1442 | CODE: |
|
|
1443 | sv_unmagic (scalar, MMAP_MAGIC); |
|
|
1444 | |
|
|
1445 | int |
|
|
1446 | madvise (SV *scalar, off_t offset, off_t length, IV advice) |
|
|
1447 | PROTOTYPE: $$$$ |
|
|
1448 | CODE: |
|
|
1449 | { |
|
|
1450 | char *addr = SvPV_nolen (scalar) + offset; |
|
|
1451 | |
|
|
1452 | if (!SvOK (ST (2))) |
|
|
1453 | length = SvCUR (scalar) - offset; |
|
|
1454 | |
|
|
1455 | if (addr >= SvEND (scalar) || length <= 0) |
|
|
1456 | XSRETURN_EMPTY; |
|
|
1457 | |
|
|
1458 | #if _XOPEN_SOURCE >= 600 && !NO_MADVISE |
|
|
1459 | RETVAL = posix_madvise (addr, length, advice); |
|
|
1460 | #else |
|
|
1461 | RETVAL = errno = ENOSYS; /* yes, this is actually correct */ |
|
|
1462 | #endif |
|
|
1463 | } |
1275 | OUTPUT: |
1464 | OUTPUT: |
1276 | RETVAL |
1465 | RETVAL |
1277 | |
1466 | |
1278 | int |
1467 | int |
1279 | mlockall (int flags) |
1468 | mlockall (int flags) |
… | |
… | |
1284 | extern int mallopt (int, int); |
1473 | extern int mallopt (int, int); |
1285 | mallopt (-6, 238); /* http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=473812 */ |
1474 | mallopt (-6, 238); /* http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=473812 */ |
1286 | #endif |
1475 | #endif |
1287 | mlockall (flags); |
1476 | mlockall (flags); |
1288 | #else |
1477 | #else |
1289 | RETVAL =-1; |
1478 | RETVAL = -1; |
1290 | errno = ENOSYS; |
1479 | errno = ENOSYS; |
1291 | #endif |
1480 | #endif |
1292 | OUTPUT: |
1481 | OUTPUT: |
1293 | RETVAL |
1482 | RETVAL |
1294 | |
1483 | |
… | |
… | |
1297 | PROTOTYPE: |
1486 | PROTOTYPE: |
1298 | CODE: |
1487 | CODE: |
1299 | #if _POSIX_MEMLOCK |
1488 | #if _POSIX_MEMLOCK |
1300 | munlockall (); |
1489 | munlockall (); |
1301 | #else |
1490 | #else |
1302 | RETVAL =-1; |
1491 | RETVAL = -1; |
1303 | errno = ENOSYS; |
1492 | errno = ENOSYS; |
1304 | #endif |
1493 | #endif |
1305 | OUTPUT: |
1494 | OUTPUT: |
1306 | RETVAL |
1495 | RETVAL |
1307 | |
1496 | |