Skip to content

Commit 43f0c3e

Browse files
committed
Auto merge of #3406 - jdygert-spok:patch-1, r=JohnTitor
vxworks: Add mman.h consts and shm functions Add constants for memory management and shm_open/shm_unlink functions. Also remove unneeded `any` in `cfg`s.
2 parents 6314c9f + aa992ce commit 43f0c3e

File tree

1 file changed

+22
-5
lines changed

1 file changed

+22
-5
lines changed

src/vxworks/mod.rs

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1018,6 +1018,21 @@ pub const O_WRONLY: ::c_int = 0x0001;
10181018
pub const O_RDONLY: ::c_int = 0;
10191019
pub const O_NONBLOCK: ::c_int = 0x4000;
10201020

1021+
// mman.h
1022+
pub const PROT_NONE: ::c_int = 0x0000;
1023+
pub const PROT_READ: ::c_int = 0x0001;
1024+
pub const PROT_WRITE: ::c_int = 0x0002;
1025+
pub const PROT_EXEC: ::c_int = 0x0004;
1026+
1027+
pub const MAP_SHARED: ::c_int = 0x0001;
1028+
pub const MAP_PRIVATE: ::c_int = 0x0002;
1029+
pub const MAP_ANON: ::c_int = 0x0004;
1030+
pub const MAP_ANONYMOUS: ::c_int = MAP_ANON;
1031+
pub const MAP_FIXED: ::c_int = 0x0010;
1032+
pub const MAP_CONTIG: ::c_int = 0x0020;
1033+
1034+
pub const MAP_FAILED: *mut ::c_void = !0 as *mut ::c_void;
1035+
10211036
#[cfg_attr(feature = "extra_traits", derive(Debug))]
10221037
pub enum FILE {}
10231038
impl ::Copy for FILE {}
@@ -1218,6 +1233,8 @@ extern "C" {
12181233
) -> *mut ::c_void;
12191234
pub fn munmap(addr: *mut ::c_void, len: ::size_t) -> ::c_int;
12201235
pub fn truncate(path: *const c_char, length: off_t) -> ::c_int;
1236+
pub fn shm_open(name: *const ::c_char, oflag: ::c_int, mode: ::mode_t) -> ::c_int;
1237+
pub fn shm_unlink(name: *const ::c_char) -> ::c_int;
12211238

12221239
pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::c_void) -> ::c_int;
12231240
pub fn pthread_exit(value: *mut ::c_void) -> !;
@@ -1909,19 +1926,19 @@ cfg_if! {
19091926
if #[cfg(target_arch = "aarch64")] {
19101927
mod aarch64;
19111928
pub use self::aarch64::*;
1912-
} else if #[cfg(any(target_arch = "arm"))] {
1929+
} else if #[cfg(target_arch = "arm")] {
19131930
mod arm;
19141931
pub use self::arm::*;
1915-
} else if #[cfg(any(target_arch = "x86"))] {
1932+
} else if #[cfg(target_arch = "x86")] {
19161933
mod x86;
19171934
pub use self::x86::*;
1918-
} else if #[cfg(any(target_arch = "x86_64"))] {
1935+
} else if #[cfg(target_arch = "x86_64")] {
19191936
mod x86_64;
19201937
pub use self::x86_64::*;
1921-
} else if #[cfg(any(target_arch = "powerpc"))] {
1938+
} else if #[cfg(target_arch = "powerpc")] {
19221939
mod powerpc;
19231940
pub use self::powerpc::*;
1924-
} else if #[cfg(any(target_arch = "powerpc64"))] {
1941+
} else if #[cfg(target_arch = "powerpc64")] {
19251942
mod powerpc64;
19261943
pub use self::powerpc64::*;
19271944
} else {

0 commit comments

Comments
 (0)