Home | History | Annotate | Download | only in sys
      1 /* Copyright (C) 1991,1992,1996-1999,2003,2009 Free Software Foundation, Inc.
      2    This file is part of the GNU C Library.
      3 
      4    The GNU C Library is free software; you can redistribute it and/or
      5    modify it under the terms of the GNU Lesser General Public
      6    License as published by the Free Software Foundation; either
      7    version 2.1 of the License, or (at your option) any later version.
      8 
      9    The GNU C Library is distributed in the hope that it will be useful,
     10    but WITHOUT ANY WARRANTY; without even the implied warranty of
     11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     12    Lesser General Public License for more details.
     13 
     14    You should have received a copy of the GNU Lesser General Public
     15    License along with the GNU C Library; if not, write to the Free
     16    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
     17    02111-1307 USA.  */
     18 
     19 #ifndef _SYS_UIO_H
     20 #define _SYS_UIO_H	1
     21 
     22 #include <features.h>
     23 
     24 #include <sys/types.h>
     25 
     26 __BEGIN_DECLS
     27 
     28 /* This file defines `struct iovec'.  */
     29 #include <bits/uio.h>
     30 
     31 
     32 /* Read data from file descriptor FD, and put the result in the
     33    buffers described by IOVEC, which is a vector of COUNT 'struct iovec's.
     34    The buffers are filled in the order specified.
     35    Operates just like 'read' (see <unistd.h>) except that data are
     36    put in IOVEC instead of a contiguous buffer.
     37 
     38    This function is a cancellation point and therefore not marked with
     39    __THROW.  */
     40 extern ssize_t readv (int __fd, __const struct iovec *__iovec, int __count)
     41   __wur;
     42 
     43 /* Write data pointed by the buffers described by IOVEC, which
     44    is a vector of COUNT 'struct iovec's, to file descriptor FD.
     45    The data is written in the order specified.
     46    Operates just like 'write' (see <unistd.h>) except that the data
     47    are taken from IOVEC instead of a contiguous buffer.
     48 
     49    This function is a cancellation point and therefore not marked with
     50    __THROW.  */
     51 extern ssize_t writev (int __fd, __const struct iovec *__iovec, int __count)
     52   __wur;
     53 
     54 
     55 #ifdef __USE_BSD
     56 # ifndef __USE_FILE_OFFSET64
     57 /* Read data from file descriptor FD at the given position OFFSET
     58    without change the file pointer, and put the result in the buffers
     59    described by IOVEC, which is a vector of COUNT 'struct iovec's.
     60    The buffers are filled in the order specified.  Operates just like
     61    'pread' (see <unistd.h>) except that data are put in IOVEC instead
     62    of a contiguous buffer.
     63 
     64    This function is a cancellation point and therefore not marked with
     65    __THROW.  */
     66 extern ssize_t preadv (int __fd, __const struct iovec *__iovec, int __count,
     67 		       __off_t __offset) __wur;
     68 
     69 /* Write data pointed by the buffers described by IOVEC, which is a
     70    vector of COUNT 'struct iovec's, to file descriptor FD at the given
     71    position OFFSET without change the file pointer.  The data is
     72    written in the order specified.  Operates just like 'pwrite' (see
     73    <unistd.h>) except that the data are taken from IOVEC instead of a
     74    contiguous buffer.
     75 
     76    This function is a cancellation point and therefore not marked with
     77    __THROW.  */
     78 extern ssize_t pwritev (int __fd, __const struct iovec *__iovec, int __count,
     79 			__off_t __offset) __wur;
     80 # else
     81 #  ifdef __REDIRECT
     82 extern ssize_t __REDIRECT (preadv, (int __fd, __const struct iovec *__iovec,
     83 				    int __count, __off64_t __offset),
     84 			   preadv64) __wur;
     85 extern ssize_t __REDIRECT (pwritev, (int __fd, __const struct iovec *__iovec,
     86 				     int __count, __off64_t __offset),
     87 			   pwritev64) __wur;
     88 #  else
     89 #   define preadv preadv64
     90 #   define pwritev pwritev64
     91 #  endif
     92 # endif
     93 
     94 # ifdef __USE_LARGEFILE64
     95 /* Read data from file descriptor FD at the given position OFFSET
     96    without change the file pointer, and put the result in the buffers
     97    described by IOVEC, which is a vector of COUNT 'struct iovec's.
     98    The buffers are filled in the order specified.  Operates just like
     99    'pread' (see <unistd.h>) except that data are put in IOVEC instead
    100    of a contiguous buffer.
    101 
    102    This function is a cancellation point and therefore not marked with
    103    __THROW.  */
    104 extern ssize_t preadv64 (int __fd, __const struct iovec *__iovec, int __count,
    105 			 __off64_t __offset) __wur;
    106 
    107 /* Write data pointed by the buffers described by IOVEC, which is a
    108    vector of COUNT 'struct iovec's, to file descriptor FD at the given
    109    position OFFSET without change the file pointer.  The data is
    110    written in the order specified.  Operates just like 'pwrite' (see
    111    <unistd.h>) except that the data are taken from IOVEC instead of a
    112    contiguous buffer.
    113 
    114    This function is a cancellation point and therefore not marked with
    115    __THROW.  */
    116 extern ssize_t pwritev64 (int __fd, __const struct iovec *__iovec, int __count,
    117 			  __off64_t __offset) __wur;
    118 # endif
    119 #endif	/* Use BSD */
    120 
    121 __END_DECLS
    122 
    123 #endif /* sys/uio.h */
    124