Lines Matching refs:iocb
66 struct iocb **iocb_free; /* array of pointers to iocb */
136 if ((iocb_free = malloc(n * sizeof(struct iocb *))) == 0) { in init_iocb()
142 (iocb_free[i] = malloc(sizeof(struct iocb)))) in init_iocb()
162 static struct iocb *alloc_iocb(void) in alloc_iocb()
169 void free_iocb(struct iocb *io) in free_iocb()
193 struct iocb *iocb = ep->obj; in io_wait_run() local
197 ep, iocb, ep->res, ep->res2); in io_wait_run()
199 cb(ctx, iocb, ep->res, ep->res2); in io_wait_run()
225 static void wr_done(io_context_t ctx, struct iocb *iocb, long res, long res2) in wr_done() argument
230 if (res != iocb->u.c.nbytes) { in wr_done()
232 iocb->u.c.nbytes, res); in wr_done()
237 free_iocb(iocb); in wr_done()
246 static void rd_done(io_context_t ctx, struct iocb *iocb, long res, long res2) in rd_done() argument
249 int iosize = iocb->u.c.nbytes; in rd_done()
250 char *buf = iocb->u.c.buf; in rd_done()
251 off_t offset = iocb->u.c.offset; in rd_done()
257 iocb->u.c.nbytes, res); in rd_done()
265 free_iocb(iocb); in rd_done()
268 if (iocb->aio_fildes == srcfd) in rd_done()
272 io_prep_pwrite(iocb, fd, buf, iosize, offset); in rd_done()
273 io_set_callback(iocb, wr_done); in rd_done()
274 if (1 != (res = io_submit(ctx, 1, &iocb))) in rd_done()
504 struct iocb *ioq[n]; in main()
507 struct iocb *io = alloc_iocb(); in main()
557 struct iocb *io = alloc_iocb(); in main()