-
-
04 Apr 2018 20:20:24 UTC
- Distribution: Sys-Sendfile
- Module version: 0.17
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Repository
- Issues (0)
- Testers (709 / 4 / 0)
- Kwalitee
Bus factor: 1- 74.07% Coverage
- License: perl_5
- Activity
24 month- Tools
- Download (12.11KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
- NAME
- VERSION
- SYNOPSIS
- DESCRIPTION
- FUNCTIONS
- BUGS AND LIMITATIONS
- SEE ALSO
- AUTHOR
- CONTRIBUTORS
- COPYRIGHT AND LICENSE
NAME
Sys::Sendfile - Zero-copy data transfer
VERSION
version 0.17
SYNOPSIS
use Sys::Sendfile; sendfile $sink, $source, $count;
DESCRIPTION
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.FUNCTIONS
sendfile $out, $in, $count, $offset
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.BUGS AND LIMITATIONS
Not all operating systems support sendfile(). Currently Linux, FreeBSD, Solaris, Mac OS X (version 10.5 and up) and Windows are supported.
SEE ALSO
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
AUTHOR
Leon Timmermans <leont@cpan.org>
CONTRIBUTORS
Kazuho Oku
<kazuhooku@gmail.com>
wrote the Mac OS X code.Yasuhiro Matsumoto
<mattn.jp@gmail.com>
wrote the Win32 code.COPYRIGHT AND LICENSE
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.
Module Install Instructions
To install Sys::Sendfile, copy and paste the appropriate command in to your terminal.
cpanm Sys::Sendfile
perl -MCPAN -e shell install Sys::Sendfile
For more information on module installation, please visit the detailed CPAN module installation guide.