blob: 39aacd46b65d87555ec0526e1e7f82496564bdd6 (
plain)
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
|
https://bugs.gentoo.org/722672#c4
--- a/src/syscall-x86_64.h
+++ b/src/syscall-x86_64.h
@@ -1,6 +1,16 @@
+#if ! defined(__ILP32__)
#define __NR_io_setup 206
#define __NR_io_destroy 207
#define __NR_io_getevents 208
#define __NR_io_submit 209
#define __NR_io_cancel 210
#define __NR_io_pgetevents 333
+#else
+#define __X32_SYSCALL_BIT 0x40000000
+#define __NR_io_setup (__X32_SYSCALL_BIT + 543)
+#define __NR_io_destroy (__X32_SYSCALL_BIT + 207)
+#define __NR_io_getevents (__X32_SYSCALL_BIT + 208)
+#define __NR_io_submit (__X32_SYSCALL_BIT + 544)
+#define __NR_io_cancel (__X32_SYSCALL_BIT + 210)
+#define __NR_io_pgetevents (__X32_SYSCALL_BIT + 333)
+#endif
--- a/src/io_pgetevents.c
+++ b/src/io_pgetevents.c
@@ -21,6 +21,7 @@
#include <stdlib.h>
#include <time.h>
#include <signal.h>
+#include <stdint.h>
#include "syscall.h"
#include "aio_ring.h"
@@ -33,10 +34,17 @@
struct io_event *events, struct timespec *timeout,
sigset_t *sigmask)
{
+#if (defined(__x86_64__) && ! defined(__ILP32__)) || ! defined(__x86_64__)
struct {
unsigned long ss;
unsigned long ss_len;
} data;
+#else
+ struct {
+ uint64_t ss;
+ uint64_t ss_len;
+ } data;
+#endif
if (aio_ring_is_empty(ctx, timeout))
return 0;
|