Skip to content

Commit

Permalink
Auto merge of #2811 - devnexen:linux_clone_args, r=JohnTitor
Browse files Browse the repository at this point in the history
linux 64 bits gnu/musl add clone_args for clone3 syscall.
  • Loading branch information
bors committed May 31, 2022
2 parents 37da201 + ff11bdc commit 99756b1
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 0 deletions.
3 changes: 3 additions & 0 deletions libc-test/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2827,6 +2827,7 @@ fn test_linux(target: &str) {
"linux/rtnetlink.h",
"linux/sched.h",
"linux/seccomp.h",
"linux/sched.h",
"linux/sockios.h",
"linux/uinput.h",
"linux/vm_sockets.h",
Expand Down Expand Up @@ -2977,6 +2978,8 @@ fn test_linux(target: &str) {

// Requires glibc 2.33 or newer.
"mallinfo2" => true,
// clone_args might differ b/w libc versions
"clone_args" => true,

// Might differ between kernel versions
"open_how" => true,
Expand Down
14 changes: 14 additions & 0 deletions src/unix/linux_like/linux/gnu/b64/aarch64/align.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,18 @@ s! {
pub fpcr: ::c_uint,
}

#[repr(align(8))]
pub struct clone_args {
pub flags: ::c_ulonglong,
pub pidfd: ::c_ulonglong,
pub child_tid: ::c_ulonglong,
pub parent_tid: ::c_ulonglong,
pub exit_signal: ::c_ulonglong,
pub stack: ::c_ulonglong,
pub stack_size: ::c_ulonglong,
pub tls: ::c_ulonglong,
pub set_tid: ::c_ulonglong,
pub set_tid_size: ::c_ulonglong,
pub cgroup: ::c_ulonglong,
}
}
17 changes: 17 additions & 0 deletions src/unix/linux_like/linux/gnu/b64/x86_64/align.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,20 @@ s_no_extra_traits! {
priv_: [f64; 4]
}
}

s! {
#[repr(align(8))]
pub struct clone_args {
pub flags: ::c_ulonglong,
pub pidfd: ::c_ulonglong,
pub child_tid: ::c_ulonglong,
pub parent_tid: ::c_ulonglong,
pub exit_signal: ::c_ulonglong,
pub stack: ::c_ulonglong,
pub stack_size: ::c_ulonglong,
pub tls: ::c_ulonglong,
pub set_tid: ::c_ulonglong,
pub set_tid_size: ::c_ulonglong,
pub cgroup: ::c_ulonglong,
}
}
15 changes: 15 additions & 0 deletions src/unix/linux_like/linux/musl/b64/aarch64/align.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,19 @@ s! {
pub pstate: ::c_ulong,
__reserved: [[u64; 32]; 16],
}

#[repr(align(8))]
pub struct clone_args {
pub flags: ::c_ulonglong,
pub pidfd: ::c_ulonglong,
pub child_tid: ::c_ulonglong,
pub parent_tid: ::c_ulonglong,
pub exit_signal: ::c_ulonglong,
pub stack: ::c_ulonglong,
pub stack_size: ::c_ulonglong,
pub tls: ::c_ulonglong,
pub set_tid: ::c_ulonglong,
pub set_tid_size: ::c_ulonglong,
pub cgroup: ::c_ulonglong,
}
}
18 changes: 18 additions & 0 deletions src/unix/linux_like/linux/musl/b64/x86_64/align.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,22 @@ s_no_extra_traits! {
pub struct max_align_t {
priv_: [f64; 4]
}

}

s! {
#[repr(align(8))]
pub struct clone_args {
pub flags: ::c_ulonglong,
pub pidfd: ::c_ulonglong,
pub child_tid: ::c_ulonglong,
pub parent_tid: ::c_ulonglong,
pub exit_signal: ::c_ulonglong,
pub stack: ::c_ulonglong,
pub stack_size: ::c_ulonglong,
pub tls: ::c_ulonglong,
pub set_tid: ::c_ulonglong,
pub set_tid_size: ::c_ulonglong,
pub cgroup: ::c_ulonglong,
}
}

0 comments on commit 99756b1

Please sign in to comment.