Commit 41e86402 authored by Italo Valcy's avatar Italo Valcy

[svn-upgrade] A integrar a nova versão de origem, libsys-syscall-perl (0.23)

parent 37de3aaa
0.23:
- test bug fix https://rt.cpan.org/Public/Bug/Display.html?id=54322
0.22:
- don't modify non-localized $_. whoops. (we don't want to mess
with our caller's world)
......
See:
http://contributing.appspot.com/sys-syscall
Makefile.PL
CHANGES
MANIFEST This list of files
CONTRIBUTING.txt
README.pod
lib/Sys/Syscall.pm
META.yml
t/00-use.t
......
# http://module-build.sourceforge.net/META-spec.html
#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
name: Sys-Syscall
version: 0.22
version_from: lib/Sys/Syscall.pm
installdirs: site
requires:
--- #YAML:1.0
name: Sys-Syscall
version: 0.23
abstract: Invoke system calls that are otherwise difficult to do from Perl.
license: ~
author:
- Brad Fitzpatrick <brad@danga.com>
generated_by: ExtUtils::MakeMaker version 6.42
distribution_type: module
requires:
POSIX: 0
Test::More: 0
distribution_type: module
generated_by: ExtUtils::MakeMaker version 6.17
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.3.html
version: 1.3
#!/usr/bin/perl
#
# Perl Makefile for Perlbal
# $Id: Makefile.PL 4 2005-07-30 04:56:21Z bradfitz $
# $Id$
#
# Invoke with 'perl Makefile.PL'
#
......
=head1 NAME
Sys::Syscall - access system calls that Perl doesn't normally provide access to
=head1 SYNOPSIS
use Sys::Syscall;
=head1 DESCRIPTION
Use epoll, sendfile, from Perl. Mostly Linux-only support now, but
more syscalls/OSes planned for future.
=head1 Exports
Nothing by default.
May export: sendfile epoll_ctl epoll_create epoll_wait EPOLLIN EPOLLOUT EPOLLERR EPOLLHUP EPOLL_CTL_ADD EPOLL_CTL_DEL EPOLL_CTL_MOD
Export tags: :epoll and :sendfile
=head1 Functions
=head2 epoll support
=over 4
=item $ok = epoll_defined()
Returns true if epoll might be available. (caller must still test with epoll_create)
=item $epfd = epoll_create([ $start_size ])
Create a new epoll filedescriptor. Returns -1 if epoll isn't available.
=item $rv = epoll_ctl($epfd, $op, $fd, $events)
See manpage for epoll_ctl
=item $count = epoll_wait($epfd, $max_events, $timeout, $arrayref)
See manpage for epoll_wait. $arrayref is an arrayref to be modified
with the items returned. The values put into $arrayref are arrayrefs
of [$fd, $state].
=back
=head2 sendfile support
=over 4
=item $ok = sendfile_defined()
Returns true if sendfile should work on this operating system.
=item $sent = sendfile($sock_fd, $file_fd, $max_send)
Sends up to $max_send bytes from $file_fd to $sock_fd. Returns bytes
actually sent, or -1 on error.
=back
=head1 COPYRIGHT
This module is Copyright (c) 2005 Six Apart, Ltd.
All rights reserved.
You may distribute under the terms of either the GNU General Public
License or the Artistic License, as specified in the Perl README file.
If you need more liberal licensing terms, please contact the
maintainer.
=head1 Contributing
Want to contribute? See:
L<http://contributing.appspot.com/sys-syscall>
=head1 WARRANTY
This is free software. IT COMES WITHOUT WARRANTY OF ANY KIND.
=head1 AUTHORS
Brad Fitzpatrick <brad@danga.com>
......@@ -8,7 +8,7 @@ use Config;
require Exporter;
use vars qw(@ISA @EXPORT_OK %EXPORT_TAGS $VERSION);
$VERSION = "0.22";
$VERSION = "0.23";
@ISA = qw(Exporter);
@EXPORT_OK = qw(sendfile epoll_ctl epoll_create epoll_wait
EPOLLIN EPOLLOUT EPOLLERR EPOLLHUP EPOLLRDBAND
......@@ -325,6 +325,12 @@ License or the Artistic License, as specified in the Perl README file.
If you need more liberal licensing terms, please contact the
maintainer.
=head1 Contributing
Want to contribute? See:
L<http://contributing.appspot.com/sys-syscall>
=head1 WARRANTY
This is free software. IT COMES WITHOUT WARRANTY OF ANY KIND.
......
......@@ -46,18 +46,18 @@ is(epoll_wait($epfd, 1, 1000, $events), 0, "get no events");
$t2 = time();
ok($t2 > $t1 && $t2 < ($t1 + 3), "took a second");
my $port = 60000;
my $ip = '127.0.0.1';
my $listen = IO::Socket::INET->new(Listen => 5,
LocalAddr => $ip,
ReuseAddr => 1,
LocalPort => $port,
Proto => 'tcp');
my $listen_port = $listen->sockport;
my $listen2 = IO::Socket::INET->new(Listen => 5,
LocalAddr => $ip,
ReuseAddr => 1,
LocalPort => $port+1,
Proto => 'tcp');
my $listen2_port = $listen2->sockport;
diag "listening on $listen_port and $listen2_port";
ok($listen, "made temp listening socket");
ok(fileno($listen), "has fileno");
......@@ -66,8 +66,8 @@ socket $sock, PF_INET, SOCK_STREAM, IPPROTO_TCP;
socket $sock2, PF_INET, SOCK_STREAM, IPPROTO_TCP;
IO::Handle::blocking($sock, 0);
IO::Handle::blocking($sock2, 0);
connect $sock, Socket::sockaddr_in($port, Socket::inet_aton($ip));
connect $sock2, Socket::sockaddr_in($port+1, Socket::inet_aton($ip));
connect $sock, Socket::sockaddr_in($listen_port, Socket::inet_aton($ip));
connect $sock2, Socket::sockaddr_in($listen2_port, Socket::inet_aton($ip));
select undef, undef, undef, 0.25;
my $lifd1 = fileno($listen);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment