From c70634e4866f668a77260997c8bd7716b8905cdd Mon Sep 17 00:00:00 2001 From: Elichai Turkel Date: Fri, 18 Oct 2019 15:46:38 +0300 Subject: [PATCH] Add flock64 to linux_like platforms --- src/unix/linux_like/android/mod.rs | 10 ++++++++++ src/unix/linux_like/emscripten/mod.rs | 8 ++++++++ src/unix/linux_like/linux/gnu/b32/arm/mod.rs | 8 ++++++++ src/unix/linux_like/linux/gnu/b32/powerpc.rs | 8 ++++++++ src/unix/linux_like/linux/gnu/b32/x86/mod.rs | 8 ++++++++ src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs | 8 ++++++++ src/unix/linux_like/linux/gnu/b64/mips64/mod.rs | 8 ++++++++ src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs | 8 ++++++++ src/unix/linux_like/linux/gnu/b64/s390x.rs | 8 ++++++++ src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs | 9 +++++++++ src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs | 8 ++++++++ src/unix/linux_like/linux/musl/mod.rs | 2 ++ 12 files changed, 93 insertions(+) diff --git a/src/unix/linux_like/android/mod.rs b/src/unix/linux_like/android/mod.rs index 4c4a2966..356fec29 100644 --- a/src/unix/linux_like/android/mod.rs +++ b/src/unix/linux_like/android/mod.rs @@ -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], diff --git a/src/unix/linux_like/emscripten/mod.rs b/src/unix/linux_like/emscripten/mod.rs index d062b98f..3fc47bb5 100644 --- a/src/unix/linux_like/emscripten/mod.rs +++ b/src/unix/linux_like/emscripten/mod.rs @@ -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] } diff --git a/src/unix/linux_like/linux/gnu/b32/arm/mod.rs b/src/unix/linux_like/linux/gnu/b32/arm/mod.rs index f74b41e3..0a5fc856 100644 --- a/src/unix/linux_like/linux/gnu/b32/arm/mod.rs +++ b/src/unix/linux_like/linux/gnu/b32/arm/mod.rs @@ -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, diff --git a/src/unix/linux_like/linux/gnu/b32/powerpc.rs b/src/unix/linux_like/linux/gnu/b32/powerpc.rs index 92e52333..76444280 100644 --- a/src/unix/linux_like/linux/gnu/b32/powerpc.rs +++ b/src/unix/linux_like/linux/gnu/b32/powerpc.rs @@ -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, diff --git a/src/unix/linux_like/linux/gnu/b32/x86/mod.rs b/src/unix/linux_like/linux/gnu/b32/x86/mod.rs index 05e87606..f5f7cac4 100644 --- a/src/unix/linux_like/linux/gnu/b32/x86/mod.rs +++ b/src/unix/linux_like/linux/gnu/b32/x86/mod.rs @@ -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, diff --git a/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs b/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs index b980a11b..13d9aaf0 100644 --- a/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs +++ b/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs @@ -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, diff --git a/src/unix/linux_like/linux/gnu/b64/mips64/mod.rs b/src/unix/linux_like/linux/gnu/b64/mips64/mod.rs index 5b3da3cb..2b77aa4b 100644 --- a/src/unix/linux_like/linux/gnu/b64/mips64/mod.rs +++ b/src/unix/linux_like/linux/gnu/b64/mips64/mod.rs @@ -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], diff --git a/src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs b/src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs index bd908954..22507d72 100644 --- a/src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs +++ b/src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs @@ -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, diff --git a/src/unix/linux_like/linux/gnu/b64/s390x.rs b/src/unix/linux_like/linux/gnu/b64/s390x.rs index ac317041..403e4578 100644 --- a/src/unix/linux_like/linux/gnu/b64/s390x.rs +++ b/src/unix/linux_like/linux/gnu/b64/s390x.rs @@ -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, diff --git a/src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs b/src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs index 93b1fa53..651ada37 100644 --- a/src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs +++ b/src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs @@ -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, diff --git a/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs b/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs index d1a22943..124f0926 100644 --- a/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs +++ b/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs @@ -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, diff --git a/src/unix/linux_like/linux/musl/mod.rs b/src/unix/linux_like/linux/musl/mod.rs index 7f10a0b3..2c5d375a 100644 --- a/src/unix/linux_like/linux/musl/mod.rs +++ b/src/unix/linux_like/linux/musl/mod.rs @@ -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)]