summaryrefslogtreecommitdiffstats
path: root/contrib/perl5/ext/IPC/SysV
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/perl5/ext/IPC/SysV')
-rw-r--r--contrib/perl5/ext/IPC/SysV/Msg.pm24
-rw-r--r--contrib/perl5/ext/IPC/SysV/Semaphore.pm14
-rw-r--r--contrib/perl5/ext/IPC/SysV/SysV.pm4
-rw-r--r--contrib/perl5/ext/IPC/SysV/SysV.xs10
-rw-r--r--contrib/perl5/ext/IPC/SysV/hints/cygwin.pl2
-rw-r--r--contrib/perl5/ext/IPC/SysV/hints/next_3.pl1
6 files changed, 31 insertions, 24 deletions
diff --git a/contrib/perl5/ext/IPC/SysV/Msg.pm b/contrib/perl5/ext/IPC/SysV/Msg.pm
index a739ca2..120a5b2 100644
--- a/contrib/perl5/ext/IPC/SysV/Msg.pm
+++ b/contrib/perl5/ext/IPC/SysV/Msg.pm
@@ -90,14 +90,14 @@ sub rcv {
msgrcv($$self,$buf,$_[1],$_[2] || 0, $_[3] || 0) or
return;
my $type;
- ($type,$_[0]) = unpack("L a*",$buf);
+ ($type,$_[0]) = unpack("l! a*",$buf);
$type;
}
sub snd {
@_ <= 4 && @_ >= 3 or croak '$msg->snd( TYPE, BUF, FLAGS )';
my $self = shift;
- msgsnd($$self,pack("L a*",$_[0],$_[1]), $_[2] || 0);
+ msgsnd($$self,pack("l! a*",$_[0],$_[1]), $_[2] || 0);
}
@@ -111,17 +111,17 @@ IPC::Msg - SysV Msg IPC object class
=head1 SYNOPSIS
- use IPC::SysV qw(IPC_PRIVATE S_IRWXU S_IRWXG S_IRWXO);
+ use IPC::SysV qw(IPC_PRIVATE S_IRWXU);
use IPC::Msg;
-
- $msg = new IPC::Msg(IPC_PRIVATE, S_IRWXU | S_IRWXG | S_IRWXO);
-
- $msg->snd(pack("L a*",$msgtype,$msg));
-
+
+ $msg = new IPC::Msg(IPC_PRIVATE, S_IRWXU);
+
+ $msg->snd(pack("l! a*",$msgtype,$msg));
+
$msg->rcv($buf,256);
-
+
$ds = $msg->stat;
-
+
$msg->remove;
=head1 DESCRIPTION
@@ -157,8 +157,8 @@ Returns the system message queue identifier.
=item rcv ( BUF, LEN [, TYPE [, FLAGS ]] )
-Read a message from the queue. Returns the type of the message read. See
-L<msgrcv>
+Read a message from the queue. Returns the type of the message read.
+See L<msgrcv>. The BUF becomes tainted.
=item remove
diff --git a/contrib/perl5/ext/IPC/SysV/Semaphore.pm b/contrib/perl5/ext/IPC/SysV/Semaphore.pm
index 464eb0b..faf7411 100644
--- a/contrib/perl5/ext/IPC/SysV/Semaphore.pm
+++ b/contrib/perl5/ext/IPC/SysV/Semaphore.pm
@@ -155,19 +155,19 @@ IPC::Semaphore - SysV Semaphore IPC object class
use IPC::SysV qw(IPC_PRIVATE S_IRWXU IPC_CREAT);
use IPC::Semaphore;
-
+
$sem = new IPC::Semaphore(IPC_PRIVATE, 10, S_IRWXU | IPC_CREAT);
-
+
$sem->setall( (0) x 10);
-
+
@sem = $sem->getall;
-
+
$ncnt = $sem->getncnt;
-
+
$zcnt = $sem->getzcnt;
-
+
$ds = $sem->stat;
-
+
$sem->remove;
=head1 DESCRIPTION
diff --git a/contrib/perl5/ext/IPC/SysV/SysV.pm b/contrib/perl5/ext/IPC/SysV/SysV.pm
index eb24593..bebb8fd 100644
--- a/contrib/perl5/ext/IPC/SysV/SysV.pm
+++ b/contrib/perl5/ext/IPC/SysV/SysV.pm
@@ -74,11 +74,15 @@ C<IPC::SysV> defines and conditionally exports all the constants
defined in your system include files which are needed by the SysV
IPC calls.
+=over
+
=item ftok( PATH, ID )
Return a key based on PATH and ID, which can be used as a key for
C<msgget>, C<semget> and C<shmget>. See L<ftok>
+=back
+
=head1 SEE ALSO
L<IPC::Msg>, L<IPC::Semaphore>, L<ftok>
diff --git a/contrib/perl5/ext/IPC/SysV/SysV.xs b/contrib/perl5/ext/IPC/SysV/SysV.xs
index ecd5270..38062e0 100644
--- a/contrib/perl5/ext/IPC/SysV/SysV.xs
+++ b/contrib/perl5/ext/IPC/SysV/SysV.xs
@@ -19,7 +19,7 @@
# endif
# include <sys/shm.h>
# ifndef HAS_SHMAT_PROTOTYPE
- extern Shmat_t shmat _((int, char *, int));
+ extern Shmat_t shmat (int, char *, int);
# endif
# if defined(__sparc__) && (defined(__NetBSD__) || defined(__OpenBSD__))
# undef SHMLBA /* not static: determined at boot time */
@@ -30,7 +30,7 @@
/* Required to get 'struct pte' for SHMLBA on ULTRIX. */
#if defined(__ultrix) || defined(__ultrix__) || defined(ultrix)
-# include <machine/pte.h>
+#include <machine/pte.h>
#endif
/* Required in BSDI to get PAGE_SIZE definition for SHMLBA.
@@ -69,7 +69,7 @@ PPCODE:
sv = *av_fetch(list,1,TRUE); ds.msg_perm.gid = SvIV(sv);
sv = *av_fetch(list,4,TRUE); ds.msg_perm.mode = SvIV(sv);
sv = *av_fetch(list,6,TRUE); ds.msg_qbytes = SvIV(sv);
- ST(0) = sv_2mortal(newSVpv((char *)&ds,sizeof(ds)));
+ ST(0) = sv_2mortal(newSVpvn((char *)&ds,sizeof(ds)));
XSRETURN(1);
#else
croak("System V msgxxx is not implemented on this machine");
@@ -185,7 +185,7 @@ PPCODE:
ds.sem_otime = SvIV(*sv_ptr);
if((sv_ptr = av_fetch(list,7,TRUE)) && (sv = *sv_ptr))
ds.sem_nsems = SvIV(*sv_ptr);
- ST(0) = sv_2mortal(newSVpv((char *)&ds,sizeof(ds)));
+ ST(0) = sv_2mortal(newSVpvn((char *)&ds,sizeof(ds)));
XSRETURN(1);
#else
croak("System V semxxx is not implemented on this machine");
@@ -203,7 +203,7 @@ ftok(path, id)
key_t k = ftok(path, id);
ST(0) = k == (key_t) -1 ? &PL_sv_undef : sv_2mortal(newSViv(k));
#else
- DIE(no_func, "ftok");
+ DIE(PL_no_func, "ftok");
#endif
int
diff --git a/contrib/perl5/ext/IPC/SysV/hints/cygwin.pl b/contrib/perl5/ext/IPC/SysV/hints/cygwin.pl
new file mode 100644
index 0000000..e1a1dea
--- /dev/null
+++ b/contrib/perl5/ext/IPC/SysV/hints/cygwin.pl
@@ -0,0 +1,2 @@
+# SysV IPC is an optional Cygwin package
+$self->{LIBS} = ['-lcygipc']
diff --git a/contrib/perl5/ext/IPC/SysV/hints/next_3.pl b/contrib/perl5/ext/IPC/SysV/hints/next_3.pl
new file mode 100644
index 0000000..2290ac7
--- /dev/null
+++ b/contrib/perl5/ext/IPC/SysV/hints/next_3.pl
@@ -0,0 +1 @@
+$self->{CCFLAGS} = $Config{ccflags} . ' -D_POSIX_SOURCE' ;
OpenPOWER on IntegriCloud