mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-04-11 13:16:45 +02:00
125 lines
4.3 KiB
Diff
125 lines
4.3 KiB
Diff
Patch-Source: https://sources.debian.org/data/main/libs/libsys-syscall-perl/0.25-7/debian/patches/0001-restore-missing-changes-from-0.20.0.22.patch
|
|
|
|
>From 5fc4d9fd90f3e894bef0f1bdad0a17beaa81f39f Mon Sep 17 00:00:00 2001
|
|
From: Eric Wong <e@80x24.org>
|
|
Date: Wed, 3 Sep 2014 01:24:07 +0000
|
|
Subject: [PATCH] restore missing changes from 0.20..0.22
|
|
|
|
Somehow the 0.25 release omitted all the following changes from
|
|
the 0.20..0.22 era. This restores the relevant changes based on
|
|
the diff between the following two tarballs:
|
|
|
|
http://search.cpan.org/CPAN/authors/id/B/BR/BRADFITZ/Sys-Syscall-0.23.tar.gz
|
|
http://search.cpan.org/CPAN/authors/id/B/BR/BRADFITZ/Sys-Syscall-0.25.tar.gz
|
|
|
|
0.22:
|
|
- don't modify non-localized $_. whoops. (we don't want to mess
|
|
with our caller's world)
|
|
|
|
0.21:
|
|
- add missing EPOLLRDBAND, from Paul Visscher <paulv@canonical.org>
|
|
|
|
0.20:
|
|
- on x86_64 detect 32-bit vs 64-bit process and use right syscall
|
|
numbers. previously worked only with 64-bit userland.
|
|
---
|
|
CHANGES | 15 +++++++++++++++
|
|
lib/Sys/Syscall.pm | 19 +++++++++++++++----
|
|
2 files changed, 30 insertions(+), 4 deletions(-)
|
|
|
|
|
|
Bug: https://github.com/bradfitz/sys-syscall/issues/5
|
|
Bug-Debian: https://bugs.debian.org/760336
|
|
|
|
diff --git a/CHANGES b/CHANGES
|
|
index cb97972..7cf0f2f 100644
|
|
--- a/CHANGES
|
|
+++ b/CHANGES
|
|
@@ -1,5 +1,20 @@
|
|
0.25:
|
|
- adds ARM support
|
|
|
|
+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)
|
|
+
|
|
+0.21:
|
|
+ - add missing EPOLLRDBAND, from Paul Visscher <paulv@canonical.org>
|
|
+
|
|
+0.20:
|
|
+
|
|
+ - on x86_64 detect 32-bit vs 64-bit process and use right syscall
|
|
+ numbers. previously worked only with 64-bit userland.
|
|
+
|
|
0.1:
|
|
- first release. epoll and sendfile only. Linux only.
|
|
diff --git a/lib/Sys/Syscall.pm b/lib/Sys/Syscall.pm
|
|
index 8d7cca2..7821ff7 100644
|
|
--- a/lib/Sys/Syscall.pm
|
|
+++ b/lib/Sys/Syscall.pm
|
|
@@ -3,14 +3,18 @@
|
|
package Sys::Syscall;
|
|
use strict;
|
|
use POSIX qw(ENOSYS SEEK_CUR);
|
|
+use Config;
|
|
|
|
require Exporter;
|
|
use vars qw(@ISA @EXPORT_OK %EXPORT_TAGS $VERSION);
|
|
|
|
$VERSION = "0.25";
|
|
@ISA = qw(Exporter);
|
|
-@EXPORT_OK = qw(sendfile epoll_ctl epoll_create epoll_wait EPOLLIN EPOLLOUT EPOLLERR EPOLLHUP EPOLL_CTL_ADD EPOLL_CTL_DEL EPOLL_CTL_MOD);
|
|
-%EXPORT_TAGS = (epoll => [qw(epoll_ctl epoll_create epoll_wait EPOLLIN EPOLLOUT EPOLLERR EPOLLHUP
|
|
+@EXPORT_OK = qw(sendfile epoll_ctl epoll_create epoll_wait
|
|
+ EPOLLIN EPOLLOUT EPOLLERR EPOLLHUP EPOLLRDBAND
|
|
+ EPOLL_CTL_ADD EPOLL_CTL_DEL EPOLL_CTL_MOD);
|
|
+%EXPORT_TAGS = (epoll => [qw(epoll_ctl epoll_create epoll_wait
|
|
+ EPOLLIN EPOLLOUT EPOLLERR EPOLLHUP EPOLLRDBAND
|
|
EPOLL_CTL_ADD EPOLL_CTL_DEL EPOLL_CTL_MOD)],
|
|
sendfile => [qw(sendfile)],
|
|
);
|
|
@@ -19,6 +23,7 @@ use constant EPOLLIN => 1;
|
|
use constant EPOLLOUT => 4;
|
|
use constant EPOLLERR => 8;
|
|
use constant EPOLLHUP => 16;
|
|
+use constant EPOLLRDBAND => 128;
|
|
use constant EPOLL_CTL_ADD => 1;
|
|
use constant EPOLL_CTL_DEL => 2;
|
|
use constant EPOLL_CTL_MOD => 3;
|
|
@@ -53,6 +58,12 @@ if ($^O eq "linux") {
|
|
# boundaries.
|
|
my $u64_mod_8 = 0;
|
|
|
|
+ # if we're running on an x86_64 kernel, but a 32-bit process,
|
|
+ # we need to use the i386 syscall numbers.
|
|
+ if ($machine eq "x86_64" && $Config{ptrsize} == 4) {
|
|
+ $machine = "i386";
|
|
+ }
|
|
+
|
|
if ($machine =~ m/^i[3456]86$/) {
|
|
$SYS_epoll_create = 254;
|
|
$SYS_epoll_ctl = 255;
|
|
@@ -222,7 +233,7 @@ sub epoll_wait_mod4 {
|
|
$epoll_wait_events = "\0" x 12 x $epoll_wait_size;
|
|
}
|
|
my $ct = syscall($SYS_epoll_wait, $_[0]+0, $epoll_wait_events, $_[1]+0, $_[2]+0);
|
|
- for ($_ = 0; $_ < $ct; $_++) {
|
|
+ for (0..$ct-1) {
|
|
@{$_[3]->[$_]}[1,0] = unpack("LL", substr($epoll_wait_events, 12*$_, 8));
|
|
}
|
|
return $ct;
|
|
@@ -235,7 +246,7 @@ sub epoll_wait_mod8 {
|
|
$epoll_wait_events = "\0" x 16 x $epoll_wait_size;
|
|
}
|
|
my $ct = syscall($SYS_epoll_wait, $_[0]+0, $epoll_wait_events, $_[1]+0, $_[2]+0);
|
|
- for ($_ = 0; $_ < $ct; $_++) {
|
|
+ for (0..$ct-1) {
|
|
# 16 byte epoll_event structs, with format:
|
|
# 4 byte mask [idx 1]
|
|
# 4 byte padding (we put it into idx 2, useless)
|
|
--
|
|
EW
|
|
|