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