History

aio: implement io_pgetevents

This is the io_getevents equivalent of ppoll/pselect and allows to properly mix signals and aio completions (especially with IOCB_CMD_POLL) and atomically executes the following sequence: sigset_t origmask; pthread_sigmask(SIG_SETMASK, &sigmask, &origmask); ret = io_getevents(ctx, min_nr, nr, events, timeout); pthread_sigmask(SIG_SETMASK, &origmask, NULL); Note that unlike many other signal related calls we do not pass a sigmask size, as that would get us to 7 arguments, which aren't easily supported by the syscall infrastructure. It seems a lot less painful to just add a new syscall variant in the unlikely case we're going to increase the sigset size.

Christoph Hellwig committed 8 years ago

Commit 7a074e91 parent a3c0d438 files · +130 −11Browse files

Showing the changes to include/uapi (2 of 8 files). Show all

Unified · Split

2 files
  1. include/uapi/asm-generic/unistd.h +3 −1
  2. include/uapi/linux/aio_abi.h +6 −0
include/uapi/asm-generic/unistd.h+3−1
@@ -732,9 +732,11 @@ __SYSCALL(__NR_pkey_alloc, sys_pkey_alloc) · 731 unmodified lines
732732 __SYSCALL(__NR_pkey_free, sys_pkey_free)
733733 #define __NR_statx 291
734734 __SYSCALL(__NR_statx, sys_statx)
735+#define __NR_io_pgetevents 292
736+__SC_COMP(__NR_io_pgetevents, sys_io_pgetevents, compat_sys_io_pgetevents)
735737
736738 #undef __NR_syscalls
737−#define __NR_syscalls 292
739+#define __NR_syscalls 293
738740
739741 /*
740742 * 32 bit systems traditionally used different
include/uapi/linux/aio_abi.h+6−0
@@ -29,6 +29,7 @@ · 28 unmodified lines
2929
3030 #include <linux/types.h>
3131 #include <linux/fs.h>
32+#include <linux/signal.h>
3233 #include <asm/byteorder.h>
3334
3435 typedef __kernel_ulong_t aio_context_t;
@@ -108,5 +109,10 @@ struct iocb { · 73 unmodified lines
108109 #undef IFBIG
109110 #undef IFLITTLE
110111
112+struct __aio_sigset {
113+ sigset_t __user *sigmask;
114+ size_t sigsetsize;
115+};
116+
111117 #endif /* __LINUX__AIO_ABI_H */
112118

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t