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