1114402Sru/* 2114402Sru * Copyright (c) 2014 The FreeBSD Foundation. 3114402Sru * All rights reserved. 4114402Sru * 5114402Sru * Portions of this software were developed by Konstantin Belousov 6114402Sru * under sponsorship from the FreeBSD Foundation. 7114402Sru * 8114402Sru * Redistribution and use in source and binary forms, with or without 9114402Sru * modification, are permitted provided that the following conditions 10114402Sru * are met: 11114402Sru * 1. Redistributions of source code must retain the above copyright 12114402Sru * notice(s), this list of conditions and the following disclaimer as 13114402Sru * the first lines of this file unmodified other than the possible 14114402Sru * addition of one or more copyright notices. 15114402Sru * 2. Redistributions in binary form must reproduce the above copyright 16114402Sru * notice(s), this list of conditions and the following disclaimer in 17114402Sru * the documentation and/or other materials provided with the 18114402Sru * distribution. 19114402Sru * 20151497Sru * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``AS IS'' AND ANY 21114402Sru * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22114402Sru * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23114402Sru * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) BE 24114402Sru * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 25114402Sru * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 26114402Sru * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 27114402Sru * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 28114402Sru * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 29114402Sru * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 30114402Sru * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31114402Sru */ 32114402Sru 33114402Sru#include <sys/cdefs.h> 34114402Sru__FBSDID("$FreeBSD: releng/10.3/lib/libc/sys/recvfrom.c 277317 2015-01-18 11:54:20Z kib $"); 35114402Sru 36114402Sru#include <sys/types.h> 37114402Sru#include <sys/syscall.h> 38114402Sru#include <sys/socket.h> 39114402Sru#include "libc_private.h" 40114402Sru 41114402Sru__weak_reference(__sys_recvfrom, __recvfrom); 42114402Sru 43114402Sru#pragma weak recvfrom 44114402Srussize_t 45114402Srurecvfrom(int s, void *buf, size_t len, int flags, 46114402Sru struct sockaddr * __restrict from, socklen_t * __restrict fromlen) 47114402Sru{ 48114402Sru 49114402Sru return (((ssize_t (*)(int, void *, size_t, int, 50114402Sru struct sockaddr *, socklen_t *)) 51114402Sru __libc_interposing[INTERPOS_recvfrom])(s, buf, len, flags, 52114402Sru from, fromlen)); 53114402Sru} 54114402Sru