diff options
author | Michael G Schwern <schwern@pobox.com> | 2000-03-02 12:15:03 -0500 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2000-03-03 22:35:46 +0000 |
commit | e4038a1fb4fdfabe2578d9a8ffe81a18bec6013d (patch) | |
tree | ba6fdd439f75bc01aa5c3c8fa0ca40c5ad4d8654 | |
parent | fb533e5b8667f34403ef727e00f2b73b82975dff (diff) | |
download | perl-e4038a1fb4fdfabe2578d9a8ffe81a18bec6013d.tar.gz |
The SysV IPC test must use the native integers
(long or short), also noted this in the msgsnd/semctl
documentation. Reported in
To: perl5-porters@perl.org
Subject: [ID 20000302.006] [BUG 5.5.670 t/ipc_sysv.t] Fails 2,5,6 with 64bit on Linux
Message-Id: <20000302221503.EDF6E3830@athens.arena-i.com>
p4raw-id: //depot/cfgperl@5498
-rw-r--r-- | pod/perlfunc.pod | 16 | ||||
-rwxr-xr-x | t/lib/ipc_sysv.t | 15 |
2 files changed, 11 insertions, 20 deletions
diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index 081709a174..758b573374 100644 --- a/pod/perlfunc.pod +++ b/pod/perlfunc.pod @@ -2462,10 +2462,10 @@ and C<IPC::Msg> documentation. =item msgsnd ID,MSG,FLAGS Calls the System V IPC function msgsnd to send the message MSG to the -message queue ID. MSG must begin with the long integer message type, -which may be created with C<pack("l", $type)>. Returns true if -successful, or false if there is an error. See also C<IPC::SysV> -and C<IPC::SysV::Msg> documentation. +message queue ID. MSG must begin with the native long integer message +type, which may be created with C<pack("l!", $type)>. Returns true if +successful, or false if there is an error. See also C<IPC::SysV> and +C<IPC::SysV::Msg> documentation. =item msgrcv ID,VAR,SIZE,TYPE,FLAGS @@ -3874,9 +3874,11 @@ Calls the System V IPC function C<semctl>. You'll probably have to say first to get the correct constant definitions. If CMD is IPC_STAT or GETALL, then ARG must be a variable which will hold the returned -semid_ds structure or semaphore value array. Returns like C<ioctl>: the -undefined value for error, "C<0 but true>" for zero, or the actual return -value otherwise. See also C<IPC::SysV> and C<IPC::Semaphore> documentation. +semid_ds structure or semaphore value array. Returns like C<ioctl>: +the undefined value for error, "C<0 but true>" for zero, or the actual +return value otherwise. The ARG must consist of a vector of native +short integers, which may may be created with C<pack("s!",(0)x$nsem)>. +See also C<IPC::SysV> and C<IPC::Semaphore> documentation. =item semget KEY,NSEMS,FLAGS diff --git a/t/lib/ipc_sysv.t b/t/lib/ipc_sysv.t index 55d9ba197f..8485d5dca6 100755 --- a/t/lib/ipc_sysv.t +++ b/t/lib/ipc_sysv.t @@ -81,16 +81,9 @@ if ($Config{'d_msgget'} eq 'define' && my $test5bad; my $test6bad; - if ($Config{'use64bitall'} eq 'define') { - unless (msgsnd($msg,pack("L L a*",0,$msgtype,$msgtext),IPC_NOWAIT)) { + unless (msgsnd($msg,pack("L! a*",$msgtype,$msgtext),IPC_NOWAIT)) { print "not "; $test2bad = 1; - } - } else { - unless (msgsnd($msg,pack("L a*",$msgtype,$msgtext),IPC_NOWAIT)) { - print "not "; - $test2bad = 1; - } } print "ok 2\n"; if ($test2bad) { @@ -135,11 +128,7 @@ EOM } my($rmsgtype,$rmsgtext); - if ($Config{'use64bitall'} eq 'define') { - (undef,$rmsgtype,$rmsgtext) = unpack("L L a*",$msgbuf) - } else { - ($rmsgtype,$rmsgtext) = unpack("L a*",$msgbuf) - } + ($rmsgtype,$rmsgtext) = unpack("L! a*",$msgbuf) unless($rmsgtype == $msgtype && $rmsgtext eq $msgtext) { print "not "; $test6bad = 1; |