anchao commented on code in PR #12319: URL: https://github.com/apache/nuttx/pull/12319#discussion_r1596878750
########## sched/mqueue/mq_timedreceive.c: ########## @@ -238,6 +235,89 @@ ssize_t file_mq_timedreceive(FAR struct file *mq, FAR char *msg, return ret; } +/**************************************************************************** + * Name: file_mq_timedreceive + * + * Description: + * This function receives the oldest of the highest priority messages from + * the message queue specified by "mq." If the message queue is empty + * and O_NONBLOCK was not set, file_mq_timedreceive() will block until a + * message is added to the message queue (or until a timeout occurs). + * + * file_mq_timedreceive() is an internal OS interface. It is functionally + * equivalent to mq_timedreceive() except that: + * + * - It is not a cancellation point, and + * - It does not modify the errno value. + * + * See comments with mq_timedreceive() for a more complete description of + * the behavior of this function + * + * Input Parameters: + * mq - Message Queue Descriptor + * msg - Buffer to receive the message + * msglen - Size of the buffer in bytes + * prio - If not NULL, the location to store message priority. + * abstime - the absolute time to wait until a timeout is declared. + * + * Returned Value: + * This is an internal OS interface and should not be used by applications. + * It follows the NuttX internal error return policy: Zero (OK) is + * returned on success. A negated errno value is returned on failure. + * (see mq_timedreceive() for the list list valid return values). + * + ****************************************************************************/ + +ssize_t file_mq_timedreceive(FAR struct file *mq, FAR char *msg, Review Comment: Time conversion only needs to be executed if message list is NULL: https://github.com/apache/nuttx/pull/12319/files/8ee40ffebb37071b5680cb4d47a3f2cdac4ab0fb#diff-a2c0eb0390e383ebc069075c5c009c6619cf2aa9785e8372973b1efdd0dffc5aR172 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
