/* ABI change. Provide partial compatibility on this one for now. */
-SYMVER(compat0_1_io_cancel, io_cancel, 0.1);
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);
-SYMVER(compat0_1_io_queue_wait, io_queue_wait, 0.1);
int compat0_1_io_queue_wait(io_context_t ctx, struct timespec *when)
{
struct timespec timeout;
timeout = *when;
return io_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. */
-SYMVER(compat0_1_io_getevents, io_getevents, 0.1);
int compat0_1_io_getevents(io_context_t ctx, long nr,
struct io_event *events,
const struct timespec *const_timeout)
return io_getevents(ctx, 1, nr, events,
const_timeout ? &timeout : NULL);
}
-
+SYMVER(compat0_1_io_getevents, io_getevents, 0.1);
#include <unistd.h>
#include <errno.h>
+#ifndef __has_attribute
+#define __has_attribute(x) 0
+#endif
+
#define _SYMSTR(str) #str
#define SYMSTR(str) _SYMSTR(str)
+#if __has_attribute(__symver__)
+#define SYMVER(compat_sym, orig_sym, ver_sym) \
+ extern __typeof(compat_sym) compat_sym \
+ __attribute__((__symver__(SYMSTR(orig_sym) "@LIBAIO_" SYMSTR(ver_sym))))
+#define DEFSYMVER(compat_sym, orig_sym, ver_sym) \
+ extern __typeof(compat_sym) compat_sym \
+ __attribute__((__symver__(SYMSTR(orig_sym) "@@LIBAIO_" SYMSTR(ver_sym))))
+#else
#define SYMVER(compat_sym, orig_sym, ver_sym) \
__asm__(".symver " SYMSTR(compat_sym) "," SYMSTR(orig_sym) "@LIBAIO_" SYMSTR(ver_sym))
#define DEFSYMVER(compat_sym, orig_sym, ver_sym) \
__asm__(".symver " SYMSTR(compat_sym) "," SYMSTR(orig_sym) "@@LIBAIO_" SYMSTR(ver_sym))
+#endif
#if defined(__i386__)
#include "syscall-i386.h"