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