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

Comparing Linux-AIO/AIO.xs (file contents):
Revision 1.11 by root, Mon Oct 8 12:58:41 2001 UTC vs.
Revision 1.12 by root, Tue Dec 25 02:33:48 2001 UTC

5#include <sys/types.h> 5#include <sys/types.h>
6#include <unistd.h> 6#include <unistd.h>
7#include <fcntl.h> 7#include <fcntl.h>
8#include <signal.h> 8#include <signal.h>
9#include <sched.h> 9#include <sched.h>
10
11typedef void *InOutStream; /* hack, but 5.6.1 is simply toooo old ;) */
10 12
11#define STACKSIZE 1024 /* yeah */ 13#define STACKSIZE 1024 /* yeah */
12 14
13enum { REQ_QUIT, REQ_READ, REQ_WRITE, REQ_OPEN, REQ_CLOSE }; 15enum { REQ_QUIT, REQ_READ, REQ_WRITE, REQ_OPEN, REQ_CLOSE };
14 16
257 259
258 poll_cb (); 260 poll_cb ();
259 while (started > nthreads) 261 while (started > nthreads)
260 { 262 {
261 sched_yield (); 263 sched_yield ();
264 fcntl (respipe[0], F_SETFL, 0);
262 poll_cb (); 265 poll_cb ();
266 fcntl (respipe[0], F_SETFL, O_NONBLOCK);
263 } 267 }
264 268
265void 269void
266aio_read(fh,offset,length,data,dataoffset,callback) 270aio_read(fh,offset,length,data,dataoffset,callback)
267 PerlIO * fh 271 InOutStream fh
268 UV offset 272 UV offset
269 STRLEN length 273 IV length
270 SV * data 274 SV * data
271 STRLEN dataoffset 275 IV dataoffset
272 SV * callback 276 SV * callback
273 PROTOTYPE: $$$$$$ 277 PROTOTYPE: $$$$$$
274 ALIAS: 278 ALIAS:
275 aio_write = 1 279 aio_write = 1
276 CODE: 280 CODE:
301 305
302 send_req (req); 306 send_req (req);
303 307
304void 308void
305aio_close(fh,callback) 309aio_close(fh,callback)
306 PerlIO * fh 310 InOutStream fh
307 SV * callback 311 SV * callback
308 PROTOTYPE: $ 312 PROTOTYPE: $
309 CODE: 313 CODE:
310 aio_req req; 314 aio_req req;
311 315

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines