GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Sys::Sendfile(3) User Contributed Perl Documentation Sys::Sendfile(3)

Sys::Sendfile - Zero-copy data transfer

version 0.16

 use Sys::Sendfile;
 sendfile $sink, $source, $count;

Sys::Sendfile provides access to your operating system's "sendfile" facility. It allows you to efficiently transfer data from one filehandle to another. Typically the source is a file on disk and the sink is a socket, and some operating systems may not even support other usage.

This function sends up to $count bytes starting from $offset from $in to $out. If $count isn't given, it will try send all remaining bytes in $in, but on some operating systems sending only part of the bytes is a possible result. If $offset isn't given, the function will get current offset of $in (by calling lseek) and pass this information to underlying sendfile syscall. $in and $out can be a bareword, constant, scalar expression, typeglob, or a reference to a typeglob. It returns the number of bytes actually sent. On error, $! is set appropriately and it returns undef. This function is exported by default.

Not all operating systems support sendfile(). Currently Linux, FreeBSD, Solaris, Mac OS X (version 10.5 and up) and Windows are supported.

sendfile(2) - Your manpage on sendfile

IO::Sendfile - A sendfile implementation for Linux

Sys::Syscall - Another sendfile implementation for Linux

Sys::Sendfile::FreeBSD - A module implementing the FreeBSD variant of sendfile

Leon Timmermans <leont@cpan.org>

Kazuho Oku "<kazuhooku@gmail.com>" wrote the Mac OS X code.

Yasuhiro Matsumoto "<mattn.jp@gmail.com>" wrote the Win32 code.

This software is copyright (c) 2008 by Leon Timmermans.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

2022-04-08 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.