xref: /openbsd-src/usr.bin/sendbug/atomicio.h (revision 5ae6585fed5562f798fedc89869f8bfdb41e12b3)
1*5ae6585fSray /* $OpenBSD: atomicio.h,v 1.1.1.1 2007/03/23 01:47:11 ray Exp $ */
2*5ae6585fSray 
3*5ae6585fSray /*
4*5ae6585fSray  * Copyright (c) 2006 Damien Miller.  All rights reserved.
5*5ae6585fSray  * Copyright (c) 1995,1999 Theo de Raadt.  All rights reserved.
6*5ae6585fSray  * All rights reserved.
7*5ae6585fSray  *
8*5ae6585fSray  * Redistribution and use in source and binary forms, with or without
9*5ae6585fSray  * modification, are permitted provided that the following conditions
10*5ae6585fSray  * are met:
11*5ae6585fSray  * 1. Redistributions of source code must retain the above copyright
12*5ae6585fSray  *    notice, this list of conditions and the following disclaimer.
13*5ae6585fSray  * 2. Redistributions in binary form must reproduce the above copyright
14*5ae6585fSray  *    notice, this list of conditions and the following disclaimer in the
15*5ae6585fSray  *    documentation and/or other materials provided with the distribution.
16*5ae6585fSray  *
17*5ae6585fSray  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18*5ae6585fSray  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19*5ae6585fSray  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20*5ae6585fSray  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21*5ae6585fSray  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22*5ae6585fSray  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23*5ae6585fSray  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24*5ae6585fSray  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25*5ae6585fSray  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26*5ae6585fSray  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27*5ae6585fSray  */
28*5ae6585fSray 
29*5ae6585fSray #ifndef _ATOMICIO_H
30*5ae6585fSray #define _ATOMICIO_H
31*5ae6585fSray 
32*5ae6585fSray /*
33*5ae6585fSray  * Ensure all of data on socket comes through. f==read || f==vwrite
34*5ae6585fSray  */
35*5ae6585fSray size_t	atomicio(ssize_t (*)(int, void *, size_t), int, void *, size_t);
36*5ae6585fSray 
37*5ae6585fSray #define vwrite (ssize_t (*)(int, void *, size_t))write
38*5ae6585fSray 
39*5ae6585fSray #endif /* _ATOMICIO_H */
40