Skip to content

Commit 389d1ed

Browse files
committed
adding iocb data for io_submit syscall for linux/glibc.
close #3485
1 parent 05d807f commit 389d1ed

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

libc-test/build.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3406,6 +3406,7 @@ fn test_linux(target: &str) {
34063406
headers! {
34073407
cfg:
34083408
"asm/mman.h",
3409+
[gnu]: "linux/aio_abi.h",
34093410
"linux/can.h",
34103411
"linux/can/raw.h",
34113412
// FIXME: requires kernel headers >= 5.4.1.

libc-test/semver/linux-gnu.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -638,6 +638,7 @@ glob64
638638
glob64_t
639639
globfree
640640
globfree64
641+
iocb
641642
lio_listio
642643
mallinfo
643644
mallinfo2

src/unix/linux_like/linux/gnu/mod.rs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ pub type __priority_which_t = ::c_uint;
33
pub type __rlimit_resource_t = ::c_uint;
44
pub type Lmid_t = ::c_long;
55
pub type regoff_t = ::c_int;
6+
pub type __kernel_rwf_t = ::c_int;
67

78
cfg_if! {
89
if #[cfg(doc)] {
@@ -432,6 +433,27 @@ s! {
432433
pub len: ::__u32,
433434
pub options: ::__u32,
434435
}
436+
437+
pub struct iocb {
438+
pub aio_data: ::__u64,
439+
#[cfg(target_endian = "little")]
440+
pub aio_key: ::__u32,
441+
#[cfg(target_endian = "little")]
442+
pub aio_rw_flags: ::__kernel_rwf_t,
443+
#[cfg(target_endian = "big")]
444+
pub aio_rw_flags: ::__kernel_rwf_t,
445+
#[cfg(target_endian = "big")]
446+
pub aio_key: ::__u32,
447+
pub aio_lio_opcode: ::__u16,
448+
pub aio_reqprio: ::__s16,
449+
pub aio_fildes: ::__u32,
450+
pub aio_buf: ::__u64,
451+
pub aio_nbytes: ::__u64,
452+
pub aio_offset: ::__s64,
453+
aio_reserved2: ::__u64,
454+
pub aio_flags: ::__u32,
455+
pub aio_resfd: ::__u32,
456+
}
435457
}
436458

437459
impl siginfo_t {

0 commit comments

Comments
 (0)