This works just like pipe2(2), except it also supports fixed file descriptors. Used in a similar fashion as for other fd instantiating opcodes (like accept, socket, open, etc), where sqe->file_slot is set appropriately if two direct descriptors are desired rather than a set of normal file descriptors. sqe->addr must be set to a pointer to an array of 2 integers, which is where the fixed/normal file descriptors are copied to. sqe->pipe_flags contains flags, same as what is allowed for pipe2(2). Future expansion of per-op private flags can go in sqe->ioprio, like we do for other opcodes that take both a "syscall" flag set and an io_uring opcode specific flag set.
Showing the changes to include/uapi/linux (1 of 4 files). Show all
Unified · Split
| @@ -73,6 +73,7 @@ struct io_uring_sqe { · 72 unmodified lines | |||
| 73 | __u32 futex_flags; | 73 | __u32 futex_flags; |
| 74 | __u32 install_fd_flags; | 74 | __u32 install_fd_flags; |
| 75 | __u32 nop_flags; | 75 | __u32 nop_flags; |
| 76 | __u32 pipe_flags; | ||
| 76 | }; | 77 | }; |
| 77 | __u64 user_data; /* data to be passed back at completion time */ | 78 | __u64 user_data; /* data to be passed back at completion time */ |
| 78 | /* pack this to avoid bogus arm OABI complaints */ | 79 | /* pack this to avoid bogus arm OABI complaints */ |
| @@ -283,6 +284,7 @@ enum io_uring_op { · 204 unmodified lines | |||
| 283 | IORING_OP_EPOLL_WAIT, | 284 | IORING_OP_EPOLL_WAIT, |
| 284 | IORING_OP_READV_FIXED, | 285 | IORING_OP_READV_FIXED, |
| 285 | IORING_OP_WRITEV_FIXED, | 286 | IORING_OP_WRITEV_FIXED, |
| 287 | IORING_OP_PIPE, | ||
| 286 | 288 | ||
| 287 | /* this goes last, obviously */ | 289 | /* this goes last, obviously */ |
| 288 | IORING_OP_LAST, | 290 | IORING_OP_LAST, |