1 | #include "eio.h" |
1 | #include "eio.h" |
2 | #include "xthread.h" |
2 | #include "xthread.h" |
3 | |
3 | |
4 | #include <errno.h> |
4 | #include <errno.h> |
5 | |
|
|
6 | #include "EXTERN.h" |
|
|
7 | #include "perl.h" |
|
|
8 | #include "XSUB.h" |
|
|
9 | |
|
|
10 | #include <stddef.h> |
5 | #include <stddef.h> |
11 | #include <stdlib.h> |
6 | #include <stdlib.h> |
|
|
7 | #include <string.h> |
12 | #include <errno.h> |
8 | #include <errno.h> |
13 | #include <sys/types.h> |
9 | #include <sys/types.h> |
14 | #include <sys/stat.h> |
10 | #include <sys/stat.h> |
15 | #include <limits.h> |
11 | #include <limits.h> |
16 | #include <fcntl.h> |
12 | #include <fcntl.h> |
17 | #include <sched.h> |
13 | #include <assert.h> |
18 | |
14 | |
19 | #ifndef EIO_FINISH |
15 | #ifndef EIO_FINISH |
20 | # define EIO_FINISH(req) ((req)->finish) && !EIO_CANCELLED (req) ? (req)->finish (req) : 0 |
16 | # define EIO_FINISH(req) ((req)->finish) && !EIO_CANCELLED (req) ? (req)->finish (req) : 0 |
21 | #endif |
17 | #endif |
22 | |
18 | |
… | |
… | |
38 | # include <sys/time.h> |
34 | # include <sys/time.h> |
39 | # include <sys/select.h> |
35 | # include <sys/select.h> |
40 | # include <unistd.h> |
36 | # include <unistd.h> |
41 | # include <utime.h> |
37 | # include <utime.h> |
42 | # include <signal.h> |
38 | # include <signal.h> |
|
|
39 | # include <dirent.h> |
43 | |
40 | |
44 | # ifndef EIO_STRUCT_DIRENT |
41 | # ifndef EIO_STRUCT_DIRENT |
45 | # define EIO_STRUCT_DIRENT struct dirent |
42 | # define EIO_STRUCT_DIRENT struct dirent |
46 | # endif |
43 | # endif |
47 | |
44 | |
… | |
… | |
274 | return 0; |
271 | return 0; |
275 | } |
272 | } |
276 | |
273 | |
277 | void eio_destroy (eio_req *req) |
274 | void eio_destroy (eio_req *req) |
278 | { |
275 | { |
|
|
276 | if ((req)->flags & EIO_FLAG_PTR1_FREE) free (req->ptr1); |
279 | if ((req)->flags & EIO_FLAG_PTR2_FREE) |
277 | if ((req)->flags & EIO_FLAG_PTR2_FREE) free (req->ptr2); |
280 | free (req->ptr2); |
|
|
281 | |
278 | |
282 | EIO_DESTROY (req); |
279 | EIO_DESTROY (req); |
283 | } |
280 | } |
284 | |
281 | |
285 | static int eio_finish (eio_req *req) |
282 | static int eio_finish (eio_req *req) |
… | |
… | |
315 | eio_cancel (grp); |
312 | eio_cancel (grp); |
316 | } |
313 | } |
317 | |
314 | |
318 | void eio_cancel (eio_req *req) |
315 | void eio_cancel (eio_req *req) |
319 | { |
316 | { |
|
|
317 | X_LOCK (wrklock); |
320 | req->flags |= EIO_FLAG_CANCELLED; |
318 | req->flags |= EIO_FLAG_CANCELLED; |
|
|
319 | X_UNLOCK (wrklock); |
321 | |
320 | |
322 | eio_grp_cancel (req); |
321 | eio_grp_cancel (req); |
323 | } |
322 | } |
324 | |
323 | |
325 | X_THREAD_PROC (eio_proc); |
324 | X_THREAD_PROC (eio_proc); |
326 | |
325 | |
327 | static void start_thread (void) |
326 | static void start_thread (void) |
328 | { |
327 | { |
329 | worker *wrk = calloc (1, sizeof (worker)); |
328 | worker *wrk = calloc (1, sizeof (worker)); |
330 | |
329 | |
331 | if (!wrk) |
330 | /*TODO*/ |
332 | croak ("unable to allocate worker thread data"); |
331 | assert (("unable to allocate worker thread data", !wrk)); |
333 | |
332 | |
334 | X_LOCK (wrklock); |
333 | X_LOCK (wrklock); |
335 | |
334 | |
336 | if (thread_create (&wrk->tid, eio_proc, (void *)wrk)) |
335 | if (thread_create (&wrk->tid, eio_proc, (void *)wrk)) |
337 | { |
336 | { |
… | |
… | |
571 | |
570 | |
572 | while (todo > 0) |
571 | while (todo > 0) |
573 | { |
572 | { |
574 | size_t len = todo < EIO_BUFSIZE ? todo : EIO_BUFSIZE; |
573 | size_t len = todo < EIO_BUFSIZE ? todo : EIO_BUFSIZE; |
575 | |
574 | |
576 | pread (fd, aio_buf, len, offset); |
575 | pread (fd, eio_buf, len, offset); |
577 | offset += len; |
576 | offset += len; |
578 | todo -= len; |
577 | todo -= len; |
579 | } |
578 | } |
580 | |
579 | |
581 | errno = 0; |
580 | errno = 0; |
… | |
… | |
587 | #if !HAVE_READDIR_R |
586 | #if !HAVE_READDIR_R |
588 | # define readdir_r aio_readdir_r |
587 | # define readdir_r aio_readdir_r |
589 | |
588 | |
590 | static mutex_t readdirlock = X_MUTEX_INIT; |
589 | static mutex_t readdirlock = X_MUTEX_INIT; |
591 | |
590 | |
592 | static int readdir_r (DIR *dirp, X_DIRENT *ent, X_DIRENT **res) |
591 | static int readdir_r (DIR *dirp, EIO_STRUCT_DIRENT *ent, EIO_STRUCT_DIRENT **res) |
593 | { |
592 | { |
594 | X_DIRENT *e; |
593 | EIO_STRUCT_DIRENT *e; |
595 | int errorno; |
594 | int errorno; |
596 | |
595 | |
597 | X_LOCK (readdirlock); |
596 | X_LOCK (readdirlock); |
598 | |
597 | |
599 | e = readdir (dirp); |
598 | e = readdir (dirp); |
… | |
… | |
768 | req->result = res; |
767 | req->result = res; |
769 | } |
768 | } |
770 | |
769 | |
771 | /*****************************************************************************/ |
770 | /*****************************************************************************/ |
772 | |
771 | |
|
|
772 | #define ALLOC(len) \ |
|
|
773 | if (!req->ptr2) \ |
|
|
774 | { \ |
|
|
775 | X_LOCK (wrklock); \ |
|
|
776 | req->flags |= EIO_FLAG_PTR2_FREE; \ |
|
|
777 | X_UNLOCK (wrklock); \ |
|
|
778 | req->ptr2 = malloc (len); \ |
|
|
779 | if (!req->ptr2) \ |
|
|
780 | { \ |
|
|
781 | errno = ENOMEM; \ |
|
|
782 | req->result = -1; \ |
|
|
783 | break; \ |
|
|
784 | } \ |
|
|
785 | } |
|
|
786 | |
773 | X_THREAD_PROC (eio_proc) |
787 | X_THREAD_PROC (eio_proc) |
774 | { |
788 | { |
775 | eio_req *req; |
789 | eio_req *req; |
776 | struct timespec ts; |
790 | struct timespec ts; |
777 | worker *self = (worker *)thr_arg; |
791 | worker *self = (worker *)thr_arg; |
… | |
… | |
821 | errno = 0; /* strictly unnecessary */ |
835 | errno = 0; /* strictly unnecessary */ |
822 | |
836 | |
823 | if (!EIO_CANCELLED (req)) |
837 | if (!EIO_CANCELLED (req)) |
824 | switch (req->type) |
838 | switch (req->type) |
825 | { |
839 | { |
|
|
840 | case EIO_READ: ALLOC (req->size); |
826 | case EIO_READ: req->result = req->offs >= 0 |
841 | req->result = req->offs >= 0 |
827 | ? pread (req->int1, req->ptr2, req->size, req->offs) |
842 | ? pread (req->int1, req->ptr2, req->size, req->offs) |
828 | : read (req->int1, req->ptr2, req->size); break; |
843 | : read (req->int1, req->ptr2, req->size); break; |
829 | case EIO_WRITE: req->result = req->offs >= 0 |
844 | case EIO_WRITE: req->result = req->offs >= 0 |
830 | ? pwrite (req->int1, req->ptr2, req->size, req->offs) |
845 | ? pwrite (req->int1, req->ptr2, req->size, req->offs) |
831 | : write (req->int1, req->ptr2, req->size); break; |
846 | : write (req->int1, req->ptr2, req->size); break; |
832 | |
847 | |
833 | case EIO_READAHEAD: req->result = readahead (req->int1, req->offs, req->size); break; |
848 | case EIO_READAHEAD: req->result = readahead (req->int1, req->offs, req->size); break; |
834 | case EIO_SENDFILE: req->result = sendfile_ (req->int1, req->int2, req->offs, req->size, self); break; |
849 | case EIO_SENDFILE: req->result = sendfile_ (req->int1, req->int2, req->offs, req->size, self); break; |
835 | |
850 | |
|
|
851 | case EIO_STAT: ALLOC (sizeof (EIO_STRUCT_STAT)); |
836 | case EIO_STAT: req->result = stat (req->ptr1, (EIO_STRUCT_STAT *)req->ptr2); break; |
852 | req->result = stat (req->ptr1, (EIO_STRUCT_STAT *)req->ptr2); break; |
|
|
853 | case EIO_LSTAT: ALLOC (sizeof (EIO_STRUCT_STAT)); |
837 | case EIO_LSTAT: req->result = lstat (req->ptr1, (EIO_STRUCT_STAT *)req->ptr2); break; |
854 | req->result = lstat (req->ptr1, (EIO_STRUCT_STAT *)req->ptr2); break; |
|
|
855 | case EIO_FSTAT: ALLOC (sizeof (EIO_STRUCT_STAT)); |
838 | case EIO_FSTAT: req->result = fstat (req->int1, (EIO_STRUCT_STAT *)req->ptr2); break; |
856 | req->result = fstat (req->int1, (EIO_STRUCT_STAT *)req->ptr2); break; |
839 | |
857 | |
840 | case EIO_CHOWN: req->result = chown (req->ptr1, req->int2, req->int3); break; |
858 | case EIO_CHOWN: req->result = chown (req->ptr1, req->int2, req->int3); break; |
841 | case EIO_FCHOWN: req->result = fchown (req->int1, req->int2, req->int3); break; |
859 | case EIO_FCHOWN: req->result = fchown (req->int1, req->int2, req->int3); break; |
842 | case EIO_CHMOD: req->result = chmod (req->ptr1, (mode_t)req->int2); break; |
860 | case EIO_CHMOD: req->result = chmod (req->ptr1, (mode_t)req->int2); break; |
843 | case EIO_FCHMOD: req->result = fchmod (req->int1, (mode_t)req->int2); break; |
861 | case EIO_FCHMOD: req->result = fchmod (req->int1, (mode_t)req->int2); break; |
… | |
… | |
852 | case EIO_MKDIR: req->result = mkdir (req->ptr1, (mode_t)req->int2); break; |
870 | case EIO_MKDIR: req->result = mkdir (req->ptr1, (mode_t)req->int2); break; |
853 | case EIO_RENAME: req->result = rename (req->ptr1, req->ptr2); break; |
871 | case EIO_RENAME: req->result = rename (req->ptr1, req->ptr2); break; |
854 | case EIO_LINK: req->result = link (req->ptr1, req->ptr2); break; |
872 | case EIO_LINK: req->result = link (req->ptr1, req->ptr2); break; |
855 | case EIO_SYMLINK: req->result = symlink (req->ptr1, req->ptr2); break; |
873 | case EIO_SYMLINK: req->result = symlink (req->ptr1, req->ptr2); break; |
856 | case EIO_MKNOD: req->result = mknod (req->ptr1, (mode_t)req->int2, (dev_t)req->offs); break; |
874 | case EIO_MKNOD: req->result = mknod (req->ptr1, (mode_t)req->int2, (dev_t)req->offs); break; |
|
|
875 | |
|
|
876 | case EIO_READLINK: ALLOC (NAME_MAX); |
857 | case EIO_READLINK: req->result = readlink (req->ptr1, req->ptr2, NAME_MAX); break; |
877 | req->result = readlink (req->ptr1, req->ptr2, NAME_MAX); break; |
858 | |
878 | |
859 | case EIO_SYNC: req->result = 0; sync (); break; |
879 | case EIO_SYNC: req->result = 0; sync (); break; |
860 | case EIO_FSYNC: req->result = fsync (req->int1); break; |
880 | case EIO_FSYNC: req->result = fsync (req->int1); break; |
861 | case EIO_FDATASYNC: req->result = fdatasync (req->int1); break; |
881 | case EIO_FDATASYNC: req->result = fdatasync (req->int1); break; |
862 | |
882 | |
… | |
… | |
1011 | #endif |
1031 | #endif |
1012 | |
1032 | |
1013 | X_THREAD_ATFORK (eio_atfork_prepare, eio_atfork_parent, eio_atfork_child); |
1033 | X_THREAD_ATFORK (eio_atfork_prepare, eio_atfork_parent, eio_atfork_child); |
1014 | } |
1034 | } |
1015 | |
1035 | |
|
|
1036 | static void eio_api_destroy (eio_req *req) |
|
|
1037 | { |
|
|
1038 | free (req); |
|
|
1039 | } |
|
|
1040 | |
|
|
1041 | #define REQ(rtype) \ |
|
|
1042 | eio_req *req; \ |
|
|
1043 | \ |
|
|
1044 | req = (eio_req *)calloc (1, sizeof *req); \ |
|
|
1045 | if (!req) \ |
|
|
1046 | return 0; \ |
|
|
1047 | \ |
|
|
1048 | req->type = EIO_ ## rtype; \ |
|
|
1049 | req->pri = EIO_DEFAULT_PRI + EIO_PRI_BIAS; \ |
|
|
1050 | req->finish = cb; \ |
|
|
1051 | req->destroy = eio_api_destroy; |
|
|
1052 | |
|
|
1053 | #define SEND eio_submit (req); return req |
|
|
1054 | |
|
|
1055 | #define PATH (void)0 |
|
|
1056 | |
|
|
1057 | eio_req *eio_fsync (int fd, eio_cb cb) |
|
|
1058 | { |
|
|
1059 | REQ (FSYNC); req->int1 = fd; SEND; |
|
|
1060 | } |
|
|
1061 | |
|
|
1062 | eio_req *eio_fdatasync (int fd, eio_cb cb) |
|
|
1063 | { |
|
|
1064 | REQ (FDATASYNC); req->int1 = fd; SEND; |
|
|
1065 | } |
|
|
1066 | |
|
|
1067 | eio_req *eio_readahead (int fd, off_t offset, size_t length, eio_cb cb) |
|
|
1068 | { |
|
|
1069 | REQ (READAHEAD); req->int1 = fd; req->offs = offset; req->size = length; SEND; |
|
|
1070 | } |
|
|
1071 | |
|
|
1072 | eio_req *eio_read (int fd, off_t offset, size_t length, void *data, eio_cb cb) |
|
|
1073 | { |
|
|
1074 | REQ (READ); req->int1 = fd; req->offs = offset; req->size = length; req->ptr2 = data; SEND; |
|
|
1075 | } |
|
|
1076 | |
|
|
1077 | eio_req *eio_write (int fd, off_t offset, size_t length, void *data, eio_cb cb) |
|
|
1078 | { |
|
|
1079 | REQ (WRITE); req->int1 = fd; req->offs = offset; req->size = length; req->ptr2 = data; SEND; |
|
|
1080 | } |
|
|
1081 | |
|
|
1082 | eio_req *eio_fstat (int fd, eio_cb cb) |
|
|
1083 | { |
|
|
1084 | REQ (FSTAT); req->int1 = fd; SEND; |
|
|
1085 | } |
|
|
1086 | |
|
|
1087 | eio_req *eio_futime (int fd, double atime, double mtime, eio_cb cb) |
|
|
1088 | { |
|
|
1089 | REQ (FUTIME); req->int1 = fd; req->nv1 = atime; req->nv2 = mtime; SEND; |
|
|
1090 | } |
|
|
1091 | |
|
|
1092 | eio_req *eio_ftruncate (int fd, off_t offset, eio_cb cb) |
|
|
1093 | { |
|
|
1094 | REQ (FTRUNCATE); req->int1 = fd; req->offs = offset; SEND; |
|
|
1095 | } |
|
|
1096 | |
|
|
1097 | eio_req *eio_fchmod (int fd, mode_t mode, eio_cb cb) |
|
|
1098 | { |
|
|
1099 | REQ (FCHMOD); req->int1 = fd; req->int2 = (long)mode; SEND; |
|
|
1100 | } |
|
|
1101 | |
|
|
1102 | eio_req *eio_fchown (int fd, uid_t uid, gid_t gid, eio_cb cb) |
|
|
1103 | { |
|
|
1104 | REQ (FCHOWN); req->int1 = fd; req->int2 = (long)uid; req->int3 = (long)gid; SEND; |
|
|
1105 | } |
|
|
1106 | |
|
|
1107 | eio_req *eio_dup2 (int fd, int fd2, eio_cb cb) |
|
|
1108 | { |
|
|
1109 | REQ (DUP2); req->int1 = fd; req->int2 = fd2; SEND; |
|
|
1110 | } |
|
|
1111 | |
|
|
1112 | eio_req *eio_sendfile (int out_fd, int in_fd, off_t in_offset, size_t length, eio_cb cb) |
|
|
1113 | { |
|
|
1114 | REQ (SENDFILE); req->int1 = out_fd; req->int2 = in_fd; req->offs = in_offset; req->size = length; SEND; |
|
|
1115 | } |
|
|
1116 | |
|
|
1117 | eio_req *eio_open (const char *path, int flags, mode_t mode, eio_cb cb) |
|
|
1118 | { |
|
|
1119 | REQ (OPEN); PATH; req->int1 = flags; req->int2 = (long)mode; SEND; |
|
|
1120 | } |
|
|
1121 | |
|
|
1122 | eio_req *eio_readlink (const char *path, eio_cb cb) |
|
|
1123 | { |
|
|
1124 | REQ (READLINK); PATH; SEND; |
|
|
1125 | } |
|
|
1126 | |
|
|
1127 | eio_req *eio_stat (const char *path, eio_cb cb) |
|
|
1128 | { |
|
|
1129 | REQ (STAT); PATH; SEND; |
|
|
1130 | } |
|
|
1131 | |
|
|
1132 | eio_req *eio_lstat (const char *path, eio_cb cb) |
|
|
1133 | { |
|
|
1134 | REQ (LSTAT); PATH; SEND; |
|
|
1135 | } |
|
|
1136 | |
|
|
1137 | eio_req *eio_utime (const char *path, double atime, double mtime, eio_cb cb) |
|
|
1138 | { |
|
|
1139 | REQ (UTIME); PATH; req->nv1 = atime; req->nv2 = mtime; SEND; |
|
|
1140 | } |
|
|
1141 | |
|
|
1142 | eio_req *eio_truncate (const char *path, off_t offset, eio_cb cb) |
|
|
1143 | { |
|
|
1144 | REQ (TRUNCATE); PATH; req->offs = offset; SEND; |
|
|
1145 | } |
|
|
1146 | |
|
|
1147 | eio_req *eio_chown (const char *path, uid_t uid, gid_t gid, eio_cb cb) |
|
|
1148 | { |
|
|
1149 | REQ (CHOWN); PATH; req->int2 = (long)uid; req->int3 = (long)gid; SEND; |
|
|
1150 | } |
|
|
1151 | |
|
|
1152 | eio_req *eio_chmod (const char *path, mode_t mode, eio_cb cb) |
|
|
1153 | { |
|
|
1154 | REQ (CHMOD); PATH; req->int2 = (long)mode; SEND; |
|
|
1155 | } |
|
|
1156 | |
|
|
1157 | eio_req *eio_mkdir (const char *path, mode_t mode, eio_cb cb) |
|
|
1158 | { |
|
|
1159 | REQ (MKDIR); PATH; req->int2 = (long)mode; SEND; |
|
|
1160 | } |
|
|
1161 | |
|
|
1162 | eio_req *eio_unlink (const char *path, eio_cb cb) |
|
|
1163 | { |
|
|
1164 | REQ (UNLINK); PATH; SEND; |
|
|
1165 | } |
|
|
1166 | |
|
|
1167 | eio_req *eio_rmdir (const char *path, eio_cb cb) |
|
|
1168 | { |
|
|
1169 | REQ (RMDIR); PATH; SEND; |
|
|
1170 | } |
|
|
1171 | |
|
|
1172 | eio_req *eio_readdir (const char *path, eio_cb cb) |
|
|
1173 | { |
|
|
1174 | REQ (READDIR); PATH; SEND; |
|
|
1175 | } |
|
|
1176 | |
|
|
1177 | eio_req *eio_mknod (const char *path, mode_t mode, dev_t dev, eio_cb cb) |
|
|
1178 | { |
|
|
1179 | REQ (MKNOD); PATH; req->int2 = (long)mode; req->int2 = (long)dev; SEND; |
|
|
1180 | } |
|
|
1181 | |
|
|
1182 | eio_req *eio_busy (double delay, eio_cb cb) |
|
|
1183 | { |
|
|
1184 | REQ (BUSY); req->nv1 = delay; SEND; |
|
|
1185 | } |
|
|
1186 | |
|
|
1187 | eio_req *eio_nop (eio_cb cb) |
|
|
1188 | { |
|
|
1189 | REQ (NOP); SEND; |
|
|
1190 | } |
|
|
1191 | |
|
|
1192 | #undef REQ |
|
|
1193 | #undef PATH |
|
|
1194 | #undef SEND |
|
|
1195 | |
1016 | #if 0 |
1196 | #if 0 |
1017 | |
1197 | |
1018 | eio_req *eio_fsync (int fd, eio_cb cb); |
|
|
1019 | eio_req *eio_fdatasync (int fd, eio_cb cb); |
|
|
1020 | eio_req *eio_dupclose (int fd, eio_cb cb); |
|
|
1021 | eio_req *eio_readahead (int fd, off_t offset, size_t length, eio_cb cb); |
|
|
1022 | eio_req *eio_read (int fd, off_t offs, size_t length, char *data, eio_cb cb); |
|
|
1023 | eio_req *eio_write (int fd, off_t offs, size_t length, char *data, eio_cb cb); |
|
|
1024 | eio_req *eio_fstat (int fd, eio_cb cb); /* stat buffer=ptr2 allocates dynamically */ |
|
|
1025 | eio_req *eio_futime (int fd, double atime, double mtime, eio_cb cb); |
|
|
1026 | eio_req *eio_ftruncate (int fd, off_t offset, eio_cb cb); |
|
|
1027 | eio_req *eio_fchmod (int fd, mode_t mode, eio_cb cb); |
|
|
1028 | eio_req *eio_fchown (int fd, uid_t uid, gid_t gid, eio_cb cb); |
|
|
1029 | eio_req *eio_dup2 (int fd, int fd2, eio_cb cb); |
|
|
1030 | eio_req *eio_sendfile (int out_fd, int in_fd, off_t in_offset, size_t length, eio_cb cb); |
|
|
1031 | eio_req *eio_open (const char *path, int flags, mode_t mode, eio_cb cb); |
|
|
1032 | eio_req *eio_readlink (const char *path, eio_cb cb); /* result=ptr2 allocated dynamically */ |
|
|
1033 | eio_req *eio_stat (const char *path, eio_cb cb); /* stat buffer=ptr2 allocates dynamically */ |
|
|
1034 | eio_req *eio_lstat (const char *path, eio_cb cb); /* stat buffer=ptr2 allocates dynamically */ |
|
|
1035 | eio_req *eio_utime (const char *path, double atime, double mtime, eio_cb cb); |
|
|
1036 | eio_req *eio_truncate (const char *path, off_t offset, eio_cb cb); |
|
|
1037 | eio_req *eio_chmod (const char *path, mode_t mode, eio_cb cb); |
|
|
1038 | eio_req *eio_mkdir (const char *path, mode_t mode, eio_cb cb); |
|
|
1039 | eio_req *eio_chown (const char *path, uid_t uid, gid_t gid, eio_cb cb); |
|
|
1040 | eio_req *eio_unlink (const char *path, eio_cb cb); |
|
|
1041 | eio_req *eio_rmdir (const char *path, eio_cb cb); |
|
|
1042 | eio_req *eio_readdir (const char *path, eio_cb cb); /* result=ptr2 allocated dynamically */ |
|
|
1043 | eio_req *eio_mknod (const char *path, mode_t mode, dev_t dev, eio_cb cb); |
|
|
1044 | eio_req *eio_busy (double delay, eio_cb cb); /* ties a thread for this long, simulating busyness */ |
|
|
1045 | eio_req *eio_nop (eio_cb cb); /* does nothing except go through the whole process */ |
|
|
1046 | void |
1198 | void |
1047 | aio_open (SV8 *pathname, int flags, int mode, SV *callback=&PL_sv_undef) |
1199 | aio_open (SV8 *pathname, int flags, int mode, SV *callback=&PL_sv_undef) |
1048 | PROTOTYPE: $$$;$ |
1200 | PROTOTYPE: $$$;$ |
1049 | PPCODE: |
1201 | PPCODE: |
1050 | { |
1202 | { |