text: /* SPDX-License-Identifier: BSD-3-Clause */
  /*
   * Copyright (C) 2013 Cloudius Systems, Ltd.
   * Copyright (c) 2019, NEC Europe Ltd., NEC Corporation.
   *
   * All rights reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in the
   *    documentation and/or other materials provided with the distribution.
   * 3. Neither the name of the copyright holder nor the names of its
   *    contributors may be used to endorse or promote products derived from
   *    this software without specific prior written permission.
   *
   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
   * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
   * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
   * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
   * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
   * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
   * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
   * POSSIBILITY OF SUCH DAMAGE.
   *
   * THIS HEADER MAY NOT BE EXTRACTED OR MODIFIED IN ANY WAY.
   */
  
  #ifndef _SYS_UIO_H
  #define _SYS_UIO_H
  
  #ifdef __cplusplus
  extern "C" {
  #endif
  
  #define __NEED_size_t
  #define __NEED_ssize_t
  #define __NEED_struct_iovec
  
  #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  #define __NEED_off_t
  #endif
  
  #ifdef _GNU_SOURCE
  #define __NEED_pid_t
  #endif
  
  #include <nolibc-internal/shareddefs.h>
  
  #define UIO_MAXIOV 1024
  
  ssize_t readv(int fd, const struct iovec *iov, int iovcnt);
  ssize_t writev(int fd, const struct iovec *iov, int iovcnt);
  
  #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  ssize_t preadv(int fd, const struct iovec *iov, int iovcnt, off_t offset);
  ssize_t pwritev(int fd, const struct iovec *iov, int iovcnt, off_t offset);
  #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE)
  #define preadv64 preadv
  #define pwritev64 pwritev
  #define off64_t off_t
  #endif
  #endif
  
  #ifdef __cplusplus
  }
  #endif
  
  #endif
  