MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / mq_unlink

Function mq_unlink

components/libc/posix/ipc/mqueue.c:430–440  ·  view source on GitHub ↗

* @brief This function will remove a message queue (REALTIME). * * @note The mq_unlink() function shall remove the message queue named by the string name. * If one or more processes have the message queue open when mq_unlink() is called, * destruction of the message queue shall be postponed until all references to the message queue have been closed. * However,

Source from the content-addressed store, hash-verified

428 * the same message queue name as was previously used in a successful mq_open() call shall not give an [ENAMETOOLONG] error.
429 */
430int mq_unlink(const char *name)
431{
432 if(*name == '/')
433 {
434 name++;
435 }
436 const char *mq_path = "/dev/mqueue/";
437 char mq_name[RT_NAME_MAX + 12] = {0};
438 rt_sprintf(mq_name, "%s%s", mq_path, name);
439 return unlink(mq_name);
440}
441RTM_EXPORT(mq_unlink);

Callers 2

sys_mq_unlinkFunction · 0.85
libc_mqFunction · 0.85

Calls 2

rt_sprintfFunction · 0.85
unlinkFunction · 0.50

Tested by

no test coverage detected