Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/aienux/blob/main/vendor/libc/src/new/qurt/mqueue.rs # aienux Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `aienux / vendor / libc / src / new / qurt / mqueue.rs` 74 lines ยท 1973 bytes Raw Blame History 1 //! Header: `mqueue.h` 2 //! 3 //! QuRT POSIX message queue API. Also provides select/pselect and fd_set 4 //! operations since these are declared in QuRT's mqueue.h. 5 6 use super::*; 7 use crate::prelude::*; 8 9 // Message queue priority constants 10 pub const MQ_PRIO_DEFAULT: c_int = 0; 11 12 // Bits per byte 13 pub const NBBY: c_uint = 8; 14 15 s! { 16 pub struct mq_attr { 17 pub mq_flags: c_long, 18 pub mq_maxmsg: c_long, 19 pub mq_msgsize: c_long, 20 pub mq_curmsgs: c_long, 21 } 22 } 23 24 extern "C" { 25 // Message queue operations 26 pub fn mq_open(name: *const c_char, oflag: c_int, ...) -> mqd_t; 27 pub fn mq_close(mq_desc: mqd_t) -> c_int; 28 pub fn mq_unlink(name: *const c_char) -> c_int; 29 pub fn mq_send( 30 mqdes: mqd_t, 31 msg_ptr: *const c_char, 32 msg_len: size_t, 33 msg_prio: c_uint, 34 ) -> c_int; 35 pub fn mq_timedsend( 36 mqdes: mqd_t, 37 msg_ptr: *const c_char, 38 msg_len: size_t, 39 msg_prio: c_uint, 40 abs_timeout: *const timespec, 41 ) -> c_int; 42 pub fn mq_receive( 43 mqdes: mqd_t, 44 msg_ptr: *mut c_char, 45 msg_len: size_t, 46 msg_prio: *mut c_uint, 47 ) -> ssize_t; 48 pub fn mq_timedreceive( 49 mqdes: mqd_t, 50 msg_ptr: *mut c_char, 51 msg_len: size_t, 52 msg_prio: *mut c_uint, 53 abs_timeout: *const timespec, 54 ) -> ssize_t; 55 pub fn mq_getattr(mqdes: mqd_t, mqstat: *mut mq_attr) -> c_int; 56 pub fn mq_setattr(mqdes: mqd_t, mqstat: *const mq_attr, omqstat: *mut mq_attr) -> c_int; 57 58 // select/pselect (declared in QuRT mqueue.h) 59 pub fn select( 60 nfds: c_int, 61 readfds: *mut fd_set, 62 writefds: *mut fd_set, 63 errorfds: *mut fd_set, 64 timeout: *mut timeval, 65 ) -> c_int; 66 pub fn pselect( 67 nfds: c_int, 68 readfds: *mut fd_set, 69 writefds: *mut fd_set, 70 errorfds: *mut fd_set, 71 timeout: *const timespec, 72 sigmask: *const sigset_t, 73 ) -> c_int; 74 }