… | |
… | |
11 | #include <stddef.h> |
11 | #include <stddef.h> |
12 | #include <stdlib.h> |
12 | #include <stdlib.h> |
13 | #include <errno.h> |
13 | #include <errno.h> |
14 | #include <sys/types.h> |
14 | #include <sys/types.h> |
15 | #include <sys/stat.h> |
15 | #include <sys/stat.h> |
|
|
16 | #include <sys/statvfs.h> |
16 | #include <limits.h> |
17 | #include <limits.h> |
17 | #include <fcntl.h> |
18 | #include <fcntl.h> |
18 | #include <sched.h> |
19 | #include <sched.h> |
|
|
20 | |
|
|
21 | #if _POSIX_MEMLOCK |
|
|
22 | # include <sys/mman.h> |
|
|
23 | #endif |
19 | |
24 | |
20 | /* perl namespace pollution */ |
25 | /* perl namespace pollution */ |
21 | #undef VERSION |
26 | #undef VERSION |
22 | |
27 | |
23 | #ifdef _WIN32 |
28 | #ifdef _WIN32 |
… | |
… | |
99 | #define expect_false(expr) expect ((expr) != 0, 0) |
104 | #define expect_false(expr) expect ((expr) != 0, 0) |
100 | #define expect_true(expr) expect ((expr) != 0, 1) |
105 | #define expect_true(expr) expect ((expr) != 0, 1) |
101 | |
106 | |
102 | /*****************************************************************************/ |
107 | /*****************************************************************************/ |
103 | |
108 | |
104 | static HV *stash; |
|
|
105 | typedef SV SV8; /* byte-sv, used for argument-checking */ |
109 | typedef SV SV8; /* byte-sv, used for argument-checking */ |
106 | typedef int aio_rfd; /* read file desriptor */ |
110 | typedef int aio_rfd; /* read file desriptor */ |
107 | typedef int aio_wfd; /* write file descriptor */ |
111 | typedef int aio_wfd; /* write file descriptor */ |
108 | |
112 | |
109 | #define AIO_REQ_KLASS "IO::AIO::REQ" |
113 | static HV *aio_stash, *aio_req_stash, *aio_grp_stash; |
110 | #define AIO_GRP_KLASS "IO::AIO::GRP" |
|
|
111 | |
114 | |
112 | #define EIO_REQ_MEMBERS \ |
115 | #define EIO_REQ_MEMBERS \ |
113 | SV *callback; \ |
116 | SV *callback; \ |
114 | SV *sv1, *sv2; \ |
117 | SV *sv1, *sv2; \ |
115 | STRLEN stroffset; \ |
118 | STRLEN stroffset; \ |
… | |
… | |
121 | |
124 | |
122 | #ifndef POSIX_FADV_NORMAL |
125 | #ifndef POSIX_FADV_NORMAL |
123 | # define POSIX_FADV_NORMAL 0 |
126 | # define POSIX_FADV_NORMAL 0 |
124 | # define NO_FADVISE 1 |
127 | # define NO_FADVISE 1 |
125 | #endif |
128 | #endif |
126 | |
|
|
127 | #ifndef POSIX_FADV_SEQUENTIAL |
129 | #ifndef POSIX_FADV_SEQUENTIAL |
128 | # define POSIX_FADV_SEQUENTIAL 0 |
130 | # define POSIX_FADV_SEQUENTIAL 0 |
129 | #endif |
131 | #endif |
130 | |
|
|
131 | #ifndef POSIX_FADV_RANDOM |
132 | #ifndef POSIX_FADV_RANDOM |
132 | # define POSIX_FADV_RANDOM 0 |
133 | # define POSIX_FADV_RANDOM 0 |
133 | #endif |
134 | #endif |
134 | |
|
|
135 | #ifndef POSIX_FADV_NOREUSE |
135 | #ifndef POSIX_FADV_NOREUSE |
136 | # define POSIX_FADV_NOREUSE 0 |
136 | # define POSIX_FADV_NOREUSE 0 |
137 | #endif |
137 | #endif |
138 | |
|
|
139 | #ifndef POSIX_FADV_WILLNEED |
138 | #ifndef POSIX_FADV_WILLNEED |
140 | # define POSIX_FADV_WILLNEED 0 |
139 | # define POSIX_FADV_WILLNEED 0 |
141 | #endif |
140 | #endif |
142 | |
|
|
143 | #ifndef POSIX_FADV_DONTNEED |
141 | #ifndef POSIX_FADV_DONTNEED |
144 | # define POSIX_FADV_DONTNEED 0 |
142 | # define POSIX_FADV_DONTNEED 0 |
|
|
143 | #endif |
|
|
144 | |
|
|
145 | #ifndef ST_NODEV |
|
|
146 | # define ST_NODEV 0 |
|
|
147 | #endif |
|
|
148 | #ifndef ST_NOEXEC |
|
|
149 | # define ST_NOEXEC 0 |
|
|
150 | #endif |
|
|
151 | #ifndef ST_SYNCHRONOUS |
|
|
152 | # define ST_SYNCHRONOUS 0 |
|
|
153 | #endif |
|
|
154 | #ifndef ST_MANDLOCK |
|
|
155 | # define ST_MANDLOCK 0 |
|
|
156 | #endif |
|
|
157 | #ifndef ST_WRITE |
|
|
158 | # define ST_WRITE 0 |
|
|
159 | #endif |
|
|
160 | #ifndef ST_APPEND |
|
|
161 | # define ST_APPEND 0 |
|
|
162 | #endif |
|
|
163 | #ifndef ST_IMMUTABLE |
|
|
164 | # define ST_IMMUTABLE 0 |
|
|
165 | #endif |
|
|
166 | #ifndef ST_NOATIME |
|
|
167 | # define ST_NOATIME 0 |
|
|
168 | #endif |
|
|
169 | #ifndef ST_NODIRATIME |
|
|
170 | # define ST_NODIRATIME 0 |
|
|
171 | #endif |
|
|
172 | #ifndef ST_RELATIME |
|
|
173 | # define ST_RELATIME 0 |
|
|
174 | #endif |
|
|
175 | |
|
|
176 | #ifndef MCL_CURRENT |
|
|
177 | # define MCL_CURRENT 0 |
|
|
178 | #endif |
|
|
179 | #ifndef MCL_FUTURE |
|
|
180 | # define MCL_FUTURE 0 |
145 | #endif |
181 | #endif |
146 | |
182 | |
147 | static int req_invoke (eio_req *req); |
183 | static int req_invoke (eio_req *req); |
148 | #define EIO_FINISH(req) req_invoke (req) |
184 | #define EIO_FINISH(req) req_invoke (req) |
149 | static void req_destroy (eio_req *grp); |
185 | static void req_destroy (eio_req *grp); |
… | |
… | |
178 | /* read any signals sent by the worker threads */ |
214 | /* read any signals sent by the worker threads */ |
179 | s_epipe_drain (&respipe); |
215 | s_epipe_drain (&respipe); |
180 | } |
216 | } |
181 | |
217 | |
182 | /* must be called at most once */ |
218 | /* must be called at most once */ |
183 | static SV *req_sv (aio_req req, const char *klass) |
219 | static SV *req_sv (aio_req req, HV *stash) |
184 | { |
220 | { |
185 | if (!req->self) |
221 | if (!req->self) |
186 | { |
222 | { |
187 | req->self = (SV *)newHV (); |
223 | req->self = (SV *)newHV (); |
188 | sv_magic (req->self, 0, PERL_MAGIC_ext, (char *)req, 0); |
224 | sv_magic (req->self, 0, PERL_MAGIC_ext, (char *)req, 0); |
189 | } |
225 | } |
190 | |
226 | |
191 | return sv_2mortal (sv_bless (newRV_inc (req->self), gv_stashpv (klass, 1))); |
227 | return sv_2mortal (sv_bless (newRV_inc (req->self), stash)); |
192 | } |
228 | } |
193 | |
229 | |
194 | static aio_req SvAIO_REQ (SV *sv) |
230 | static aio_req SvAIO_REQ (SV *sv) |
195 | { |
231 | { |
196 | MAGIC *mg; |
232 | MAGIC *mg; |
197 | |
233 | |
198 | if (!sv_derived_from (sv, AIO_REQ_KLASS) || !SvROK (sv)) |
234 | if (!SvROK (sv) |
|
|
235 | || (SvSTASH (SvRV (sv)) != aio_grp_stash |
|
|
236 | && SvSTASH (SvRV (sv)) != aio_req_stash |
|
|
237 | && !sv_derived_from (sv, "IO::AIO::REQ"))) |
199 | croak ("object of class " AIO_REQ_KLASS " expected"); |
238 | croak ("object of class IO::AIO::REQ expected"); |
200 | |
239 | |
201 | mg = mg_find (SvRV (sv), PERL_MAGIC_ext); |
240 | mg = mg_find (SvRV (sv), PERL_MAGIC_ext); |
202 | |
241 | |
203 | return mg ? (aio_req)mg->mg_ptr : 0; |
242 | return mg ? (aio_req)mg->mg_ptr : 0; |
204 | } |
243 | } |
… | |
… | |
210 | dSP; |
249 | dSP; |
211 | |
250 | |
212 | ENTER; |
251 | ENTER; |
213 | SAVETMPS; |
252 | SAVETMPS; |
214 | PUSHMARK (SP); |
253 | PUSHMARK (SP); |
215 | XPUSHs (req_sv (grp, AIO_GRP_KLASS)); |
254 | XPUSHs (req_sv (grp, aio_grp_stash)); |
216 | PUTBACK; |
255 | PUTBACK; |
217 | call_sv (grp->sv2, G_VOID | G_EVAL | G_KEEPERR); |
256 | call_sv (grp->sv2, G_VOID | G_EVAL | G_KEEPERR); |
218 | SPAGAIN; |
257 | SPAGAIN; |
219 | FREETMPS; |
258 | FREETMPS; |
220 | LEAVE; |
259 | LEAVE; |
… | |
… | |
326 | int flags = req->int1 & (O_RDONLY | O_WRONLY | O_RDWR); |
365 | int flags = req->int1 & (O_RDONLY | O_WRONLY | O_RDWR); |
327 | char sym [64]; |
366 | char sym [64]; |
328 | int symlen; |
367 | int symlen; |
329 | |
368 | |
330 | symlen = snprintf (sym, sizeof (sym), "fd#%d", (int)req->result); |
369 | symlen = snprintf (sym, sizeof (sym), "fd#%d", (int)req->result); |
331 | gv_init (gv, stash, sym, symlen, 0); |
370 | gv_init (gv, aio_stash, sym, symlen, 0); |
332 | |
371 | |
333 | symlen = snprintf ( |
372 | symlen = snprintf ( |
334 | sym, |
373 | sym, |
335 | sizeof (sym), |
374 | sizeof (sym), |
336 | "%s&=%d", |
375 | "%s&=%d", |
… | |
… | |
342 | fh = (SV *)gv; |
381 | fh = (SV *)gv; |
343 | } |
382 | } |
344 | |
383 | |
345 | PUSHs (fh); |
384 | PUSHs (fh); |
346 | } |
385 | } |
|
|
386 | break; |
|
|
387 | |
|
|
388 | case EIO_STATVFS: |
|
|
389 | case EIO_FSTATVFS: |
|
|
390 | { |
|
|
391 | SV *rv = &PL_sv_undef; |
|
|
392 | |
|
|
393 | if (req->result >= 0) |
|
|
394 | { |
|
|
395 | EIO_STRUCT_STATVFS *f = EIO_STATVFS_BUF (req); |
|
|
396 | HV *hv = newHV (); |
|
|
397 | |
|
|
398 | rv = sv_2mortal (newRV_noinc ((SV *)hv)); |
|
|
399 | |
|
|
400 | hv_store (hv, "bsize" , sizeof ("bsize" ) - 1, newSVval64 (f->f_bsize ), 0); |
|
|
401 | hv_store (hv, "frsize" , sizeof ("frsize" ) - 1, newSVval64 (f->f_frsize ), 0); |
|
|
402 | hv_store (hv, "blocks" , sizeof ("blocks" ) - 1, newSVval64 (f->f_blocks ), 0); |
|
|
403 | hv_store (hv, "bfree" , sizeof ("bfree" ) - 1, newSVval64 (f->f_bfree ), 0); |
|
|
404 | hv_store (hv, "bavail" , sizeof ("bavail" ) - 1, newSVval64 (f->f_bavail ), 0); |
|
|
405 | hv_store (hv, "files" , sizeof ("files" ) - 1, newSVval64 (f->f_files ), 0); |
|
|
406 | hv_store (hv, "ffree" , sizeof ("ffree" ) - 1, newSVval64 (f->f_ffree ), 0); |
|
|
407 | hv_store (hv, "favail" , sizeof ("favail" ) - 1, newSVval64 (f->f_favail ), 0); |
|
|
408 | hv_store (hv, "fsid" , sizeof ("fsid" ) - 1, newSVval64 (f->f_fsid ), 0); |
|
|
409 | hv_store (hv, "flag" , sizeof ("flag" ) - 1, newSVval64 (f->f_flag ), 0); |
|
|
410 | hv_store (hv, "namemax", sizeof ("namemax") - 1, newSVval64 (f->f_namemax), 0); |
|
|
411 | } |
|
|
412 | |
|
|
413 | PUSHs (rv); |
|
|
414 | } |
|
|
415 | |
347 | break; |
416 | break; |
348 | |
417 | |
349 | case EIO_GROUP: |
418 | case EIO_GROUP: |
350 | req->int1 = 2; /* mark group as finished */ |
419 | req->int1 = 2; /* mark group as finished */ |
351 | |
420 | |
… | |
… | |
514 | PUTBACK; \ |
583 | PUTBACK; \ |
515 | req_submit (req); \ |
584 | req_submit (req); \ |
516 | SPAGAIN; \ |
585 | SPAGAIN; \ |
517 | \ |
586 | \ |
518 | if (GIMME_V != G_VOID) \ |
587 | if (GIMME_V != G_VOID) \ |
519 | XPUSHs (req_sv (req, AIO_REQ_KLASS)); |
588 | XPUSHs (req_sv (req, aio_req_stash)); |
520 | |
589 | |
521 | MODULE = IO::AIO PACKAGE = IO::AIO |
590 | MODULE = IO::AIO PACKAGE = IO::AIO |
522 | |
591 | |
523 | PROTOTYPES: ENABLE |
592 | PROTOTYPES: ENABLE |
524 | |
593 | |
… | |
… | |
544 | const_iv (FADV_RANDOM , POSIX_FADV_RANDOM) |
613 | const_iv (FADV_RANDOM , POSIX_FADV_RANDOM) |
545 | const_iv (FADV_NOREUSE , POSIX_FADV_NOREUSE) |
614 | const_iv (FADV_NOREUSE , POSIX_FADV_NOREUSE) |
546 | const_iv (FADV_WILLNEED , POSIX_FADV_WILLNEED) |
615 | const_iv (FADV_WILLNEED , POSIX_FADV_WILLNEED) |
547 | const_iv (FADV_DONTNEED , POSIX_FADV_DONTNEED) |
616 | const_iv (FADV_DONTNEED , POSIX_FADV_DONTNEED) |
548 | |
617 | |
|
|
618 | const_iv (ST_RDONLY , ST_RDONLY) |
|
|
619 | const_iv (ST_NOSUID , ST_NOSUID) |
|
|
620 | const_iv (ST_NODEV , ST_NODEV) |
|
|
621 | const_iv (ST_NOEXEC , ST_NOEXEC) |
|
|
622 | const_iv (ST_SYNCHRONOUS , ST_SYNCHRONOUS) |
|
|
623 | const_iv (ST_MANDLOCK , ST_MANDLOCK) |
|
|
624 | const_iv (ST_WRITE , ST_WRITE) |
|
|
625 | const_iv (ST_APPEND , ST_APPEND) |
|
|
626 | const_iv (ST_IMMUTABLE , ST_IMMUTABLE) |
|
|
627 | const_iv (ST_NOATIME , ST_NOATIME) |
|
|
628 | const_iv (ST_NODIRATIME , ST_NODIRATIME) |
|
|
629 | const_iv (ST_RELATIME , ST_RELATIME) |
|
|
630 | |
|
|
631 | const_iv (MCL_FUTURE , MCL_FUTURE) |
|
|
632 | const_iv (MCL_CURRENT , MCL_CURRENT) |
|
|
633 | |
|
|
634 | const_eio (MS_ASYNC) |
|
|
635 | const_eio (MS_INVALIDATE) |
|
|
636 | const_eio (MS_SYNC) |
|
|
637 | |
|
|
638 | const_eio (MT_MODIFY) |
|
|
639 | |
549 | const_eio (SYNC_FILE_RANGE_WAIT_BEFORE) |
640 | const_eio (SYNC_FILE_RANGE_WAIT_BEFORE) |
550 | const_eio (SYNC_FILE_RANGE_WRITE) |
641 | const_eio (SYNC_FILE_RANGE_WRITE) |
551 | const_eio (SYNC_FILE_RANGE_WAIT_AFTER) |
642 | const_eio (SYNC_FILE_RANGE_WAIT_AFTER) |
552 | |
643 | |
553 | const_eio (READDIR_DENTS) |
644 | const_eio (READDIR_DENTS) |
… | |
… | |
564 | const_eio (DT_LNK) |
655 | const_eio (DT_LNK) |
565 | const_eio (DT_SOCK) |
656 | const_eio (DT_SOCK) |
566 | const_eio (DT_WHT) |
657 | const_eio (DT_WHT) |
567 | }; |
658 | }; |
568 | |
659 | |
569 | stash = gv_stashpv ("IO::AIO", 1); |
660 | aio_stash = gv_stashpv ("IO::AIO" , 1); |
|
|
661 | aio_req_stash = gv_stashpv ("IO::AIO::REQ", 1); |
|
|
662 | aio_grp_stash = gv_stashpv ("IO::AIO::GRP", 1); |
570 | |
663 | |
571 | for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ-- > const_iv; ) |
664 | for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ-- > const_iv; ) |
572 | newCONSTSUB (stash, (char *)civ->name, newSViv (civ->iv)); |
665 | newCONSTSUB (aio_stash, (char *)civ->name, newSViv (civ->iv)); |
573 | |
666 | |
574 | create_respipe (); |
667 | create_respipe (); |
575 | |
668 | |
576 | if (eio_init (want_poll, done_poll) < 0) |
669 | if (eio_init (want_poll, done_poll) < 0) |
577 | croak ("IO::AIO: unable to initialise eio library"); |
670 | croak ("IO::AIO: unable to initialise eio library"); |
… | |
… | |
804 | } |
897 | } |
805 | |
898 | |
806 | void |
899 | void |
807 | aio_stat (SV8 *fh_or_path, SV *callback=&PL_sv_undef) |
900 | aio_stat (SV8 *fh_or_path, SV *callback=&PL_sv_undef) |
808 | ALIAS: |
901 | ALIAS: |
809 | aio_stat = EIO_STAT |
902 | aio_stat = EIO_STAT |
810 | aio_lstat = EIO_LSTAT |
903 | aio_lstat = EIO_LSTAT |
|
|
904 | aio_statvfs = EIO_STATVFS |
811 | PPCODE: |
905 | PPCODE: |
812 | { |
906 | { |
813 | dREQ; |
907 | dREQ; |
814 | |
908 | |
815 | req->sv1 = newSVsv (fh_or_path); |
909 | req->sv1 = newSVsv (fh_or_path); |
… | |
… | |
819 | req->type = ix; |
913 | req->type = ix; |
820 | req->ptr1 = SvPVbyte_nolen (req->sv1); |
914 | req->ptr1 = SvPVbyte_nolen (req->sv1); |
821 | } |
915 | } |
822 | else |
916 | else |
823 | { |
917 | { |
824 | req->type = EIO_FSTAT; |
918 | req->type = ix == EIO_STATVFS ? EIO_FSTATVFS : EIO_FSTAT; |
825 | req->int1 = PerlIO_fileno (IoIFP (sv_2io (fh_or_path))); |
919 | req->int1 = PerlIO_fileno (IoIFP (sv_2io (fh_or_path))); |
826 | } |
920 | } |
827 | |
921 | |
828 | REQ_SEND; |
922 | REQ_SEND; |
829 | } |
923 | } |
… | |
… | |
992 | |
1086 | |
993 | REQ_SEND; |
1087 | REQ_SEND; |
994 | } |
1088 | } |
995 | |
1089 | |
996 | void |
1090 | void |
|
|
1091 | aio_mtouch (SV8 *data, IV offset = 0, SV *length = &PL_sv_undef, int flags = 0, SV *callback=&PL_sv_undef) |
|
|
1092 | ALIAS: |
|
|
1093 | aio_mtouch = EIO_MTOUCH |
|
|
1094 | aio_msync = EIO_MSYNC |
|
|
1095 | PROTOTYPE: $$$$;$ |
|
|
1096 | PPCODE: |
|
|
1097 | { |
|
|
1098 | STRLEN svlen; |
|
|
1099 | UV len = SvUV (length); |
|
|
1100 | char *svptr = SvPVbyte (data, svlen); |
|
|
1101 | |
|
|
1102 | if (offset < 0) |
|
|
1103 | offset += svlen; |
|
|
1104 | |
|
|
1105 | if (offset < 0 || offset > svlen) |
|
|
1106 | croak ("offset outside of scalar"); |
|
|
1107 | |
|
|
1108 | if (!SvOK (length) || len + offset > svlen) |
|
|
1109 | len = svlen - offset; |
|
|
1110 | |
|
|
1111 | { |
|
|
1112 | dREQ; |
|
|
1113 | |
|
|
1114 | req->type = ix; |
|
|
1115 | req->size = len; |
|
|
1116 | req->sv2 = SvREFCNT_inc (data); |
|
|
1117 | req->ptr2 = (char *)svptr + offset; |
|
|
1118 | req->int1 = flags; |
|
|
1119 | |
|
|
1120 | REQ_SEND; |
|
|
1121 | } |
|
|
1122 | } |
|
|
1123 | |
|
|
1124 | void |
997 | aio_busy (double delay, SV *callback=&PL_sv_undef) |
1125 | aio_busy (double delay, SV *callback=&PL_sv_undef) |
998 | PPCODE: |
1126 | PPCODE: |
999 | { |
1127 | { |
1000 | dREQ; |
1128 | dREQ; |
1001 | |
1129 | |
… | |
… | |
1013 | dREQ; |
1141 | dREQ; |
1014 | |
1142 | |
1015 | req->type = EIO_GROUP; |
1143 | req->type = EIO_GROUP; |
1016 | |
1144 | |
1017 | req_submit (req); |
1145 | req_submit (req); |
1018 | XPUSHs (req_sv (req, AIO_GRP_KLASS)); |
1146 | XPUSHs (req_sv (req, aio_grp_stash)); |
1019 | } |
1147 | } |
1020 | |
1148 | |
1021 | void |
1149 | void |
1022 | aio_nop (SV *callback=&PL_sv_undef) |
1150 | aio_nop (SV *callback=&PL_sv_undef) |
1023 | ALIAS: |
1151 | ALIAS: |
… | |
… | |
1141 | |
1269 | |
1142 | ssize_t |
1270 | ssize_t |
1143 | sendfile (aio_wfd ofh, aio_rfd ifh, off_t offset, size_t count) |
1271 | sendfile (aio_wfd ofh, aio_rfd ifh, off_t offset, size_t count) |
1144 | PROTOTYPE: $$$$ |
1272 | PROTOTYPE: $$$$ |
1145 | CODE: |
1273 | CODE: |
1146 | eio_sendfile_sync (ofh, ifh, offset, count); |
1274 | RETVAL = eio_sendfile_sync (ofh, ifh, offset, count); |
|
|
1275 | OUTPUT: |
|
|
1276 | RETVAL |
|
|
1277 | |
|
|
1278 | int |
|
|
1279 | mlockall (int flags) |
|
|
1280 | PROTOTYPE: $ |
|
|
1281 | CODE: |
|
|
1282 | #if _POSIX_MEMLOCK |
|
|
1283 | #if __GLIBC__ == 2 && __GLIBC_MINOR__ <= 7 |
|
|
1284 | extern int mallopt (int, int); |
|
|
1285 | mallopt (-6, 238); /* http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=473812 */ |
|
|
1286 | #endif |
|
|
1287 | mlockall (flags); |
|
|
1288 | #else |
|
|
1289 | RETVAL =-1; |
|
|
1290 | errno = ENOSYS; |
|
|
1291 | #endif |
|
|
1292 | OUTPUT: |
|
|
1293 | RETVAL |
|
|
1294 | |
|
|
1295 | int |
|
|
1296 | munlockall () |
|
|
1297 | PROTOTYPE: |
|
|
1298 | CODE: |
|
|
1299 | #if _POSIX_MEMLOCK |
|
|
1300 | munlockall (); |
|
|
1301 | #else |
|
|
1302 | RETVAL =-1; |
|
|
1303 | errno = ENOSYS; |
|
|
1304 | #endif |
|
|
1305 | OUTPUT: |
|
|
1306 | RETVAL |
1147 | |
1307 | |
1148 | void _on_next_submit (SV *cb) |
1308 | void _on_next_submit (SV *cb) |
1149 | CODE: |
1309 | CODE: |
1150 | SvREFCNT_dec (on_next_submit); |
1310 | SvREFCNT_dec (on_next_submit); |
1151 | on_next_submit = SvOK (cb) ? newSVsv (cb) : 0; |
1311 | on_next_submit = SvOK (cb) ? newSVsv (cb) : 0; |