Back to index

glibc  2.9
sendfile.h
Go to the documentation of this file.
00001 /* sendfile -- copy data directly from one file descriptor to another
00002    Copyright (C) 1998,99,01,2002,2004 Free Software Foundation, Inc.
00003    This file is part of the GNU C Library.
00004 
00005    The GNU C Library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Lesser General Public
00007    License as published by the Free Software Foundation; either
00008    version 2.1 of the License, or (at your option) any later version.
00009 
00010    The GNU C Library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Lesser General Public License for more details.
00014 
00015    You should have received a copy of the GNU Lesser General Public
00016    License along with the GNU C Library; if not, write to the Free
00017    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00018    02111-1307 USA.  */
00019 
00020 #ifndef _SYS_SENDFILE_H
00021 #define _SYS_SENDFILE_H     1
00022 
00023 #include <features.h>
00024 #include <sys/types.h>
00025 
00026 __BEGIN_DECLS
00027 
00028 /* Send up to COUNT bytes from file associated with IN_FD starting at
00029    *OFFSET to descriptor OUT_FD.  Set *OFFSET to the IN_FD's file position
00030    following the read bytes.  If OFFSET is a null pointer, use the normal
00031    file position instead.  Return the number of written bytes, or -1 in
00032    case of error.  */
00033 #ifndef __USE_FILE_OFFSET64
00034 extern ssize_t sendfile (int __out_fd, int __in_fd, off_t *__offset,
00035                       size_t __count) __THROW;
00036 #else
00037 # ifdef __REDIRECT_NTH
00038 extern ssize_t __REDIRECT_NTH (sendfile,
00039                             (int __out_fd, int __in_fd, __off64_t *__offset,
00040                             size_t __count), sendfile64);
00041 # else
00042 #  define sendfile sendfile64
00043 # endif
00044 #endif
00045 #ifdef __USE_LARGEFILE64
00046 extern ssize_t sendfile64 (int __out_fd, int __in_fd, __off64_t *__offset,
00047                         size_t __count) __THROW;
00048 #endif
00049 
00050 __END_DECLS
00051 
00052 #endif /* sys/sendfile.h */