diff options
author | Marcus Holland-Moritz <mhx-perl@gmx.net> | 2009-03-24 19:37:13 +0100 |
---|---|---|
committer | Marcus Holland-Moritz <mhx-perl@gmx.net> | 2009-03-24 19:37:13 +0100 |
commit | c331296618a8003690577e0901fd07183a76094e (patch) | |
tree | 8fea53519c579c1b3455e67683049415833758a9 /doio.c | |
parent | 6f63574e655f386b13267d58419ef322ca7e3f5d (diff) | |
download | perl-c331296618a8003690577e0901fd07183a76094e.tar.gz |
Fix perl #63924: shmget limited to 32 bit segment size on 64 bit OS
Make sure the size argument to shmget() is not limited by the width of an int.
Instead of storing the argument in an int, just store a pointer to the SV and
use different conversions for semget() and shmget().
Diffstat (limited to 'doio.c')
-rw-r--r-- | doio.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -1981,7 +1981,7 @@ Perl_do_ipcget(pTHX_ I32 optype, SV **mark, SV **sp) { dVAR; const key_t key = (key_t)SvNVx(*++mark); - const I32 n = (optype == OP_MSGGET) ? 0 : SvIVx(*++mark); + SV *nsv = optype == OP_MSGGET ? NULL : *++mark; const I32 flags = SvIVx(*++mark); PERL_ARGS_ASSERT_DO_IPCGET; @@ -1996,11 +1996,11 @@ Perl_do_ipcget(pTHX_ I32 optype, SV **mark, SV **sp) #endif #ifdef HAS_SEM case OP_SEMGET: - return semget(key, n, flags); + return semget(key, (int) SvIV(nsv), flags); #endif #ifdef HAS_SHM case OP_SHMGET: - return shmget(key, n, flags); + return shmget(key, (size_t) SvUV(nsv), flags); #endif #if !defined(HAS_MSG) || !defined(HAS_SEM) || !defined(HAS_SHM) default: |