xref: /openbsd/lib/libc/sys/w_sendmsg.c (revision fe38b55c)
1*fe38b55cSguenther /*	$OpenBSD: w_sendmsg.c,v 1.1 2016/05/07 19:05:22 guenther Exp $ */
2*fe38b55cSguenther /*
3*fe38b55cSguenther  * Copyright (c) 2015 Philip Guenther <guenther@openbsd.org>
4*fe38b55cSguenther  *
5*fe38b55cSguenther  * Permission to use, copy, modify, and distribute this software for any
6*fe38b55cSguenther  * purpose with or without fee is hereby granted, provided that the above
7*fe38b55cSguenther  * copyright notice and this permission notice appear in all copies.
8*fe38b55cSguenther  *
9*fe38b55cSguenther  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10*fe38b55cSguenther  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11*fe38b55cSguenther  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12*fe38b55cSguenther  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13*fe38b55cSguenther  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14*fe38b55cSguenther  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15*fe38b55cSguenther  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16*fe38b55cSguenther  */
17*fe38b55cSguenther 
18*fe38b55cSguenther #include <sys/socket.h>
19*fe38b55cSguenther #include "cancel.h"
20*fe38b55cSguenther 
21*fe38b55cSguenther ssize_t
sendmsg(int s,const struct msghdr * msg,int flags)22*fe38b55cSguenther sendmsg(int s, const struct msghdr *msg, int flags)
23*fe38b55cSguenther {
24*fe38b55cSguenther 	ssize_t ret;
25*fe38b55cSguenther 
26*fe38b55cSguenther 	ENTER_CANCEL_POINT(1);
27*fe38b55cSguenther 	ret = HIDDEN(sendmsg)(s, msg, flags);
28*fe38b55cSguenther 	LEAVE_CANCEL_POINT(ret <= 0);
29*fe38b55cSguenther 	return (ret);
30*fe38b55cSguenther }
31*fe38b55cSguenther DEF_CANCEL(sendmsg);
32