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.
Showing the changes to include/uapi/linux (1 of 8 files). Show all
Unified · Split
| @@ -29,6 +29,7 @@ · 28 unmodified lines | |||
| 29 | 29 | ||
| 30 | #include <linux/types.h> | 30 | #include <linux/types.h> |
| 31 | #include <linux/fs.h> | 31 | #include <linux/fs.h> |
| 32 | #include <linux/signal.h> | ||
| 32 | #include <asm/byteorder.h> | 33 | #include <asm/byteorder.h> |
| 33 | 34 | ||
| 34 | typedef __kernel_ulong_t aio_context_t; | 35 | typedef __kernel_ulong_t aio_context_t; |
| @@ -108,5 +109,10 @@ struct iocb { · 73 unmodified lines | |||
| 108 | #undef IFBIG | 109 | #undef IFBIG |
| 109 | #undef IFLITTLE | 110 | #undef IFLITTLE |
| 110 | 111 | ||
| 112 | struct __aio_sigset { | ||
| 113 | sigset_t __user *sigmask; | ||
| 114 | size_t sigsetsize; | ||
| 115 | }; | ||
| 116 | |||
| 111 | #endif /* __LINUX__AIO_ABI_H */ | 117 | #endif /* __LINUX__AIO_ABI_H */ |
| 112 | 118 | ||