Created
May 3, 2012 16:33
aio syscalls
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#if defined(__i386__) | |
# define SYS_io_setup 245 | |
# define SYS_io_destroy 246 | |
# define SYS_io_getevents 247 | |
# define SYS_io_submit 248 | |
# define SYS_io_cancel 249 | |
#elif defined(__x86_64__) | |
# define SYS_io_setup 206 | |
# define SYS_io_destroy 207 | |
# define SYS_io_getevents 208 | |
# define SYS_io_submit 209 | |
# define SYS_io_cancel 210 | |
#endif | |
/* Linux specific io calls */ | |
static int | |
io_setup (guint nr_reqs, aio_context_t *ctx) | |
{ | |
return syscall (SYS_io_setup, nr_reqs, ctx); | |
} | |
static int | |
io_destroy (aio_context_t ctx) | |
{ | |
return syscall (SYS_io_destroy, ctx); | |
} | |
static int | |
io_getevents (aio_context_t ctx, long min_nr, long nr, struct io_event *events, struct timespec *tmo) | |
{ | |
return syscall (SYS_io_getevents, ctx, min_nr, nr, events, tmo); | |
} | |
static int | |
io_submit (aio_context_t ctx, long n, struct iocb **paiocb) | |
{ | |
return syscall (SYS_io_submit, ctx, n, paiocb); | |
} | |
static int | |
io_cancel (aio_context_t ctx, struct iocb *iocb, struct io_event *result) | |
{ | |
return syscall (SYS_io_cancel, ctx, iocb, result); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment