ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/IO-AIO/AIO.xs
(Generate patch)

Comparing IO-AIO/AIO.xs (file contents):
Revision 1.271 by root, Fri Dec 28 12:43:00 2018 UTC vs.
Revision 1.274 by root, Sun Mar 10 12:16:48 2019 UTC

117 117
118#if _POSIX_MEMLOCK || _POSIX_MEMLOCK_RANGE || _POSIX_MAPPED_FILES 118#if _POSIX_MEMLOCK || _POSIX_MEMLOCK_RANGE || _POSIX_MAPPED_FILES
119# include <sys/mman.h> 119# include <sys/mman.h>
120#endif 120#endif
121 121
122#if HAVE_SYS_UIO_H
123# include <sys/uio.h>
124#endif
125
122#if HAVE_ST_XTIMENSEC 126#if HAVE_ST_XTIMENSEC
123# define ATIMENSEC PL_statcache.st_atimensec 127# define ATIMENSEC PL_statcache.st_atimensec
124# define MTIMENSEC PL_statcache.st_mtimensec 128# define MTIMENSEC PL_statcache.st_mtimensec
125# define CTIMENSEC PL_statcache.st_ctimensec 129# define CTIMENSEC PL_statcache.st_ctimensec
126#elif HAVE_ST_XTIMESPEC 130#elif HAVE_ST_XTIMESPEC
816#endif 820#endif
817 } 821 }
818 else 822 else
819 PUSHs (sv_result); 823 PUSHs (sv_result);
820 break; 824 break;
825
826#if 0
827 case EIO_CLOSE:
828 PerlIOUnix_refcnt_dec (req->int1);
829 break;
830#endif
821 831
822 case EIO_DUP2: /* EIO_DUP2 actually means aio_close(), so fudge result value */ 832 case EIO_DUP2: /* EIO_DUP2 actually means aio_close(), so fudge result value */
823 if (req->result > 0) 833 if (req->result > 0)
824 SvIV_set (sv_result, 0); 834 SvIV_set (sv_result, 0);
825 /* FALLTHROUGH */ 835 /* FALLTHROUGH */
1472 1482
1473void 1483void
1474aio_close (SV *fh, SV *callback = &PL_sv_undef) 1484aio_close (SV *fh, SV *callback = &PL_sv_undef)
1475 PPCODE: 1485 PPCODE:
1476{ 1486{
1487 int fd = s_fileno_croak (fh, 0);
1477 dREQ; 1488 dREQ;
1478 int fd = s_fileno_croak (fh, 0); 1489#if 0
1479
1480 /* partially duplicate logic in s_fileno */ 1490 /* partially duplicate logic in s_fileno */
1481 SvGETMAGIC (fh); 1491 SvGETMAGIC (fh);
1482 1492
1483 if (SvROK (fh)) 1493 if (SvROK (fh))
1484 { 1494 {
1492 PerlIOUnix_refcnt_inc (fd); 1502 PerlIOUnix_refcnt_inc (fd);
1493 do_close ((GV *)fh, 1); 1503 do_close ((GV *)fh, 1);
1494 1504
1495 req->type = EIO_CLOSE; 1505 req->type = EIO_CLOSE;
1496 req->int1 = fd; 1506 req->int1 = fd;
1497 req->sv2 = newSVsv (fh); 1507 /*req->sv2 = newSVsv (fh);*/ /* since we stole the fd, no need to keep the fh */
1498 } 1508 }
1499 else 1509 else
1510#endif
1500 { 1511 {
1501 /* fd number */ 1512 /* fd number */
1502 req->type = EIO_DUP2; 1513 req->type = EIO_DUP2;
1503 req->int1 = close_fd; 1514 req->int1 = close_fd;
1504 req->sv2 = newSVsv (fh); 1515 req->sv2 = newSVsv (fh);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines