Replace FSF snail mail address with URLs.
[glibc.git] / misc / sys / uio.h
blobd226a98e25ea92ec9195eed75eb7afc0331dfdd2
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.
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.
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.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see
17 <http://www.gnu.org/licenses/>. */
19 #ifndef _SYS_UIO_H
20 #define _SYS_UIO_H 1
22 #include <features.h>
24 #include <sys/types.h>
26 __BEGIN_DECLS
28 /* This file defines `struct iovec'. */
29 #include <bits/uio.h>
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.
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;
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.
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;
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.
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;
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.
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
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.
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;
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.
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 */
121 __END_DECLS
123 #endif /* sys/uio.h */