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 29c6678caeSDavid Xu #ifndef _MQUEUE_H_ 30c6678caeSDavid Xu #define _MQUEUE_H_ 31c6678caeSDavid Xu 32c6678caeSDavid Xu #include <sys/types.h> 33c6678caeSDavid Xu #include <sys/mqueue.h> 347fa52c2fSDavid Xu #include <sys/signal.h> 35c6678caeSDavid Xu 36c6678caeSDavid Xu struct timespec; 37c6678caeSDavid Xu 381f4ae9beSDavid Xu __BEGIN_DECLS 39c6678caeSDavid Xu int mq_close(mqd_t); 40c6678caeSDavid Xu int mq_getattr(mqd_t, struct mq_attr *); 41c6678caeSDavid Xu int mq_notify(mqd_t, const struct sigevent *); 42c6678caeSDavid Xu mqd_t mq_open(const char *, int, ...); 43c6678caeSDavid Xu ssize_t mq_receive(mqd_t, char *, size_t, unsigned *); 44c6678caeSDavid Xu int mq_send(mqd_t, const char *, size_t, unsigned); 45c6678caeSDavid Xu int mq_setattr(mqd_t, const struct mq_attr *__restrict, 46c6678caeSDavid Xu struct mq_attr *__restrict); 47c6678caeSDavid Xu ssize_t mq_timedreceive(mqd_t, char *__restrict, size_t, 48c6678caeSDavid Xu unsigned *__restrict, const struct timespec *__restrict); 49c6678caeSDavid Xu int mq_timedsend(mqd_t, const char *, size_t, unsigned, 50c6678caeSDavid Xu const struct timespec *); 51c6678caeSDavid Xu int mq_unlink(const char *); 52ddce1c3dSKonstantin Belousov #if __BSD_VISIBLE 53ddce1c3dSKonstantin Belousov int mq_getfd_np(mqd_t mqd); 54ddce1c3dSKonstantin Belousov #endif /* __BSD_VISIBLE */ 556a274b2bSDavid Xu 561f4ae9beSDavid Xu __END_DECLS 57c6678caeSDavid Xu #endif 58