uio.h 4.6 KB

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