xref: /freebsd/lib/libnv/msgio.h (revision b3e7694832e81d7a904a10f525f8797b753bf0d3)
136da5199SPawel Jakub Dawidek /*-
2*4d846d26SWarner Losh  * SPDX-License-Identifier: BSD-2-Clause
35e53a4f9SPedro F. Giffuni  *
436da5199SPawel Jakub Dawidek  * Copyright (c) 2013 The FreeBSD Foundation
536da5199SPawel Jakub Dawidek  * All rights reserved.
636da5199SPawel Jakub Dawidek  *
736da5199SPawel Jakub Dawidek  * This software was developed by Pawel Jakub Dawidek under sponsorship from
836da5199SPawel Jakub Dawidek  * the FreeBSD Foundation.
936da5199SPawel Jakub Dawidek  *
1036da5199SPawel Jakub Dawidek  * Copyright (c) 2013 Mariusz Zaborski <oshogbo@FreeBSD.org>
1136da5199SPawel Jakub Dawidek  *
1236da5199SPawel Jakub Dawidek  * Redistribution and use in source and binary forms, with or without
1336da5199SPawel Jakub Dawidek  * modification, are permitted provided that the following conditions
1436da5199SPawel Jakub Dawidek  * are met:
1536da5199SPawel Jakub Dawidek  * 1. Redistributions of source code must retain the above copyright
1636da5199SPawel Jakub Dawidek  *    notice, this list of conditions and the following disclaimer.
1736da5199SPawel Jakub Dawidek  * 2. Redistributions in binary form must reproduce the above copyright
1836da5199SPawel Jakub Dawidek  *    notice, this list of conditions and the following disclaimer in the
1936da5199SPawel Jakub Dawidek  *    documentation and/or other materials provided with the distribution.
2036da5199SPawel Jakub Dawidek  *
2136da5199SPawel Jakub Dawidek  * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
2236da5199SPawel Jakub Dawidek  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2336da5199SPawel Jakub Dawidek  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2436da5199SPawel Jakub Dawidek  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
2536da5199SPawel Jakub Dawidek  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2636da5199SPawel Jakub Dawidek  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2736da5199SPawel Jakub Dawidek  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2836da5199SPawel Jakub Dawidek  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2936da5199SPawel Jakub Dawidek  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
3036da5199SPawel Jakub Dawidek  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
3136da5199SPawel Jakub Dawidek  * SUCH DAMAGE.
3236da5199SPawel Jakub Dawidek  */
3336da5199SPawel Jakub Dawidek 
3436da5199SPawel Jakub Dawidek #ifndef	_MSGIO_H_
3536da5199SPawel Jakub Dawidek #define	_MSGIO_H_
3636da5199SPawel Jakub Dawidek 
3736da5199SPawel Jakub Dawidek struct cmsgcred;
3836da5199SPawel Jakub Dawidek struct iovec;
3936da5199SPawel Jakub Dawidek struct msghdr;
4036da5199SPawel Jakub Dawidek 
4136da5199SPawel Jakub Dawidek int cred_send(int sock);
4236da5199SPawel Jakub Dawidek int cred_recv(int sock, struct cmsgcred *cred);
4336da5199SPawel Jakub Dawidek 
4436da5199SPawel Jakub Dawidek int fd_send(int sock, const int *fds, size_t nfds);
4536da5199SPawel Jakub Dawidek int fd_recv(int sock, int *fds, size_t nfds);
4636da5199SPawel Jakub Dawidek 
4736da5199SPawel Jakub Dawidek int buf_send(int sock, void *buf, size_t size);
48db158b99SRobert Wing int buf_recv(int sock, void *buf, size_t size, int flags);
4936da5199SPawel Jakub Dawidek 
5036da5199SPawel Jakub Dawidek #endif	/* !_MSGIO_H_ */
51