IceWalkers.com - Linux Software downloads and news
Name : Password :
Linux SoftwareLinux RPMLinux HowtosLink UsAboutAdvertise

sendfile (2)

SENDFILE(2)                Linux Programmer's Manual               SENDFILE(2)



NAME
       sendfile - transfer data between file descriptors

SYNOPSIS
       #include<sys/sendfile.h>

       ssize_tsendfile(int out_fd,int in_fd,off_t*offset,size_t count);

DESCRIPTION
       This  call copies data between one file descriptor and another.  Either
       or both of these file descriptors  may  refer  to  a  socket  (but  see
       below).   in_fd  should  be  a  file  descriptor opened for reading and
       out_fd should be a descriptor opened for writing.  offset is a  pointer
       to  a variable holding the input file pointer position from which send-
       file() will start reading data.  When sendfile() returns, this variable
       will  be set to the offset of the byte following the last byte that was
       read.  count is the number of bytes to copy between file descriptors.

       Because this copying is done within the  kernel,  sendfile()  does  not
       need to spend time transferring data to and from user space.


NOTES
       Sendfile  does  not  modify the current file pointer of in_fd, but does
       for out_fd.

       If you plan to use sendfile for sending files to a TCP socket, but need
       to  send some header data in front of the file contents, please see the
       TCP_CORK option in tcp(7) to minimize the number of packets and to tune
       performance.

       Presently the descriptor from which data is read cannot correspond to a
       socket, it must correspond to a file which supports mmap()-like  opera-
       tions.


RETURNVALUE
       If  the  transfer was successful, the number of bytes written to out_fd
       is returned.  On error, -1 is returned, and errno is set appropriately.


ERRORS
       EBADF  The input file was not opened for reading or the output file was
              not opened for writing.

       EINVAL Descriptor is not valid or locked.

       ENOMEM Insufficient memory to read from in_fd.

       EIO    Unspecified error while reading from in_fd.

VERSIONS
       sendfile is a new feature in Linux 2.2.  The  include  file  <sys/send-
       file.h> is present since glibc2.1.

       Other Unixes often implement sendfile with different semantics and pro-
       totypes. It should not be used in portable programs.

SEEALSO
       socket(2), open(2)



Linux Man Page                    1998-12-01                       SENDFILE(2)

_Exitgetsockoptoutwshmat
_exitgettidoutw_pshmctl
_llseekgettimeofdaypauseshmdt
_newselectgetuidpersonalityshmget
_sysctlgttypipeshmop
acceptidlepivot_rootshutdown
accessinbpollsigaction
acctinb_pprctlsigaltstack
adjtimexinlpreadsigblock
afs_syscallinl_pprofsiggetmask
alarminsbpselectsigmask
alloc_hugepagesinslptracesignal
arch_prctlinswpwritesigpause
bdflushintroquotactlsigpending
bindinwreadsigprocmask
breakinw_preaddirsigqueue
brkioctlreadlinksigreturn
cacheflushioctl_listreadvsigsetmask
capgetiopermrebootsigsuspend
capsetioplrecvsigtimedwait
chdiripcrecvfromsigvec
chmodkillrecvmsgsigwaitinfo
chownkillpgrenamesocket
chrootlchownrmdirsocketcall
clonelinksbrksocketpair
closelistensched_get_priority_maxssetmask
connectllseeksched_get_priority_minstat
creatlocksched_getaffinitystatfs
duplseeksched_getparamstime
dup2lstatsched_getschedulerstty
execvemadvisesched_rr_get_intervalswapoff
exitmincoresched_setaffinityswapon
fchdirmkdirsched_setparamsymlink
fchmodmknodsched_setschedulersync
fchownmlocksched_yieldsyscall
fcntlmlockallselectsyscalls
fdatasyncmmapselect_tutsysctl
flockmmap2semctlsysfs
forkmodify_ldtsemgetsysinfo
free_hugepagesmountsemopsyslog
fstatmprotectsendtime
fstatfsmpxsendfiletimes
fsyncmremapsendmsgtkill
ftruncatemsgctlsendtotruncate
futexmsggetsetcontextumask
getcontextmsgopsetdomainnameumount
getdentsmsgrcvsetegidumount2
getdomainnamemsgsndseteuiduname
getdtablesizemsyncsetfsgidundocumented
getegidmunlocksetfsuidunimplemented
geteuidmunlockallsetgidunlink
getgidmunmapsetgroupsuselib
getgroupsnanosleepsethostidustat
gethostidnfsservctlsethostnameutime
gethostnamenicesetitimerutimes
getitimerobsoletesetpgidvfork
getpagesizeoldfstatsetpgrpvhangup
getpeernameoldlstatsetpriorityvm86
getpgidoldoldunamesetregidwait
getpgrpoldstatsetresgidwait3
getpidoldunamesetresuidwait4
getppidopensetreuidwaitpid
getpriorityoutbsetrlimitwrite
getresgidoutb_psetsidwritev
getresuidoutlsetsockopt 
getrlimitoutl_psettimeofday 
getrusageoutsbsetuid 
getsidoutslsetup 


Claws Mail 3.7.2
Email client (and news reader), based on GTK+
Samba 3.4.0
Provides file and print services to SMB/CIFS clients
Amaya 11.2
Complete web browsing and authoring environment
Linux Kernel 2.6 2.6.30.1
Linux Kernel
Scintilla 1.79
Free source code editing component
Sawfish 1.5.0
An extensible window manager
ImageMagick 6.5.4.2
ImageMagick image processing studio
Wine 1.1.25
Free implementation of Windows on Unix
GEdit 2.26.3
Small but powerful text editor
WebGUI 7.7.13
A fully featured content management system.
Free IT Magazines, White Papers, eBooks, and more !
Oracle Magazine

Contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more.

Vulnerability Management for Dummies

Get all the Facts and See How to Implement a Successful Vulnerability Management Program.

Website Magazine

Has tapped premier talent in the Internet industry for our content and each and every issue will contain practical advice and insights for website owners.

Linux Software Map
Find Linux RPM
Best Rated Linux Software
Most Rated Linux Software
Linux Distributions
Linux Howtos
Linux Software
Linux / IT Resources
Site Resources
Google
Privacy Policy
Contact Us
Submit Software
Advertising info