mq_receive(3) Library Functions Manual mq_receive(3) mq_receive, mq_timedreceive - LIBRARY Real-time library (librt, -lrt) #include ssize_t mq_receive(mqd_t mqdes, char msg_ptr[.msg_len], size_t msg_len, unsigned int *msg_prio); #include #include ssize_t mq_timedreceive(mqd_t mqdes, char *restrict msg_ptr[.msg_len], size_t msg_len, unsigned int *restrict msg_prio, const struct timespec *restrict abs_timeout); glibc (. feature_test_macros(7)): mq_timedreceive(): _POSIX_C_SOURCE >= 200112L mq_receive() , mqdes, , msg_ptr. msg_len , msg_ptr; mq_msgsize ( mq_getattr(3)). msg_prio NULL, , . , mq_receive() , . O_NONBLOCK, EAGAIN. mq_timedreceive() behaves just like mq_receive(), except that if the queue is empty and the O_NONBLOCK flag is not enabled for the message queue description, then abs_timeout points to a structure which specifies how long the call will block. This value is an absolute timeout in seconds and nanoseconds since the Epoch, 1970-01-01 00:00:00 +0000 (UTC), specified in a timespec(3) structure. , mq_timedreceive() . mq_receive() mq_timedreceive() ; -1 errno . EAGAIN , mqdes, O_NONBLOCK. EBADF mqdes . EINTR ; signal(7). EINVAL abs_timeout , tv_sec tv_nsec 1000 . EMSGSIZE msg_len , mq_msgsize. ETIMEDOUT , . attributes(7). +----------------------------+----------------------------------------------------------+--------------------------+ | | | | +----------------------------+----------------------------------------------------------+--------------------------+ |mq_receive(), | | MT-Safe | |mq_timedreceive() | | | +----------------------------+----------------------------------------------------------+--------------------------+ Linux, mq_receive() , mq_timedreceive() -- , : POSIX.1-2008. POSIX.1-2001. . mq_close(3), mq_getattr(3), mq_notify(3), mq_open(3), mq_send(3), mq_unlink(3), timespec(3), mq_overview(7), time(7) aereiae , Alexey , Azamat Hackimov , Dmitriy S. Seregin , Dmitry Bolkhovskikh , ITriskTI , Max Is , Yuri Kozlov , ; GNU 3 , . . , , . Linux man-pages 6.06 31 2023 . mq_receive(3)