Add a succint manual page for mq_unlink
Mostly borrowed from https://pubs.opengroup.org/onlinepubs/9699959099/ and
hence, the disclaimer note at the bottom.
PR: 243174
Submitted by:
Reported by: rfg-freebsd@tristatelogic.com
PR: 243174
Differential D28593
mq_unlink(3): Add manual page fernape on Feb 11 2021, 6:37 PM. Authored by Tags None Referenced Files
Subscribers
Details
Add a succint manual page for mq_unlink Mostly borrowed from https://pubs.opengroup.org/onlinepubs/9699959099/ and PR: 243174 PR: 243174
This small program can help to verify error codes: #include <errno.h> #include <mqueue.h> #include <stdio.h> #include <string.h> int main(int argc, char **argv) { const char *long_name = "/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; int ret; /* This name does not exist*/ ret = mq_unlink("/thisdoesnotexist"); printf("mq_unlink returned: %d with errno = %d and message '%s'\n", ret , errno, strerror(errno)); /* This name is too long */ ret = mq_unlink(long_name); printf("mq_unlink returned: %d with errno = %d and message '%s'\n", ret , errno, strerror(errno)); /* This name does not look like a path */ ret = mq_unlink("aaa"); printf("mq_unlink returned: %d with errno = %d and message '%s'\n", ret , errno, strerror(errno)); return (0); } Without module loaded mq_unlink returned: -1 with errno = 78 and message 'Function not implemented' /* Absurd name */ mq_unlink returned: -1 with errno = 2 and message 'No such file or directory' /* Terribly long name*/ mq_unlink returned: -1 with errno = 63 and message 'File name too long' /* This does not start with slash */ mq_unlink returned: -1 with errno = 22 and message 'Invalid argument' $ egrep -w 'ENOENT|EINVAL|ENAMETOOLONG|ENOSYS' /usr/include/errno.h #define ENOENT 2 /* No such file or directory */ #define EINVAL 22 /* Invalid argument */ #define ENAMETOOLONG 63 /* File name too long */ #define ENOSYS 78 /* Function not implemented */
Diff Detail
Event Timeline
Comment Actions Good work. Some inline comments and you have to update Makefile.inc to actual install the man page.
Comment Actions Address comments by gbe@ * Make myself creator * Mention EACCESS extension * Mention ENOSYS error code * Bump .Dd
Comment Actions Address issues reported by yuripv@
Comment Actions There is still the Makefile change missing. @yuripv do you have any open issues for the man page? I would approve it, but you have spend more time in reviewing it. This comment was removed by gbe. Comment Actions Thanks for the change. Since the other mq_* man pages are in section 2, would your rename the man page and update the Makefile again. |