1*4a324753Smbuhl /* $OpenBSD: w_recvmmsg.c,v 1.1 2022/09/09 13:52:59 mbuhl Exp $ */
2*4a324753Smbuhl /*
3*4a324753Smbuhl * Copyright (c) 2022 Moritz Buhl <mbuhl@openbsd.org>
4*4a324753Smbuhl *
5*4a324753Smbuhl * Permission to use, copy, modify, and distribute this software for any
6*4a324753Smbuhl * purpose with or without fee is hereby granted, provided that the above
7*4a324753Smbuhl * copyright notice and this permission notice appear in all copies.
8*4a324753Smbuhl *
9*4a324753Smbuhl * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10*4a324753Smbuhl * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11*4a324753Smbuhl * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12*4a324753Smbuhl * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13*4a324753Smbuhl * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14*4a324753Smbuhl * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15*4a324753Smbuhl * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16*4a324753Smbuhl */
17*4a324753Smbuhl
18*4a324753Smbuhl #include <sys/socket.h>
19*4a324753Smbuhl #include "cancel.h"
20*4a324753Smbuhl
21*4a324753Smbuhl int
recvmmsg(int fd,struct mmsghdr * mmsg,unsigned int vlen,int flags,struct timespec * ts)22*4a324753Smbuhl recvmmsg(int fd, struct mmsghdr *mmsg, unsigned int vlen, int flags,
23*4a324753Smbuhl struct timespec *ts)
24*4a324753Smbuhl {
25*4a324753Smbuhl int ret;
26*4a324753Smbuhl
27*4a324753Smbuhl ENTER_CANCEL_POINT(1);
28*4a324753Smbuhl ret = HIDDEN(recvmmsg)(fd, mmsg, vlen, flags, ts);
29*4a324753Smbuhl LEAVE_CANCEL_POINT(ret == -1);
30*4a324753Smbuhl return (ret);
31*4a324753Smbuhl }
32*4a324753Smbuhl DEF_CANCEL(recvmmsg);
33