| 1 | /* libaio Linux async I/O interface |
|---|
| 2 | |
|---|
| 3 | compat-0_1.c : compatibility symbols for libaio 0.1.x-0.3.x |
|---|
| 4 | |
|---|
| 5 | Copyright 2002 Red Hat, Inc. |
|---|
| 6 | |
|---|
| 7 | This library is free software; you can redistribute it and/or |
|---|
| 8 | modify it under the terms of the GNU Lesser General Public |
|---|
| 9 | License as published by the Free Software Foundation; either |
|---|
| 10 | version 2 of the License, or (at your option) any later version. |
|---|
| 11 | |
|---|
| 12 | This library is distributed in the hope that it will be useful, |
|---|
| 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|---|
| 15 | Lesser General Public License for more details. |
|---|
| 16 | |
|---|
| 17 | You should have received a copy of the GNU Lesser General Public |
|---|
| 18 | License along with this library; if not, write to the Free Software |
|---|
| 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|---|
| 20 | */ |
|---|
| 21 | #include <stdlib.h> |
|---|
| 22 | #include <asm/errno.h> |
|---|
| 23 | |
|---|
| 24 | #include "libaio.h" |
|---|
| 25 | #include "vsys_def.h" |
|---|
| 26 | |
|---|
| 27 | #include "syscall.h" |
|---|
| 28 | |
|---|
| 29 | |
|---|
| 30 | /* ABI change. Provide partial compatibility on this one for now. */ |
|---|
| 31 | SYMVER(compat0_1_io_cancel, io_cancel, 0.1); |
|---|
| 32 | int compat0_1_io_cancel(io_context_t ctx, struct iocb *iocb) |
|---|
| 33 | { |
|---|
| 34 | struct io_event event; |
|---|
| 35 | |
|---|
| 36 | /* FIXME: the old ABI would return the event on the completion queue */ |
|---|
| 37 | return io_cancel(ctx, iocb, &event); |
|---|
| 38 | } |
|---|
| 39 | |
|---|
| 40 | SYMVER(compat0_1_io_queue_wait, io_queue_wait, 0.1); |
|---|
| 41 | int compat0_1_io_queue_wait(io_context_t ctx, struct timespec *when) |
|---|
| 42 | { |
|---|
| 43 | struct timespec timeout; |
|---|
| 44 | if (when) |
|---|
| 45 | timeout = *when; |
|---|
| 46 | return io_getevents(ctx, 0, 0, NULL, when ? &timeout : NULL); |
|---|
| 47 | } |
|---|
| 48 | |
|---|
| 49 | |
|---|
| 50 | /* ABI change. Provide backwards compatibility for this one. */ |
|---|
| 51 | SYMVER(compat0_1_io_getevents, io_getevents, 0.1); |
|---|
| 52 | int compat0_1_io_getevents(io_context_t ctx_id, long nr, |
|---|
| 53 | struct io_event *events, |
|---|
| 54 | const struct timespec *const_timeout) |
|---|
| 55 | { |
|---|
| 56 | struct timespec timeout; |
|---|
| 57 | if (const_timeout) |
|---|
| 58 | timeout = *const_timeout; |
|---|
| 59 | return io_getevents(ctx_id, 1, nr, events, |
|---|
| 60 | const_timeout ? &timeout : NULL); |
|---|
| 61 | } |
|---|
| 62 | |
|---|