xref: /freebsd/include/mqueue.h (revision 4d846d260e2b9a3d4d0a701462568268cbfe7a5b)
1c6678caeSDavid Xu /*-
2*4d846d26SWarner Losh  * SPDX-License-Identifier: BSD-2-Clause
3e58eb3c4SPedro F. Giffuni  *
4c6678caeSDavid Xu  * Copyright (c) 2005 David Xu <davidxu@freebsd.org>
5c6678caeSDavid Xu  * All rights reserved.
6c6678caeSDavid Xu  *
7c6678caeSDavid Xu  * Redistribution and use in source and binary forms, with or without
8c6678caeSDavid Xu  * modification, are permitted provided that the following conditions
9c6678caeSDavid Xu  * are met:
10c6678caeSDavid Xu  * 1. Redistributions of source code must retain the above copyright
11c6678caeSDavid Xu  *    notice, this list of conditions and the following disclaimer.
12c6678caeSDavid Xu  * 2. Redistributions in binary form must reproduce the above copyright
13c6678caeSDavid Xu  *    notice, this list of conditions and the following disclaimer in the
14c6678caeSDavid Xu  *    documentation and/or other materials provided with the distribution.
15c6678caeSDavid Xu  *
16c6678caeSDavid Xu  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17c6678caeSDavid Xu  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18c6678caeSDavid Xu  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19c6678caeSDavid Xu  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20c6678caeSDavid Xu  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21c6678caeSDavid Xu  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22c6678caeSDavid Xu  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23c6678caeSDavid Xu  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24c6678caeSDavid Xu  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25c6678caeSDavid Xu  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26c6678caeSDavid Xu  * SUCH DAMAGE.
27c6678caeSDavid Xu  *
28c6678caeSDavid Xu  * $FreeBSD$
29c6678caeSDavid Xu  */
30c6678caeSDavid Xu 
31c6678caeSDavid Xu #ifndef _MQUEUE_H_
32c6678caeSDavid Xu #define _MQUEUE_H_
33c6678caeSDavid Xu 
341f4ae9beSDavid Xu #include <sys/cdefs.h>
35c6678caeSDavid Xu #include <sys/types.h>
36c6678caeSDavid Xu #include <sys/mqueue.h>
377fa52c2fSDavid Xu #include <sys/signal.h>
38c6678caeSDavid Xu 
39c6678caeSDavid Xu struct timespec;
40c6678caeSDavid Xu 
411f4ae9beSDavid Xu __BEGIN_DECLS
42c6678caeSDavid Xu int	mq_close(mqd_t);
43c6678caeSDavid Xu int	mq_getattr(mqd_t, struct mq_attr *);
44c6678caeSDavid Xu int	mq_notify(mqd_t, const struct sigevent *);
45c6678caeSDavid Xu mqd_t	mq_open(const char *, int, ...);
46c6678caeSDavid Xu ssize_t	mq_receive(mqd_t, char *, size_t, unsigned *);
47c6678caeSDavid Xu int	mq_send(mqd_t, const char *, size_t, unsigned);
48c6678caeSDavid Xu int	mq_setattr(mqd_t, const struct mq_attr *__restrict,
49c6678caeSDavid Xu 		struct mq_attr *__restrict);
50c6678caeSDavid Xu ssize_t	mq_timedreceive(mqd_t, char *__restrict, size_t,
51c6678caeSDavid Xu 		unsigned *__restrict, const struct timespec *__restrict);
52c6678caeSDavid Xu int	mq_timedsend(mqd_t, const char *, size_t, unsigned,
53c6678caeSDavid Xu 		const struct timespec *);
54c6678caeSDavid Xu int	mq_unlink(const char *);
55ddce1c3dSKonstantin Belousov #if __BSD_VISIBLE
56ddce1c3dSKonstantin Belousov int	mq_getfd_np(mqd_t mqd);
57ddce1c3dSKonstantin Belousov #endif /* __BSD_VISIBLE */
586a274b2bSDavid Xu 
591f4ae9beSDavid Xu __END_DECLS
60c6678caeSDavid Xu #endif
61