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.180 by root, Fri Feb 11 00:05:17 2011 UTC vs.
Revision 1.183 by root, Tue Jul 5 09:24:11 2011 UTC

121#define EIO_NO_WRAPPERS 1 121#define EIO_NO_WRAPPERS 1
122 122
123#include "libeio/config.h" 123#include "libeio/config.h"
124#include "libeio/eio.h" 124#include "libeio/eio.h"
125 125
126/* Linux/others */
127#ifndef O_ASYNC
128# define O_ASYNC 0
129#endif
130#ifndef O_DIRECT
131# define O_DIRECT 0
132#endif
133#ifndef O_NOATIME
134# define O_NOATIME 0
135#endif
136
137/* POSIX */
138#ifndef O_CLOEXEC
139# define O_CLOEXEC 0
140#endif
141#ifndef O_NOFOLLOW
142# define O_NOFOLLOW 0
143#endif
144#ifndef O_NOCTTY
145# define O_NOCTTY 0
146#endif
147#ifndef O_NONBLOCK
148# define O_NONBLOCK 0
149#endif
150#ifndef O_EXEC
151# define O_EXEC 0
152#endif
153#ifndef O_SEARCH
154# define O_SEARCH 0
155#endif
156#ifndef O_DIRECTORY
157# define O_DIRECTORY 0
158#endif
159#ifndef O_DSYNC
160# define O_DSYNC 0
161#endif
162#ifndef O_RSYNC
163# define O_RSYNC 0
164#endif
165#ifndef O_SYNC
166# define O_SYNC 0
167#endif
168#ifndef O_TTY_INIT
169# define O_TTY_INIT 0
170#endif
171
126#ifndef POSIX_FADV_NORMAL 172#ifndef POSIX_FADV_NORMAL
127# define POSIX_FADV_NORMAL 0 173# define POSIX_FADV_NORMAL 0
128#endif 174#endif
129#ifndef POSIX_FADV_SEQUENTIAL 175#ifndef POSIX_FADV_SEQUENTIAL
130# define POSIX_FADV_SEQUENTIAL 0 176# define POSIX_FADV_SEQUENTIAL 0
539 case EIO_NOP: 585 case EIO_NOP:
540 case EIO_BUSY: 586 case EIO_BUSY:
541 break; 587 break;
542 588
543 case EIO_READLINK: 589 case EIO_READLINK:
590 case EIO_REALPATH:
544 if (req->result > 0) 591 if (req->result > 0)
545 PUSHs (sv_2mortal (newSVpvn (req->ptr2, req->result))); 592 PUSHs (sv_2mortal (newSVpvn (req->ptr2, req->result)));
546 break; 593 break;
547 594
548 case EIO_STAT: 595 case EIO_STAT:
765 const_iv (O_CREAT) 812 const_iv (O_CREAT)
766 const_iv (O_TRUNC) 813 const_iv (O_TRUNC)
767 const_iv (O_EXCL) 814 const_iv (O_EXCL)
768 const_iv (O_APPEND) 815 const_iv (O_APPEND)
769 816
817 const_iv (O_ASYNC)
818 const_iv (O_DIRECT)
819 const_iv (O_NOATIME)
820
821 const_iv (O_CLOEXEC)
822 const_iv (O_NOCTTY)
823 const_iv (O_NOFOLLOW)
824 const_iv (O_NONBLOCK)
825 const_iv (O_EXEC)
826 const_iv (O_SEARCH)
827 const_iv (O_DIRECTORY)
828 const_iv (O_DSYNC)
829 const_iv (O_RSYNC)
830 const_iv (O_SYNC)
831 const_iv (O_TTY_INIT)
832
770 const_iv (S_IFIFO) 833 const_iv (S_IFIFO)
771 const_iv (S_IFCHR) 834 const_iv (S_IFCHR)
772 const_iv (S_IFBLK) 835 const_iv (S_IFBLK)
773 const_iv (S_IFLNK) 836 const_iv (S_IFLNK)
774 const_iv (S_IFREG) 837 const_iv (S_IFREG)
866 /* atfork child called in fifo order, so before eio's handler */ 929 /* atfork child called in fifo order, so before eio's handler */
867 X_THREAD_ATFORK (0, 0, atfork_child); 930 X_THREAD_ATFORK (0, 0, atfork_child);
868} 931}
869 932
870void 933void
871max_poll_reqs (int nreqs) 934max_poll_reqs (unsigned int nreqs)
872 PROTOTYPE: $ 935 PROTOTYPE: $
873 CODE: 936 CODE:
874 eio_set_max_poll_reqs (nreqs); 937 eio_set_max_poll_reqs (nreqs);
875 938
876void 939void
878 PROTOTYPE: $ 941 PROTOTYPE: $
879 CODE: 942 CODE:
880 eio_set_max_poll_time (nseconds); 943 eio_set_max_poll_time (nseconds);
881 944
882void 945void
883min_parallel (int nthreads) 946min_parallel (unsigned int nthreads)
884 PROTOTYPE: $ 947 PROTOTYPE: $
885 CODE: 948 CODE:
886 eio_set_min_parallel (nthreads); 949 eio_set_min_parallel (nthreads);
887 950
888void 951void
889max_parallel (int nthreads) 952max_parallel (unsigned int nthreads)
890 PROTOTYPE: $ 953 PROTOTYPE: $
891 CODE: 954 CODE:
892 eio_set_max_parallel (nthreads); 955 eio_set_max_parallel (nthreads);
893 956
894void 957void
895max_idle (int nthreads) 958max_idle (unsigned int nthreads)
896 PROTOTYPE: $ 959 PROTOTYPE: $
897 CODE: 960 CODE:
898 eio_set_max_idle (nthreads); 961 eio_set_max_idle (nthreads);
899 962
900void 963void
964idle_timeout (unsigned int seconds)
965 PROTOTYPE: $
966 CODE:
967 eio_set_idle_timeout (seconds);
968
969void
901max_outstanding (int maxreqs) 970max_outstanding (unsigned int maxreqs)
902 PROTOTYPE: $ 971 PROTOTYPE: $
903 CODE: 972 CODE:
904 max_outstanding = maxreqs; 973 max_outstanding = maxreqs;
905 974
906void 975void
1033 } 1102 }
1034} 1103}
1035 1104
1036void 1105void
1037aio_readlink (SV8 *path, SV *callback=&PL_sv_undef) 1106aio_readlink (SV8 *path, SV *callback=&PL_sv_undef)
1107 ALIAS:
1108 aio_readlink = EIO_READLINK
1109 aio_realpath = EIO_REALPATH
1038 PPCODE: 1110 PPCODE:
1039{ 1111{
1040 SV *data; 1112 SV *data;
1041 dREQ; 1113 dREQ;
1042 1114
1043 req->type = EIO_READLINK; 1115 req->type = ix;
1044 req->sv1 = newSVsv (path); 1116 req->sv1 = newSVsv (path);
1045 req->ptr1 = SvPVbyte_nolen (req->sv1); 1117 req->ptr1 = SvPVbyte_nolen (req->sv1);
1046 1118
1047 REQ_SEND; 1119 REQ_SEND;
1048} 1120}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines