diff --git a/libc-test/build.rs b/libc-test/build.rs index c269d80d88eceb32b6ed150a8fec53822eb3f6fd..47e0a647e11f11fec898c17beb1473907df46051 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -2006,6 +2006,7 @@ fn test_vxworks(target: &str) { "errno.h", "sys/mman.h", "pathLib.h", + "mqueue.h", } /* Fix me */ cfg.skip_const(move |name| match name { diff --git a/src/vxworks/mod.rs b/src/vxworks/mod.rs index 0b90f66b272206f65d1e3ca376d780bdcaa7bbc4..f0c11802ec8535c985443d95e46a9b75c7680a24 100755 --- a/src/vxworks/mod.rs +++ b/src/vxworks/mod.rs @@ -100,6 +100,9 @@ pub type _Vx_ticks64_t = ::c_ulonglong; pub type sa_family_t = ::c_uchar; +// mqueue.h +pub type mqd_t = ::c_int; + #[cfg_attr(feature = "extra_traits", derive(Debug))] pub enum _Vx_semaphore {} impl ::Copy for _Vx_semaphore {} @@ -379,6 +382,13 @@ s! { pub dli_sname: *const ::c_char, pub dli_saddr: *mut ::c_void, } + + pub struct mq_attr { + pub mq_maxmsg: ::c_long, + pub mq_msgsize: ::c_long, + pub mq_flags: ::c_long, + pub mq_curmsgs: ::c_long, + } } s_no_extra_traits! { @@ -1972,6 +1982,43 @@ extern "C" { pub fn randABytes(buf: *mut c_uchar, length: c_int) -> c_int; pub fn randUBytes(buf: *mut c_uchar, length: c_int) -> c_int; pub fn randSecure() -> c_int; + + // mqueue.h + pub fn mq_open(name: *const ::c_char, oflag: ::c_int, ...) -> ::mqd_t; + pub fn mq_close(mqd: ::mqd_t) -> ::c_int; + pub fn mq_unlink(name: *const ::c_char) -> ::c_int; + pub fn mq_receive( + mqd: ::mqd_t, + msg_ptr: *mut ::c_char, + msg_len: ::size_t, + msg_prio: *mut ::c_uint, + ) -> ::ssize_t; + pub fn mq_timedreceive( + mqd: ::mqd_t, + msg_ptr: *mut ::c_char, + msg_len: ::size_t, + msg_prio: *mut ::c_uint, + abs_timeout: *const ::timespec, + ) -> ::ssize_t; + pub fn mq_send( + mqd: ::mqd_t, + msg_ptr: *const ::c_char, + msg_len: ::size_t, + msg_prio: ::c_uint, + ) -> ::c_int; + pub fn mq_timedsend( + mqd: ::mqd_t, + msg_ptr: *const ::c_char, + msg_len: ::size_t, + msg_prio: ::c_uint, + abs_timeout: *const ::timespec, + ) -> ::c_int; + pub fn mq_getattr(mqd: ::mqd_t, attr: *mut ::mq_attr) -> ::c_int; + pub fn mq_setattr( + mqd: ::mqd_t, + newattr: *const ::mq_attr, + oldattr: *mut ::mq_attr, + ) -> ::c_int; } //Dummy functions, these don't really exist in VxWorks.