xref: /freebsd/lib/libnv/msgio.h (revision 36da5199bbd36b93cb5a52708ffcc2848a6637a6)
1*36da5199SPawel Jakub Dawidek /*-
2*36da5199SPawel Jakub Dawidek  * Copyright (c) 2013 The FreeBSD Foundation
3*36da5199SPawel Jakub Dawidek  * All rights reserved.
4*36da5199SPawel Jakub Dawidek  *
5*36da5199SPawel Jakub Dawidek  * This software was developed by Pawel Jakub Dawidek under sponsorship from
6*36da5199SPawel Jakub Dawidek  * the FreeBSD Foundation.
7*36da5199SPawel Jakub Dawidek  *
8*36da5199SPawel Jakub Dawidek  * Copyright (c) 2013 Mariusz Zaborski <oshogbo@FreeBSD.org>
9*36da5199SPawel Jakub Dawidek  *
10*36da5199SPawel Jakub Dawidek  * Redistribution and use in source and binary forms, with or without
11*36da5199SPawel Jakub Dawidek  * modification, are permitted provided that the following conditions
12*36da5199SPawel Jakub Dawidek  * are met:
13*36da5199SPawel Jakub Dawidek  * 1. Redistributions of source code must retain the above copyright
14*36da5199SPawel Jakub Dawidek  *    notice, this list of conditions and the following disclaimer.
15*36da5199SPawel Jakub Dawidek  * 2. Redistributions in binary form must reproduce the above copyright
16*36da5199SPawel Jakub Dawidek  *    notice, this list of conditions and the following disclaimer in the
17*36da5199SPawel Jakub Dawidek  *    documentation and/or other materials provided with the distribution.
18*36da5199SPawel Jakub Dawidek  *
19*36da5199SPawel Jakub Dawidek  * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
20*36da5199SPawel Jakub Dawidek  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21*36da5199SPawel Jakub Dawidek  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22*36da5199SPawel Jakub Dawidek  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
23*36da5199SPawel Jakub Dawidek  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24*36da5199SPawel Jakub Dawidek  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25*36da5199SPawel Jakub Dawidek  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26*36da5199SPawel Jakub Dawidek  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27*36da5199SPawel Jakub Dawidek  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28*36da5199SPawel Jakub Dawidek  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29*36da5199SPawel Jakub Dawidek  * SUCH DAMAGE.
30*36da5199SPawel Jakub Dawidek  *
31*36da5199SPawel Jakub Dawidek  * $FreeBSD$
32*36da5199SPawel Jakub Dawidek  */
33*36da5199SPawel Jakub Dawidek 
34*36da5199SPawel Jakub Dawidek #ifndef	_MSGIO_H_
35*36da5199SPawel Jakub Dawidek #define	_MSGIO_H_
36*36da5199SPawel Jakub Dawidek 
37*36da5199SPawel Jakub Dawidek struct cmsgcred;
38*36da5199SPawel Jakub Dawidek struct iovec;
39*36da5199SPawel Jakub Dawidek struct msghdr;
40*36da5199SPawel Jakub Dawidek 
41*36da5199SPawel Jakub Dawidek int msg_peek(int sock, void *buf, size_t size);
42*36da5199SPawel Jakub Dawidek 
43*36da5199SPawel Jakub Dawidek int cred_send(int sock);
44*36da5199SPawel Jakub Dawidek int cred_recv(int sock, struct cmsgcred *cred);
45*36da5199SPawel Jakub Dawidek 
46*36da5199SPawel Jakub Dawidek int fd_send(int sock, const int *fds, size_t nfds);
47*36da5199SPawel Jakub Dawidek int fd_recv(int sock, int *fds, size_t nfds);
48*36da5199SPawel Jakub Dawidek 
49*36da5199SPawel Jakub Dawidek int buf_send(int sock, void *buf, size_t size);
50*36da5199SPawel Jakub Dawidek int buf_recv(int sock, void *buf, size_t size);
51*36da5199SPawel Jakub Dawidek 
52*36da5199SPawel Jakub Dawidek #endif	/* !_MSGIO_H_ */
53