debuggers.hg

view tools/libaio/src/compat-0_1.c @ 22848:6341fe0f4e5a

Added tag 4.1.0-rc2 for changeset 9dca60d88c63
author Keir Fraser <keir@xen.org>
date Tue Jan 25 14:06:55 2011 +0000 (2011-01-25)
parents b220ea0a2feb
children
line source
1 /* libaio Linux async I/O interface
3 compat-0_1.c : compatibility symbols for libaio 0.1.x-0.3.x
5 Copyright 2002 Red Hat, Inc.
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.
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.
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 <sys/time.h>
24 #include "libaio.h"
25 #include "vsys_def.h"
27 #include "syscall.h"
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;
36 /* FIXME: the old ABI would return the event on the completion queue */
37 return io_cancel(ctx, iocb, &event);
38 }
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 }
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 }