sendfile.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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, write to the Free
  14. Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  15. 02111-1307 USA. */
  16. #ifndef _SYS_SENDFILE_H
  17. #define _SYS_SENDFILE_H 1
  18. #include <features.h>
  19. #include <sys/types.h>
  20. __BEGIN_DECLS
  21. /* Send up to COUNT bytes from file associated with IN_FD starting at
  22. *OFFSET to descriptor OUT_FD. Set *OFFSET to the IN_FD's file position
  23. following the read bytes. If OFFSET is a null pointer, use the normal
  24. file position instead. Return the number of written bytes, or -1 in
  25. case of error. */
  26. #ifndef __USE_FILE_OFFSET64
  27. extern ssize_t sendfile (int __out_fd, int __in_fd, off_t *__offset,
  28. size_t __count) __THROW __nonnull ((3));
  29. #else
  30. # ifdef __REDIRECT
  31. extern ssize_t __REDIRECT (sendfile,
  32. (int __out_fd, int __in_fd, __off64_t *__offset,
  33. size_t __count), sendfile64) __nonnull ((3));
  34. # else
  35. # define sendfile sendfile64
  36. # endif
  37. #endif
  38. #ifdef __USE_LARGEFILE64
  39. extern ssize_t sendfile64 (int __out_fd, int __in_fd, __off64_t *__offset,
  40. size_t __count) __THROW __nonnull ((3));
  41. #endif
  42. __END_DECLS
  43. #endif /* sys/sendfile.h */