sendfile.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /* sendfile -- copy data directly from one file descriptor to another
  2. Copyright (C) 1998,99,01,2002,2004 Free Software Foundation, Inc.
  3. This file is part of the GNU C Library.
  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. The GNU C Library is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public
  13. License along with the GNU C Library; if not, see
  14. <http://www.gnu.org/licenses/>. */
  15. #ifndef _SYS_SENDFILE_H
  16. #define _SYS_SENDFILE_H 1
  17. #include <features.h>
  18. #include <sys/types.h>
  19. __BEGIN_DECLS
  20. /* Send up to COUNT bytes from file associated with IN_FD starting at
  21. *OFFSET to descriptor OUT_FD. Set *OFFSET to the IN_FD's file position
  22. following the read bytes. If OFFSET is a null pointer, use the normal
  23. file position instead. Return the number of written bytes, or -1 in
  24. case of error. */
  25. #ifndef __USE_FILE_OFFSET64
  26. extern ssize_t sendfile (int __out_fd, int __in_fd, off_t *__offset,
  27. size_t __count) __THROW;
  28. #else
  29. # ifdef __REDIRECT_NTH
  30. extern ssize_t __REDIRECT_NTH (sendfile,
  31. (int __out_fd, int __in_fd, __off64_t *__offset,
  32. size_t __count), sendfile64);
  33. # else
  34. # define sendfile sendfile64
  35. # endif
  36. #endif
  37. #ifdef __USE_LARGEFILE64
  38. extern ssize_t sendfile64 (int __out_fd, int __in_fd, __off64_t *__offset,
  39. size_t __count) __THROW;
  40. #endif
  41. __END_DECLS
  42. #endif /* sys/sendfile.h */