11541Srgrimes/*
21541Srgrimes * Copyright (c) 2014 The FreeBSD Foundation.
31549Srgrimes * All rights reserved.
41549Srgrimes *
59507Sdg * Portions of this software were developed by Konstantin Belousov
69507Sdg * under sponsorship from the FreeBSD Foundation.
71541Srgrimes *
81541Srgrimes * Redistribution and use in source and binary forms, with or without
91541Srgrimes * modification, are permitted provided that the following conditions
101541Srgrimes * are met:
111541Srgrimes * 1. Redistributions of source code must retain the above copyright
121541Srgrimes *    notice(s), this list of conditions and the following disclaimer as
131541Srgrimes *    the first lines of this file unmodified other than the possible
141541Srgrimes *    addition of one or more copyright notices.
151541Srgrimes * 2. Redistributions in binary form must reproduce the above copyright
161541Srgrimes *    notice(s), this list of conditions and the following disclaimer in
171541Srgrimes *    the documentation and/or other materials provided with the
181541Srgrimes *    distribution.
191541Srgrimes *
201541Srgrimes * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``AS IS'' AND ANY
211541Srgrimes * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
221541Srgrimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
231541Srgrimes * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) BE
241541Srgrimes * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
251541Srgrimes * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
261541Srgrimes * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
271541Srgrimes * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
281541Srgrimes * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
291541Srgrimes * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
301541Srgrimes * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
311541Srgrimes */
321541Srgrimes
331541Srgrimes#include <sys/cdefs.h>
341541Srgrimes__FBSDID("$FreeBSD: releng/11.0/lib/libc/sys/readv.c 288002 2015-09-20 03:45:57Z rodrigc $");
351541Srgrimes
361541Srgrimes#include <sys/types.h>
371541Srgrimes#include <sys/syscall.h>
381541Srgrimes#include <sys/uio.h>
391541Srgrimes#include <unistd.h>
401549Srgrimes#include "libc_private.h"
4134403Smsmith
421541Srgrimes__weak_reference(__sys_readv, __readv);
431541Srgrimes
441541Srgrimes#pragma weak readv
451541Srgrimesssize_t
461541Srgrimesreadv(int fd, const struct iovec *iov, int iovcnt)
471541Srgrimes{
481549Srgrimes
491549Srgrimes	return (((ssize_t (*)(int, const struct iovec *, int))
509507Sdg	    __libc_interposing[INTERPOS_readv])(fd, iov, iovcnt));
517695Sdg}
521549Srgrimes