vfs: check userland buffers before reading them.
[haiku.git] / src / system / libroot / posix / sys / xsi_msg_queue.cpp
blob910523c0b24f715b953467bef31626aab5741376
1 /*
2 * Copyright 2008, Haiku Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
5 * Authors:
6 * Salvatore Benedetto <salvatore.benedetto@gmail.com>
7 */
9 #include <sys/msg.h>
11 #include <errno.h>
12 #include <fcntl.h>
13 #include <stdarg.h>
14 #include <stdlib.h>
16 #include <OS.h>
18 #include <errno_private.h>
19 #include <syscall_utils.h>
20 #include <syscalls.h>
23 int
24 msgctl(int messageQueueID, int command, struct msqid_ds *buffer)
26 RETURN_AND_SET_ERRNO(_kern_xsi_msgctl(messageQueueID, command, buffer));
30 int
31 msgget(key_t key, int messageQueueFlags)
33 RETURN_AND_SET_ERRNO(_kern_xsi_msgget(key, messageQueueFlags));
37 ssize_t
38 msgrcv(int messageQueueID, void *messagePointer, size_t messageSize,
39 long messageType, int messageFlags)
41 RETURN_AND_SET_ERRNO_TEST_CANCEL(_kern_xsi_msgrcv(messageQueueID,
42 messagePointer, messageSize, messageType, messageFlags));
46 int
47 msgsnd(int messageQueueID, const void *messagePointer, size_t messageSize,
48 int messageFlags)
50 RETURN_AND_SET_ERRNO_TEST_CANCEL(_kern_xsi_msgsnd(messageQueueID,
51 messagePointer, messageSize, messageFlags));