fb6d68
From f9344c91a4ca48288bba30dc94a2d712d0659670 Mon Sep 17 00:00:00 2001
fb6d68
From: Oleg Nesterov <oleg@redhat.com>
fb6d68
Date: Wed, 4 Jul 2012 08:21:15 -0700
fb6d68
Subject: [PATCH] [perl #113980] pp_syscall: "I32 retval" truncates the
fb6d68
 returned value
fb6d68
fb6d68
I noticed today that syscall(9, ...) (mmap) doesn't work for me.
fb6d68
fb6d68
The problem is obvious, pp_syscall() uses I32 for retval and the
fb6d68
"long" address doesn't fit into "int".
fb6d68
fb6d68
The one-liner below should fix the problem.
fb6d68
---
fb6d68
 pp_sys.c | 2 +-
fb6d68
 1 file changed, 1 insertion(+), 1 deletion(-)
fb6d68
fb6d68
diff --git a/pp_sys.c b/pp_sys.c
fb6d68
index fb93732..c5d63ac 100644
fb6d68
--- a/pp_sys.c
fb6d68
+++ b/pp_sys.c
fb6d68
@@ -5456,7 +5456,7 @@ PP(pp_syscall)
fb6d68
     register I32 items = SP - MARK;
fb6d68
     unsigned long a[20];
fb6d68
     register I32 i = 0;
fb6d68
-    I32 retval = -1;
fb6d68
+    IV retval = -1;
fb6d68
 
fb6d68
     if (PL_tainting) {
fb6d68
 	while (++MARK <= SP) {
fb6d68
-- 
fb6d68
1.7.11.4
fb6d68