| 1 | ################################################################################ | ||||||||||
| 2 | # | ||||||||||
| 3 | # Version 2.x, Copyright (C) 2007-2013, Marcus Holland-Moritz <mhx@cpan.org>. | ||||||||||
| 4 | # Version 1.x, Copyright (C) 1997, Graham Barr <gbarr@pobox.com>. | ||||||||||
| 5 | # | ||||||||||
| 6 | # This program is free software; you can redistribute it and/or | ||||||||||
| 7 | # modify it under the same terms as Perl itself. | ||||||||||
| 8 | # | ||||||||||
| 9 | ################################################################################ | ||||||||||
| 10 | |||||||||||
| 11 | package IPC::SysV; | ||||||||||
| 12 | |||||||||||
| 13 | 5 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 14 | 5 | ▶ | use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $VERSION $AUTOLOAD); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 15 | 5 | ▶ | use Carp; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 16 | 5 | ▶ | use Config; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 17 | |||||||||||
| 18 | 5 | require Exporter; | |||||||||
| 19 | 5 | @ISA = qw(Exporter); | |||||||||
| 20 | |||||||||||
| 21 | 5 | $VERSION = '2.09'; | |||||||||
| 22 | |||||||||||
| 23 | # To support new constants, just add them to @EXPORT_OK | ||||||||||
| 24 | # and the C/XS code will be generated automagically. | ||||||||||
| 25 | 5 | @EXPORT_OK = (qw( | |||||||||
| 26 | |||||||||||
| 27 | GETALL GETNCNT GETPID GETVAL GETZCNT | ||||||||||
| 28 | |||||||||||
| 29 | IPC_ALLOC IPC_CREAT IPC_EXCL IPC_GETACL IPC_INFO IPC_LOCKED | ||||||||||
| 30 | IPC_M IPC_NOERROR IPC_NOWAIT IPC_PRIVATE IPC_R IPC_RMID | ||||||||||
| 31 | IPC_SET IPC_SETACL IPC_SETLABEL IPC_STAT IPC_W IPC_WANTED | ||||||||||
| 32 | |||||||||||
| 33 | MSG_EXCEPT MSG_FWAIT MSG_INFO MSG_LOCKED MSG_MWAIT MSG_NOERROR | ||||||||||
| 34 | MSG_QWAIT MSG_R MSG_RWAIT MSG_STAT MSG_W MSG_WAIT MSG_WWAIT | ||||||||||
| 35 | |||||||||||
| 36 | SEM_A SEM_ALLOC SEM_DEST SEM_ERR SEM_INFO SEM_ORDER SEM_R | ||||||||||
| 37 | SEM_STAT SEM_UNDO | ||||||||||
| 38 | |||||||||||
| 39 | SETALL SETVAL | ||||||||||
| 40 | |||||||||||
| 41 | SHMLBA | ||||||||||
| 42 | |||||||||||
| 43 | SHM_A SHM_CLEAR SHM_COPY SHM_DCACHE SHM_DEST SHM_ECACHE | ||||||||||
| 44 | SHM_FMAP SHM_HUGETLB SHM_ICACHE SHM_INFO SHM_INIT SHM_LOCK | ||||||||||
| 45 | SHM_LOCKED SHM_MAP SHM_NORESERVE SHM_NOSWAP SHM_R SHM_RDONLY | ||||||||||
| 46 | SHM_REMAP SHM_REMOVED SHM_RND SHM_SHARE_MMU SHM_SHATTR | ||||||||||
| 47 | SHM_SIZE SHM_STAT SHM_UNLOCK SHM_W | ||||||||||
| 48 | |||||||||||
| 49 | S_IRUSR S_IWUSR S_IXUSR S_IRWXU | ||||||||||
| 50 | S_IRGRP S_IWGRP S_IXGRP S_IRWXG | ||||||||||
| 51 | S_IROTH S_IWOTH S_IXOTH S_IRWXO | ||||||||||
| 52 | |||||||||||
| 53 | ENOSPC ENOSYS ENOMEM EACCES | ||||||||||
| 54 | |||||||||||
| 55 | ), qw( | ||||||||||
| 56 | |||||||||||
| 57 | ftok shmat shmdt memread memwrite | ||||||||||
| 58 | |||||||||||
| 59 | )); | ||||||||||
| 60 | |||||||||||
| 61 | 5 | %EXPORT_TAGS = ( | |||||||||
| 62 | all => [@EXPORT, @EXPORT_OK], | ||||||||||
| 63 | ); | ||||||||||
| 64 | |||||||||||
| 65 | sub AUTOLOAD | ||||||||||
| 66 | 30 | ▶ | { | ||||||||
|
Subroutine
AUTOLOAD: called CC=3 SCAR=11.3
| |||||||||||
| 67 | 30 | my $constname = $AUTOLOAD; | |||||||||
| 68 | 30 | $constname =~ s/.*:://; | |||||||||
| 69 | 30 | ▶ | die "&IPC::SysV::_constant not defined" if $constname eq '_constant'; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 70 | 30 | my ($error, $val) = _constant($constname); | |||||||||
| 71 | 30 | ▶ | if ($error) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 72 | 0 | my (undef, $file, $line) = caller; | |||||||||
| 73 | 0 | die "$error at $file line $line.\n"; | |||||||||
| 74 | } | ||||||||||
| 75 | { | ||||||||||
| 76 | 5 | ▶ | no strict 'refs'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 77 | 30 | ▶ | *$AUTOLOAD = sub { $val }; | ||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||
| 78 | } | ||||||||||
| 79 | 30 | goto &$AUTOLOAD; | |||||||||
| 80 | } | ||||||||||
| 81 | |||||||||||
| 82 | BOOT_XS: { | ||||||||||
| 83 | # If I inherit DynaLoader then I inherit AutoLoader and I DON'T WANT TO | ||||||||||
| 84 | 5 | ▶ | use XSLoader (); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 85 | |||||||||||
| 86 | 5 | XSLoader::load( 'IPC::SysV', $VERSION ); | |||||||||
| 87 | |||||||||||
| 88 | } | ||||||||||
| 89 | |||||||||||
| 90 | 5 | 1; | |||||||||
| 91 | |||||||||||
| 92 | __END__ | ||||||||||