Commit 7f33bcb3 authored by bors's avatar bors
Browse files

Auto merge of #1561 - elichai:2019-10-flock64, r=gnzlbg

Add flock64 to linux_like platforms

Hi,
I'm not sure about what to make of the ifdef in glibc `__USE_LARGEFILE64` that covers it.
but I copied the impl from glibc's headers.
everything is the same except for sparc which has a reserved short int.
and in musl it's just `#define flock64 flock`
parents 48e4bb9b 490e0735
......@@ -2234,6 +2234,9 @@ fn test_linux(target: &str) {
t if t.ends_with("_t") => t.to_string(),
// In MUSL `flock64` is a typedef to `flock`.
"flock64" if musl => format!("struct {}", ty),
// put `struct` in front of all structs:.
t if is_struct => format!("struct {}", t),
......
......@@ -22,6 +22,8 @@ pub type ino_t = ::c_ulong;
pub type __CPU_BITTYPE = ::c_ulong;
pub type idtype_t = ::c_int;
pub type loff_t = ::c_longlong;
pub type __kernel_loff_t = ::c_longlong;
pub type __kernel_pid_t = ::c_int;
s! {
pub struct stack_t {
......@@ -78,6 +80,14 @@ s! {
pub l_pid: ::pid_t,
}
pub struct flock64 {
pub l_type: ::c_short,
pub l_whence: ::c_short,
pub l_start: ::__kernel_loff_t,
pub l_len: ::__kernel_loff_t,
pub l_pid: ::__kernel_pid_t,
}
pub struct cpu_set_t {
#[cfg(target_pointer_width = "64")]
__bits: [__CPU_BITTYPE; 16],
......
......@@ -223,6 +223,14 @@ s! {
pub l_pid: ::pid_t,
}
pub struct flock64 {
pub l_type: ::c_short,
pub l_whence: ::c_short,
pub l_start: ::off64_t,
pub l_len: ::off64_t,
pub l_pid: ::pid_t,
}
pub struct pthread_attr_t {
__size: [u32; 11]
}
......
......@@ -33,6 +33,14 @@ s! {
pub l_pid: ::pid_t,
}
pub struct flock64 {
pub l_type: ::c_short,
pub l_whence: ::c_short,
pub l_start: ::off64_t,
pub l_len: ::off64_t,
pub l_pid: ::pid_t,
}
pub struct ipc_perm {
pub __key: ::key_t,
pub uid: ::uid_t,
......
......@@ -33,6 +33,14 @@ s! {
pub l_pid: ::pid_t,
}
pub struct flock64 {
pub l_type: ::c_short,
pub l_whence: ::c_short,
pub l_start: ::off64_t,
pub l_len: ::off64_t,
pub l_pid: ::pid_t,
}
pub struct ipc_perm {
__key: ::key_t,
pub uid: ::uid_t,
......
......@@ -34,6 +34,14 @@ s! {
pub l_pid: ::pid_t,
}
pub struct flock64 {
pub l_type: ::c_short,
pub l_whence: ::c_short,
pub l_start: ::off64_t,
pub l_len: ::off64_t,
pub l_pid: ::pid_t,
}
pub struct _libc_fpreg {
pub significand: [u16; 4],
pub exponent: u16,
......
......@@ -45,6 +45,14 @@ s! {
pub l_pid: ::pid_t,
}
pub struct flock64 {
pub l_type: ::c_short,
pub l_whence: ::c_short,
pub l_start: ::off64_t,
pub l_len: ::off64_t,
pub l_pid: ::pid_t,
}
pub struct stat {
pub st_dev: ::dev_t,
pub st_ino: ::ino_t,
......
......@@ -57,6 +57,14 @@ s! {
pub l_pid: ::pid_t,
}
pub struct flock64 {
pub l_type: ::c_short,
pub l_whence: ::c_short,
pub l_start: ::off64_t,
pub l_len: ::off64_t,
pub l_pid: ::pid_t,
}
pub struct stat64 {
pub st_dev: ::c_ulong,
st_pad1: [::c_long; 2],
......
......@@ -45,6 +45,14 @@ s! {
pub l_pid: ::pid_t,
}
pub struct flock64 {
pub l_type: ::c_short,
pub l_whence: ::c_short,
pub l_start: ::off64_t,
pub l_len: ::off64_t,
pub l_pid: ::pid_t,
}
pub struct stat {
pub st_dev: ::dev_t,
pub st_ino: ::ino_t,
......
......@@ -44,6 +44,14 @@ s! {
pub l_pid: ::pid_t,
}
pub struct flock64 {
pub l_type: ::c_short,
pub l_whence: ::c_short,
pub l_start: ::off64_t,
pub l_len: ::off64_t,
pub l_pid: ::pid_t,
}
pub struct siginfo_t {
pub si_signo: ::c_int,
pub si_errno: ::c_int,
......
......@@ -60,6 +60,15 @@ s! {
pub l_pid: ::pid_t,
}
pub struct flock64 {
pub l_type: ::c_short,
pub l_whence: ::c_short,
pub l_start: ::off64_t,
pub l_len: ::off64_t,
pub l_pid: ::pid_t,
__reserved: ::c_short,
}
pub struct stack_t {
pub ss_sp: *mut ::c_void,
pub ss_flags: ::c_int,
......
......@@ -42,6 +42,14 @@ s! {
pub l_pid: ::pid_t,
}
pub struct flock64 {
pub l_type: ::c_short,
pub l_whence: ::c_short,
pub l_start: ::off64_t,
pub l_len: ::off64_t,
pub l_pid: ::pid_t,
}
pub struct siginfo_t {
pub si_signo: ::c_int,
pub si_errno: ::c_int,
......
......@@ -13,6 +13,8 @@ pub type fsblkcnt_t = ::c_ulonglong;
pub type fsfilcnt_t = ::c_ulonglong;
pub type rlim_t = ::c_ulonglong;
pub type flock64 = flock;
impl siginfo_t {
pub unsafe fn si_addr(&self) -> *mut ::c_void {
#[repr(C)]
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment