POSIX message queues: Move mq_setattr() and mq_getattr() from nuttx/libc/mqueue to nuttx/sched/mqueue. Also add sysyscall support for mq_setattr() and mq_getattr(). This is necessary in protected and kernel builds because in those cases the message queue structure is protect and cannot be accessed directly from user mode code. Noted by Jouko Holopainen.

This commit is contained in:
Gregory Nutt
2015-06-03 09:24:17 -06:00
parent 3ee2902c3e
commit d8db596b3b
11 changed files with 23 additions and 105 deletions
+2
View File
@@ -36,10 +36,12 @@
"mmap","sys/mman.h","CONFIG_NFILE_DESCRIPTORS > 0","FAR void*","FAR void*","size_t","int","int","int","off_t"
"mount","sys/mount.h","CONFIG_NFILE_DESCRIPTORS > 0 && !defined(CONFIG_DISABLE_MOUNTPOINT) && defined(CONFIG_FS_READABLE)","int","const char*","const char*","const char*","unsigned long","const void*"
"mq_close","mqueue.h","!defined(CONFIG_DISABLE_MQUEUE)","int","mqd_t"
"mq_getattr","mqueue.h","!defined(CONFIG_DISABLE_MQUEUE)","int","mqd_t","struct mq_attr *"
"mq_notify","mqueue.h","!defined(CONFIG_DISABLE_SIGNALS) && !defined(CONFIG_DISABLE_MQUEUE)","int","mqd_t","const struct sigevent*"
"mq_open","mqueue.h","!defined(CONFIG_DISABLE_MQUEUE)","mqd_t","const char*","int","..."
"mq_receive","mqueue.h","!defined(CONFIG_DISABLE_MQUEUE)","ssize_t","mqd_t","char*","size_t","int*"
"mq_send","mqueue.h","!defined(CONFIG_DISABLE_MQUEUE)","int","mqd_t","const char*","size_t","int"
"mq_setattr","mqueue.h","!defined(CONFIG_DISABLE_MQUEUE)","int","mqd_t","const struct mq_attr *","struct mq_attr *"
"mq_timedreceive","mqueue.h","!defined(CONFIG_DISABLE_MQUEUE)","ssize_t","mqd_t","char*","size_t","int*","const struct timespec*"
"mq_timedsend","mqueue.h","!defined(CONFIG_DISABLE_MQUEUE)","int","mqd_t","const char*","size_t","int","const struct timespec*"
"mq_unlink","mqueue.h","!defined(CONFIG_DISABLE_MQUEUE)","int","const char*"
1 _exit unistd.h void int
36 mmap sys/mman.h CONFIG_NFILE_DESCRIPTORS > 0 FAR void* FAR void*
37 mount sys/mount.h CONFIG_NFILE_DESCRIPTORS > 0 && !defined(CONFIG_DISABLE_MOUNTPOINT) && defined(CONFIG_FS_READABLE) int const char*
38 mq_close mqueue.h !defined(CONFIG_DISABLE_MQUEUE) int mqd_t
39 mq_getattr mqueue.h !defined(CONFIG_DISABLE_MQUEUE) int mqd_t
40 mq_notify mqueue.h !defined(CONFIG_DISABLE_SIGNALS) && !defined(CONFIG_DISABLE_MQUEUE) int mqd_t
41 mq_open mqueue.h !defined(CONFIG_DISABLE_MQUEUE) mqd_t const char*
42 mq_receive mqueue.h !defined(CONFIG_DISABLE_MQUEUE) ssize_t mqd_t
43 mq_send mqueue.h !defined(CONFIG_DISABLE_MQUEUE) int mqd_t
44 mq_setattr mqueue.h !defined(CONFIG_DISABLE_MQUEUE) int mqd_t
45 mq_timedreceive mqueue.h !defined(CONFIG_DISABLE_MQUEUE) ssize_t mqd_t
46 mq_timedsend mqueue.h !defined(CONFIG_DISABLE_MQUEUE) int mqd_t
47 mq_unlink mqueue.h !defined(CONFIG_DISABLE_MQUEUE) int const char*
+2
View File
@@ -277,10 +277,12 @@ SYSCALL_LOOKUP(up_assert, 2, STUB_up_assert)
#ifndef CONFIG_DISABLE_MQUEUE
SYSCALL_LOOKUP(mq_close, 1, STUB_mq_close)
SYSCALL_LOOKUP(mq_getattr, 2, STUB_mq_getattr)
SYSCALL_LOOKUP(mq_notify, 2, STUB_mq_notify)
SYSCALL_LOOKUP(mq_open, 6, STUB_mq_open)
SYSCALL_LOOKUP(mq_receive, 4, STUB_mq_receive)
SYSCALL_LOOKUP(mq_send, 4, STUB_mq_send)
SYSCALL_LOOKUP(mq_setattr, 3, STUB_mq_setattr)
SYSCALL_LOOKUP(mq_timedreceive, 5, STUB_mq_timedreceive)
SYSCALL_LOOKUP(mq_timedsend, 5, STUB_mq_timedsend)
SYSCALL_LOOKUP(mq_unlink, 1, STUB_mq_unlink)
+3
View File
@@ -289,6 +289,7 @@ uintptr_t STUB_pthread_sigmask(int nbr, uintptr_t parm1, uintptr_t parm2,
/* The following are defined only if message queues are enabled */
uintptr_t STUB_mq_close(int nbr, uintptr_t parm1);
uintptr_t STUB_mq_getattr(int nbr, uintptr_t parm1, uintptr_t parm2);
uintptr_t STUB_mq_notify(int nbr, uintptr_t parm1, uintptr_t parm2);
uintptr_t STUB_mq_open(int nbr, uintptr_t parm1, uintptr_t parm2,
uintptr_t parm3, uintptr_t parm4, uintptr_t parm5,
@@ -297,6 +298,8 @@ uintptr_t STUB_mq_receive(int nbr, uintptr_t parm1, uintptr_t parm2,
uintptr_t parm3, uintptr_t parm4);
uintptr_t STUB_mq_send(int nbr, uintptr_t parm1, uintptr_t parm2,
uintptr_t parm3, uintptr_t parm4);
uintptr_t STUB_mq_setattr(int nbr, uintptr_t parm1, uintptr_t parm2,
uintptr_t parm3);
uintptr_t STUB_mq_timedreceive(int nbr, uintptr_t parm1, uintptr_t parm2,
uintptr_t parm3, uintptr_t parm4, uintptr_t parm5);
uintptr_t STUB_mq_timedsend(int nbr, uintptr_t parm1, uintptr_t parm2,