Blame misc/sys/uio.h

Packit 6c4009
/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
Packit 6c4009
   This file is part of the GNU C Library.
Packit 6c4009
Packit 6c4009
   The GNU C Library is free software; you can redistribute it and/or
Packit 6c4009
   modify it under the terms of the GNU Lesser General Public
Packit 6c4009
   License as published by the Free Software Foundation; either
Packit 6c4009
   version 2.1 of the License, or (at your option) any later version.
Packit 6c4009
Packit 6c4009
   The GNU C Library is distributed in the hope that it will be useful,
Packit 6c4009
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 6c4009
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 6c4009
   Lesser General Public License for more details.
Packit 6c4009
Packit 6c4009
   You should have received a copy of the GNU Lesser General Public
Packit 6c4009
   License along with the GNU C Library; if not, see
Packit 6c4009
   <http://www.gnu.org/licenses/>.  */
Packit 6c4009
Packit 6c4009
#ifndef _SYS_UIO_H
Packit 6c4009
#define _SYS_UIO_H	1
Packit 6c4009
Packit 6c4009
#include <features.h>
Packit 6c4009
#include <sys/types.h>
Packit 6c4009
#include <bits/types/struct_iovec.h>
Packit 6c4009
#include <bits/uio_lim.h>
Packit 6c4009
#ifdef __IOV_MAX
Packit 6c4009
# define UIO_MAXIOV __IOV_MAX
Packit 6c4009
#else
Packit 6c4009
# undef UIO_MAXIOV
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
__BEGIN_DECLS
Packit 6c4009
Packit 6c4009
/* Read data from file descriptor FD, and put the result in the
Packit 6c4009
   buffers described by IOVEC, which is a vector of COUNT 'struct iovec's.
Packit 6c4009
   The buffers are filled in the order specified.
Packit 6c4009
   Operates just like 'read' (see <unistd.h>) except that data are
Packit 6c4009
   put in IOVEC instead of a contiguous buffer.
Packit 6c4009
Packit 6c4009
   This function is a cancellation point and therefore not marked with
Packit 6c4009
   __THROW.  */
Packit 6c4009
extern ssize_t readv (int __fd, const struct iovec *__iovec, int __count)
Packit 6c4009
  __wur;
Packit 6c4009
Packit 6c4009
/* Write data pointed by the buffers described by IOVEC, which
Packit 6c4009
   is a vector of COUNT 'struct iovec's, to file descriptor FD.
Packit 6c4009
   The data is written in the order specified.
Packit 6c4009
   Operates just like 'write' (see <unistd.h>) except that the data
Packit 6c4009
   are taken from IOVEC instead of a contiguous buffer.
Packit 6c4009
Packit 6c4009
   This function is a cancellation point and therefore not marked with
Packit 6c4009
   __THROW.  */
Packit 6c4009
extern ssize_t writev (int __fd, const struct iovec *__iovec, int __count)
Packit 6c4009
  __wur;
Packit 6c4009
Packit 6c4009
Packit 6c4009
#ifdef __USE_MISC
Packit 6c4009
# ifndef __USE_FILE_OFFSET64
Packit 6c4009
/* Read data from file descriptor FD at the given position OFFSET
Packit 6c4009
   without change the file pointer, and put the result in the buffers
Packit 6c4009
   described by IOVEC, which is a vector of COUNT 'struct iovec's.
Packit 6c4009
   The buffers are filled in the order specified.  Operates just like
Packit 6c4009
   'pread' (see <unistd.h>) except that data are put in IOVEC instead
Packit 6c4009
   of a contiguous buffer.
Packit 6c4009
Packit 6c4009
   This function is a cancellation point and therefore not marked with
Packit 6c4009
   __THROW.  */
Packit 6c4009
extern ssize_t preadv (int __fd, const struct iovec *__iovec, int __count,
Packit 6c4009
		       __off_t __offset) __wur;
Packit 6c4009
Packit 6c4009
/* Write data pointed by the buffers described by IOVEC, which is a
Packit 6c4009
   vector of COUNT 'struct iovec's, to file descriptor FD at the given
Packit 6c4009
   position OFFSET without change the file pointer.  The data is
Packit 6c4009
   written in the order specified.  Operates just like 'pwrite' (see
Packit 6c4009
   <unistd.h>) except that the data are taken from IOVEC instead of a
Packit 6c4009
   contiguous buffer.
Packit 6c4009
Packit 6c4009
   This function is a cancellation point and therefore not marked with
Packit 6c4009
   __THROW.  */
Packit 6c4009
extern ssize_t pwritev (int __fd, const struct iovec *__iovec, int __count,
Packit 6c4009
			__off_t __offset) __wur;
Packit 6c4009
Packit 6c4009
# else
Packit 6c4009
#  ifdef __REDIRECT
Packit 6c4009
extern ssize_t __REDIRECT (preadv, (int __fd, const struct iovec *__iovec,
Packit 6c4009
				    int __count, __off64_t __offset),
Packit 6c4009
			   preadv64) __wur;
Packit 6c4009
extern ssize_t __REDIRECT (pwritev, (int __fd, const struct iovec *__iovec,
Packit 6c4009
				     int __count, __off64_t __offset),
Packit 6c4009
			   pwritev64) __wur;
Packit 6c4009
#  else
Packit 6c4009
#   define preadv preadv64
Packit 6c4009
#   define pwritev pwritev64
Packit 6c4009
#  endif
Packit 6c4009
# endif
Packit 6c4009
Packit 6c4009
# ifdef __USE_LARGEFILE64
Packit 6c4009
/* Read data from file descriptor FD at the given position OFFSET
Packit 6c4009
   without change the file pointer, and put the result in the buffers
Packit 6c4009
   described by IOVEC, which is a vector of COUNT 'struct iovec's.
Packit 6c4009
   The buffers are filled in the order specified.  Operates just like
Packit 6c4009
   'pread' (see <unistd.h>) except that data are put in IOVEC instead
Packit 6c4009
   of a contiguous buffer.
Packit 6c4009
Packit 6c4009
   This function is a cancellation point and therefore not marked with
Packit 6c4009
   __THROW.  */
Packit 6c4009
extern ssize_t preadv64 (int __fd, const struct iovec *__iovec, int __count,
Packit 6c4009
			 __off64_t __offset) __wur;
Packit 6c4009
Packit 6c4009
/* Write data pointed by the buffers described by IOVEC, which is a
Packit 6c4009
   vector of COUNT 'struct iovec's, to file descriptor FD at the given
Packit 6c4009
   position OFFSET without change the file pointer.  The data is
Packit 6c4009
   written in the order specified.  Operates just like 'pwrite' (see
Packit 6c4009
   <unistd.h>) except that the data are taken from IOVEC instead of a
Packit 6c4009
   contiguous buffer.
Packit 6c4009
Packit 6c4009
   This function is a cancellation point and therefore not marked with
Packit 6c4009
   __THROW.  */
Packit 6c4009
extern ssize_t pwritev64 (int __fd, const struct iovec *__iovec, int __count,
Packit 6c4009
			  __off64_t __offset) __wur;
Packit 6c4009
# endif
Packit 6c4009
#endif	/* Use misc.  */
Packit 6c4009
Packit 6c4009
Packit 6c4009
#ifdef __USE_GNU
Packit 6c4009
# ifndef __USE_FILE_OFFSET64
Packit 6c4009
/* Same as preadv but with an additional flag argumenti defined at uio.h.  */
Packit 6c4009
extern ssize_t preadv2 (int __fp, const struct iovec *__iovec, int __count,
Packit 6c4009
			__off_t __offset, int ___flags) __wur;
Packit 6c4009
Packit 6c4009
/* Same as preadv but with an additional flag argument defined at uio.h.  */
Packit 6c4009
extern ssize_t pwritev2 (int __fd, const struct iovec *__iodev, int __count,
Packit 6c4009
			 __off_t __offset, int __flags) __wur;
Packit 6c4009
Packit 6c4009
# else
Packit 6c4009
#  ifdef __REDIRECT
Packit 6c4009
extern ssize_t __REDIRECT (pwritev2, (int __fd, const struct iovec *__iovec,
Packit 6c4009
				      int __count, __off64_t __offset,
Packit 6c4009
				      int __flags),
Packit 6c4009
			   pwritev64v2) __wur;
Packit 6c4009
extern ssize_t __REDIRECT (preadv2, (int __fd, const struct iovec *__iovec,
Packit 6c4009
				     int __count, __off64_t __offset,
Packit 6c4009
				     int __flags),
Packit 6c4009
			   preadv64v2) __wur;
Packit 6c4009
#  else
Packit 6c4009
#   define preadv2 preadv64v2
Packit 6c4009
#   define pwritev2 pwritev64v2
Packit 6c4009
#  endif
Packit 6c4009
# endif
Packit 6c4009
Packit 6c4009
# ifdef __USE_LARGEFILE64
Packit 6c4009
/* Same as preadv but with an additional flag argumenti defined at uio.h.  */
Packit 6c4009
extern ssize_t preadv64v2 (int __fp, const struct iovec *__iovec,
Packit 6c4009
			   int __count, __off64_t __offset,
Packit 6c4009
			   int ___flags) __wur;
Packit 6c4009
Packit 6c4009
/* Same as preadv but with an additional flag argument defined at uio.h.  */
Packit 6c4009
extern ssize_t pwritev64v2 (int __fd, const struct iovec *__iodev,
Packit 6c4009
			    int __count, __off64_t __offset,
Packit 6c4009
			    int __flags) __wur;
Packit 6c4009
# endif
Packit 6c4009
#endif /* Use GNU.  */
Packit 6c4009
Packit 6c4009
__END_DECLS
Packit 6c4009
Packit 6c4009
/* Some operating systems provide system-specific extensions to this
Packit 6c4009
   header.  */
Packit 6c4009
#ifdef __USE_GNU
Packit 6c4009
# include <bits/uio-ext.h>
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
#endif /* sys/uio.h */