FAQ
In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/38e3b244f46695a70f41e8f8af02147747dff6bf?hp=0172e63ff9dbdedac30a79ff56b7e0299d8d8b71>

- Log -----------------------------------------------------------------
commit 38e3b244f46695a70f41e8f8af02147747dff6bf
Author: Jarkko Hietaniemi <jhi@iki.fi>
Date: Wed Feb 17 21:04:18 2016 -0500

     Upgrade to IPC-SysV 2.05.
-----------------------------------------------------------------------

Summary of changes:
  cpan/IPC-SysV/SysV.xs | 12 ++++++++----
  cpan/IPC-SysV/lib/IPC/Msg.pm | 6 +++---
  cpan/IPC-SysV/lib/IPC/Semaphore.pm | 10 ++++++----
  cpan/IPC-SysV/lib/IPC/SharedMem.pm | 6 +++---
  cpan/IPC-SysV/lib/IPC/SysV.pm | 10 +++++-----
  cpan/IPC-SysV/t/ipcsysv.t | 4 +++-
  6 files changed, 28 insertions(+), 20 deletions(-)

diff --git a/cpan/IPC-SysV/SysV.xs b/cpan/IPC-SysV/SysV.xs
index c7db50a..121a164 100644
--- a/cpan/IPC-SysV/SysV.xs
+++ b/cpan/IPC-SysV/SysV.xs
@@ -392,10 +392,14 @@ shmat(id, addr, flag)
      int flag
    CODE:
  #ifdef HAS_SHM
- void *caddr = SvOK(addr) ? sv2addr(addr) : NULL;
- void *shm = (void *) shmat(id, caddr, flag);
- ST(0) = shm == (void *) -1 ? &PL_sv_undef
- : sv_2mortal(newSVpvn((char *) &shm, sizeof(void *)));
+ if (id >= 0) {
+ void *caddr = SvOK(addr) ? sv2addr(addr) : NULL;
+ void *shm = (void *) shmat(id, caddr, flag);
+ ST(0) = shm == (void *) -1 ? &PL_sv_undef
+ : sv_2mortal(newSVpvn((char *) &shm, sizeof(void *)));
+ } else {
+ ST(0) = &PL_sv_undef;
+ }
      XSRETURN(1);
  #else
      Perl_die(aTHX_ PL_no_func, "shmat"); return;
diff --git a/cpan/IPC-SysV/lib/IPC/Msg.pm b/cpan/IPC-SysV/lib/IPC/Msg.pm
index f4cf099..c2539a4 100644
--- a/cpan/IPC-SysV/lib/IPC/Msg.pm
+++ b/cpan/IPC-SysV/lib/IPC/Msg.pm
@@ -15,7 +15,7 @@ use strict;
  use vars qw($VERSION);
  use Carp;

-$VERSION = '2.04';
+$VERSION = '2.05';

  # Figure out if we have support for native sized types
  my $N = do { my $foo = eval { pack "L!", 0 }; $@ ? '' : '!' };
@@ -169,7 +169,7 @@ 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>. The BUF becomes tainted.
+See L<msgrcv(2)>. The BUF becomes tainted.

  =item remove

@@ -193,7 +193,7 @@ or a list of I<name>-I<value> pairs.
  =item snd ( TYPE, MSG [, FLAGS ] )

  Place a message on the queue with the data from C<MSG> and with type C<TYPE>.
-See L<msgsnd>.
+See L<msgsnd(2)>.

  =item stat

diff --git a/cpan/IPC-SysV/lib/IPC/Semaphore.pm b/cpan/IPC-SysV/lib/IPC/Semaphore.pm
index 3bcbfe7..7ff6fbc 100644
--- a/cpan/IPC-SysV/lib/IPC/Semaphore.pm
+++ b/cpan/IPC-SysV/lib/IPC/Semaphore.pm
@@ -16,7 +16,7 @@ use strict;
  use vars qw($VERSION);
  use Carp;

-$VERSION = '2.04';
+$VERSION = '2.05';

  # Figure out if we have support for native sized types
  my $N = do { my $foo = eval { pack "L!", 0 }; $@ ? '' : '!' };
@@ -56,7 +56,9 @@ sub id {

  sub remove {
      my $self = shift;
- (semctl($$self,0,IPC_RMID,0), undef $$self)[0];
+ my $result = semctl($$self,0,IPC_RMID,0);
+ undef $$self;
+ $result;
  }

  sub getncnt {
@@ -240,7 +242,7 @@ Returns the system identifier for the semaphore set.
  C<OPLIST> is a list of operations to pass to C<semop>. C<OPLIST> is
  a concatenation of smaller lists, each which has three values. The
  first is the semaphore number, the second is the operation and the last
-is a flags value. See L<semop> for more details. For example
+is a flags value. See L<semop(2)> for more details. For example

      $sem->op(
   0, -1, IPC_NOWAIT,
@@ -293,7 +295,7 @@ of these fields see your system documentation.

  =head1 SEE ALSO

-L<IPC::SysV>, L<Class::Struct>, L<semget>, L<semctl>, L<semop>
+L<IPC::SysV>, L<Class::Struct>, L<semget(2)>, L<semctl(2)>, L<semop(2)>

  =head1 AUTHORS

diff --git a/cpan/IPC-SysV/lib/IPC/SharedMem.pm b/cpan/IPC-SysV/lib/IPC/SharedMem.pm
index 84f718b..eadb3fc 100644
--- a/cpan/IPC-SysV/lib/IPC/SharedMem.pm
+++ b/cpan/IPC-SysV/lib/IPC/SharedMem.pm
@@ -15,7 +15,7 @@ use strict;
  use vars qw($VERSION);
  use Carp;

-$VERSION = '2.04';
+$VERSION = '2.05';

  # Figure out if we have support for native sized types
  my $N = do { my $foo = eval { pack "L!", 0 }; $@ ? '' : '!' };
@@ -235,12 +235,12 @@ of these fields see you system documentation.
  Permanently attach to the shared memory segment. When a C<IPC::SharedMem>
  object is attached, it will use L<memread> and L<memwrite> instead of
  L<shmread> and L<shmwrite> for accessing the shared memory segment.
-Returns true if successful, or false on error. See L<shmat>.
+Returns true if successful, or false on error. See L<shmat(2)>.

  =item detach

  Detach from the shared memory segment that previously has been attached
-to. Returns true if successful, or false on error. See L<shmdt>.
+to. Returns true if successful, or false on error. See L<shmdt(2)>.

  =item addr

diff --git a/cpan/IPC-SysV/lib/IPC/SysV.pm b/cpan/IPC-SysV/lib/IPC/SysV.pm
index 4189965..883c755 100644
--- a/cpan/IPC-SysV/lib/IPC/SysV.pm
+++ b/cpan/IPC-SysV/lib/IPC/SysV.pm
@@ -18,7 +18,7 @@ use Config;
  require Exporter;
  @ISA = qw(Exporter);

-$VERSION = '2.04';
+$VERSION = '2.05';

  # To support new constants, just add them to @EXPORT_OK
  # and the C/XS code will be generated automagically.
@@ -129,7 +129,7 @@ but your system might have more.
  =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>.
+C<msgget>, C<semget> and C<shmget>. See L<ftok(3)>.

  If ID is omitted, it defaults to C<1>. If a single character is
  given for ID, the numeric value of that character is used.
@@ -137,14 +137,14 @@ given for ID, the numeric value of that character is used.
  =item shmat( ID, ADDR, FLAG )

  Attach the shared memory segment identified by ID to the address
-space of the calling process. See L<shmat>.
+space of the calling process. See L<shmat(2)>.

  ADDR should be C<undef> unless you really know what you're doing.

  =item shmdt( ADDR )

  Detach the shared memory segment located at the address specified
-by ADDR from the address space of the calling process. See L<shmdt>.
+by ADDR from the address space of the calling process. See L<shmdt(2)>.

  =item memread( ADDR, VAR, POS, SIZE )

@@ -163,7 +163,7 @@ successful, or false if there is an error.

  =head1 SEE ALSO

-L<IPC::Msg>, L<IPC::Semaphore>, L<IPC::SharedMem>, L<ftok>, L<shmat>, L<shmdt>
+L<IPC::Msg>, L<IPC::Semaphore>, L<IPC::SharedMem>, L<ftok(3)>, L<shmat(2)>, L<shmdt(2)>

  =head1 AUTHORS

diff --git a/cpan/IPC-SysV/t/ipcsysv.t b/cpan/IPC-SysV/t/ipcsysv.t
index 710555e..c7a92ed 100644
--- a/cpan/IPC-SysV/t/ipcsysv.t
+++ b/cpan/IPC-SysV/t/ipcsysv.t
@@ -24,7 +24,7 @@ elsif ($Config{'d_msg'} ne 'define') {
    plan(skip_all => '$Config{d_msg} undefined');
  }

-plan(tests => 38);
+plan(tests => 39);

  # These constants are common to all tests.
  # Later the sem* tests will import more for themselves.
@@ -298,6 +298,8 @@ SKIP: {

    is(unpack("N", unpack("P4", $addr)), 0xbadc0de5, 'read modified shm by addr');

+ is(shmat(-1, undef, 0), undef, 'shmat illegal id fails');
+
    ok(defined shmdt($addr), 'shmdt');
  }


--
Perl5 Master Repository

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 1 | next ›
Discussion Overview
groupperl5-changes @
categoriesperl
postedFeb 20, '16 at 2:16a
activeFeb 20, '16 at 2:16a
posts1
users1
websiteperl.org

1 user in discussion

Jarkko Hietaniemi: 1 post

People

Translate

site design / logo © 2017 Grokbase