Skip to content

Commit

Permalink
Update io_uring (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
tkp1n authored Jun 3, 2020
1 parent 75f9652 commit c58d628
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/Sources/linux.common/io_uring.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ public unsafe struct io_uring_sqe
public ulong addr2;
[FieldOffset(16)]
public ulong addr;
[FieldOffset(16)]
public ulong splice_off_in;
[FieldOffset(24)]
public uint len;
[FieldOffset(28)]
Expand All @@ -37,12 +39,24 @@ public unsafe struct io_uring_sqe
public uint accept_flags;
[FieldOffset(28)]
public uint cancel_flags;
[FieldOffset(28)]
public uint open_flags;
[FieldOffset(28)]
public uint statx_flags;
[FieldOffset(28)]
public uint fadvise_advice;
[FieldOffset(28)]
public uint splice_flags;
[FieldOffset(32)]
public ulong user_data;
[FieldOffset(40)]
public ushort buf_index;
[FieldOffset(40)]
public ushort buf_group;
[FieldOffset(42)]
public ushort personality;
[FieldOffset(44)]
public int splice_fd_in;
[FieldOffset(40)]
public fixed ulong __pad2[3];
};
Expand Down Expand Up @@ -125,6 +139,7 @@ public unsafe static partial class LibC
public static byte IOSQE_IO_LINK => (1 << 2);
public static byte IOSQE_IO_HARDLINK => (1 << 3);
public static byte IOSQE_ASYNC => (1 << 4);
public static byte IOSQE_BUFFER_SELECT => (1 << 5);

public static uint IORING_SETUP_IOPOLL => (1 << 0);
public static uint IORING_SETUP_SQPOLL => (1 << 1);
Expand Down Expand Up @@ -163,9 +178,16 @@ public unsafe static partial class LibC
public static byte IORING_OP_RECV => 27;
public static byte IORING_OP_OPENAT2 => 28;
public static byte IORING_OP_EPOLL_CTL => 29;
public static byte IORING_OP_SPLICE => 30;
public static byte IORING_OP_PROVIDE_BUFFERS => 31;
public static byte IORING_OP_REMOVE_BUFFERS => 32;

public static uint IORING_FSYNC_DATASYNC => (1 << 0);
public static uint IORING_TIMEOUT_ABS => (1 << 0);
public static uint SPLICE_F_FD_IN_FIXED => 0x80000000U;

public static uint IORING_CQE_F_BUFFER => (1 << 0);
public static int IORING_CQE_BUFFER_SHIFT => 16;

public static ulong IORING_OFF_SQ_RING => 0;
public static ulong IORING_OFF_CQ_RING => 0x8000000UL;
Expand All @@ -181,6 +203,7 @@ public unsafe static partial class LibC
public static uint IORING_FEAT_SUBMIT_STABLE => (1 << 2);
public static uint IORING_FEAT_RW_CUR_POS => (1 << 3);
public static uint IORING_FEAT_CUR_PERSONALITY => (1 << 4);
public static uint IORING_FEAT_FAST_POLL => (1 << 5);

public static uint IORING_REGISTER_BUFFERS => 0;
public static uint IORING_UNREGISTER_BUFFERS => 1;
Expand Down

0 comments on commit c58d628

Please sign in to comment.