… | |
… | |
254 | sv_type [ent->type] = newSViv (ent->type); |
254 | sv_type [ent->type] = newSViv (ent->type); |
255 | SvREADONLY_on (sv_type [ent->type]); |
255 | SvREADONLY_on (sv_type [ent->type]); |
256 | } |
256 | } |
257 | |
257 | |
258 | av_store (avent, 0, namesv); |
258 | av_store (avent, 0, namesv); |
|
|
259 | av_store (avent, 1, SvREFCNT_inc (sv_type [ent->type])); |
259 | av_store (avent, 1, IVSIZE >= 8 ? newSVuv (ent->inode) : newSVnv (ent->inode)); |
260 | av_store (avent, 2, IVSIZE >= 8 ? newSVuv (ent->inode) : newSVnv (ent->inode)); |
260 | av_store (avent, 2, SvREFCNT_inc (sv_type [ent->type])); |
|
|
261 | |
261 | |
262 | av_store (av, i, newRV_noinc ((SV *)avent)); |
262 | av_store (av, i, newRV_noinc ((SV *)avent)); |
263 | } |
263 | } |
264 | else |
264 | else |
265 | av_store (av, i, namesv); |
265 | av_store (av, i, namesv); |
… | |
… | |
294 | GV *gv = (GV *)sv_newmortal (); |
294 | GV *gv = (GV *)sv_newmortal (); |
295 | int flags = req->int1 & (O_RDONLY | O_WRONLY | O_RDWR); |
295 | int flags = req->int1 & (O_RDONLY | O_WRONLY | O_RDWR); |
296 | char sym [64]; |
296 | char sym [64]; |
297 | int symlen; |
297 | int symlen; |
298 | |
298 | |
299 | symlen = snprintf (sym, sizeof (sym), "fd#%d", req->result); |
299 | symlen = snprintf (sym, sizeof (sym), "fd#%d", (int)req->result); |
300 | gv_init (gv, stash, sym, symlen, 0); |
300 | gv_init (gv, stash, sym, symlen, 0); |
301 | |
301 | |
302 | symlen = snprintf ( |
302 | symlen = snprintf ( |
303 | sym, |
303 | sym, |
304 | sizeof (sym), |
304 | sizeof (sym), |
305 | "%s&=%d", |
305 | "%s&=%d", |
306 | flags == O_RDONLY ? "<" : flags == O_WRONLY ? ">" : "+<", |
306 | flags == O_RDONLY ? "<" : flags == O_WRONLY ? ">" : "+<", |
307 | req->result |
307 | (int)req->result |
308 | ); |
308 | ); |
309 | |
309 | |
310 | if (do_open (gv, sym, symlen, 0, 0, 0, 0)) |
310 | if (do_open (gv, sym, symlen, 0, 0, 0, 0)) |
311 | fh = (SV *)gv; |
311 | fh = (SV *)gv; |
312 | } |
312 | } |
… | |
… | |
555 | |
555 | |
556 | PROTOTYPES: ENABLE |
556 | PROTOTYPES: ENABLE |
557 | |
557 | |
558 | BOOT: |
558 | BOOT: |
559 | { |
559 | { |
560 | stash = gv_stashpv ("IO::AIO", 1); |
|
|
561 | |
|
|
562 | static const struct { |
560 | static const struct { |
563 | const char *name; |
561 | const char *name; |
564 | IV iv; |
562 | IV iv; |
565 | } *civ, const_iv[] = { |
563 | } *civ, const_iv[] = { |
566 | # define const_iv(name, value) { # name, (IV) value }, |
564 | # define const_iv(name, value) { # name, (IV) value }, |
… | |
… | |
592 | const_eio (DT_LNK) |
590 | const_eio (DT_LNK) |
593 | const_eio (DT_SOCK) |
591 | const_eio (DT_SOCK) |
594 | const_eio (DT_WHT) |
592 | const_eio (DT_WHT) |
595 | }; |
593 | }; |
596 | |
594 | |
|
|
595 | stash = gv_stashpv ("IO::AIO", 1); |
|
|
596 | |
597 | for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ-- > const_iv; ) |
597 | for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ-- > const_iv; ) |
598 | newCONSTSUB (stash, (char *)civ->name, newSViv (civ->iv)); |
598 | newCONSTSUB (stash, (char *)civ->name, newSViv (civ->iv)); |
599 | |
599 | |
600 | create_respipe (); |
600 | create_respipe (); |
601 | |
601 | |
… | |
… | |
961 | req->sv1 = newSVsv (pathname); |
961 | req->sv1 = newSVsv (pathname); |
962 | req->ptr1 = SvPVbyte_nolen (req->sv1); |
962 | req->ptr1 = SvPVbyte_nolen (req->sv1); |
963 | req->int1 = flags | EIO_READDIR_DENTS | EIO_READDIR_CUSTOM1; |
963 | req->int1 = flags | EIO_READDIR_DENTS | EIO_READDIR_CUSTOM1; |
964 | |
964 | |
965 | if (flags & EIO_READDIR_DENTS) |
965 | if (flags & EIO_READDIR_DENTS) |
966 | flags |= EIO_READDIR_CUSTOM2; |
966 | req->int1 |= EIO_READDIR_CUSTOM2; |
967 | |
967 | |
968 | REQ_SEND; |
968 | REQ_SEND; |
969 | } |
969 | } |
970 | |
970 | |
971 | void |
971 | void |