xref: /freebsd/usr.sbin/bhyve/sockstream.h (revision b3e7694832e81d7a904a10f525f8797b753bf0d3)
12cf9911fSPeter Grehan /*-
2*4d846d26SWarner Losh  * SPDX-License-Identifier: BSD-2-Clause
3ce80faa4SMarcelo Araujo  *
42cf9911fSPeter Grehan  * Copyright (c) 2015 Nahanni Systems, Inc.
52cf9911fSPeter Grehan  * All rights reserved.
62cf9911fSPeter Grehan  *
72cf9911fSPeter Grehan  * Redistribution and use in source and binary forms, with or without
82cf9911fSPeter Grehan  * modification, are permitted provided that the following conditions
92cf9911fSPeter Grehan  * are met:
102cf9911fSPeter Grehan  * 1. Redistributions of source code must retain the above copyright
112cf9911fSPeter Grehan  *    notice, this list of conditions and the following disclaimer.
122cf9911fSPeter Grehan  * 2. Redistributions in binary form must reproduce the above copyright
132cf9911fSPeter Grehan  *    notice, this list of conditions and the following disclaimer in the
142cf9911fSPeter Grehan  *    documentation and/or other materials provided with the distribution.
152cf9911fSPeter Grehan  *
162cf9911fSPeter Grehan  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND
172cf9911fSPeter Grehan  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
182cf9911fSPeter Grehan  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
192cf9911fSPeter Grehan  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
202cf9911fSPeter Grehan  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
212cf9911fSPeter Grehan  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
222cf9911fSPeter Grehan  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
232cf9911fSPeter Grehan  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
242cf9911fSPeter Grehan  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
252cf9911fSPeter Grehan  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
262cf9911fSPeter Grehan  * SUCH DAMAGE.
272cf9911fSPeter Grehan  */
282cf9911fSPeter Grehan 
292cf9911fSPeter Grehan #include <sys/types.h>
302cf9911fSPeter Grehan #include <unistd.h>
312cf9911fSPeter Grehan 
322cf9911fSPeter Grehan ssize_t stream_read(int fd, void *buf, ssize_t nbytes);
332cf9911fSPeter Grehan ssize_t stream_write(int fd, const void *buf, ssize_t nbytes);
34