139213Sgibbs/*
239213Sgibbs * Copyright (c) 2014 The FreeBSD Foundation.
371752Sken * All rights reserved.
439213Sgibbs *
539213Sgibbs * Portions of this software were developed by Konstantin Belousov
639213Sgibbs * under sponsorship from the FreeBSD Foundation.
739213Sgibbs *
839213Sgibbs * Redistribution and use in source and binary forms, with or without
939213Sgibbs * modification, are permitted provided that the following conditions
1039213Sgibbs * are met:
1139213Sgibbs * 1. Redistributions of source code must retain the above copyright
1239213Sgibbs *    notice(s), this list of conditions and the following disclaimer as
1339213Sgibbs *    the first lines of this file unmodified other than the possible
1439213Sgibbs *    addition of one or more copyright notices.
1539213Sgibbs * 2. Redistributions in binary form must reproduce the above copyright
1639213Sgibbs *    notice(s), this list of conditions and the following disclaimer in
1739213Sgibbs *    the documentation and/or other materials provided with the
1839213Sgibbs *    distribution.
1939213Sgibbs *
2039213Sgibbs * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``AS IS'' AND ANY
2139213Sgibbs * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2239213Sgibbs * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
2339213Sgibbs * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) BE
2439213Sgibbs * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
2539213Sgibbs * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
2639213Sgibbs * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
2750477Speter * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
2839213Sgibbs * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
2939213Sgibbs * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
3039213Sgibbs * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3139213Sgibbs */
3239213Sgibbs
3339213Sgibbs#include <sys/cdefs.h>
3439213Sgibbs__FBSDID("$FreeBSD: releng/11.0/lib/libc/sys/sendmsg.c 276630 2015-01-03 18:38:46Z kib $");
3539213Sgibbs
3639213Sgibbs#include <sys/types.h>
3739213Sgibbs#include <sys/syscall.h>
3839213Sgibbs#include <sys/socket.h>
3939213Sgibbs#include "libc_private.h"
4039213Sgibbs
4139213Sgibbs__weak_reference(__sys_sendmsg, __sendmsg);
4239213Sgibbs
4339213Sgibbs#pragma weak sendmsg
4439213Sgibbsssize_t
4539213Sgibbssendmsg(int s, const struct msghdr *msg, int flags)
4639213Sgibbs{
4739213Sgibbs
4839213Sgibbs	return (((int (*)(int, const struct msghdr *, int))
4940020Sken	    __libc_interposing[INTERPOS_sendmsg])(s, msg, flags));
5039213Sgibbs}
5139213Sgibbs