From: Michael G Schwern Date: Thu, 2 Mar 2000 17:15:03 +0000 (-0500) Subject: The SysV IPC test must use the native integers X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e4038a1fb4fdfabe2578d9a8ffe81a18bec6013d;p=p5sagit%2Fp5-mst-13.2.git 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 --- diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index 081709a..758b573 100644 --- a/pod/perlfunc.pod +++ b/pod/perlfunc.pod @@ -2462,10 +2462,10 @@ and C 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. Returns true if -successful, or false if there is an error. See also C -and C documentation. +message queue ID. MSG must begin with the native long integer message +type, which may be created with C. Returns true if +successful, or false if there is an error. See also C and +C documentation. =item msgrcv ID,VAR,SIZE,TYPE,FLAGS @@ -3874,9 +3874,11 @@ Calls the System V IPC function C. 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: the -undefined value for error, "C<0 but true>" for zero, or the actual return -value otherwise. See also C and C documentation. +semid_ds structure or semaphore value array. Returns like C: +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. +See also C and C documentation. =item semget KEY,NSEMS,FLAGS diff --git a/t/lib/ipc_sysv.t b/t/lib/ipc_sysv.t index 55d9ba1..8485d5d 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;