File Coverage

lib/POSIX/1003/Proc.pm
Criterion Covered Total %
statement 18 29 62.0
branch n/a
condition n/a
subroutine 6 17 35.2
pod 8 9 88.8
total 32 55 58.1


line stmt bran cond sub pod time code
1             # Copyrights 2011-2015 by [Mark Overmeer].
2             # For other contributors see ChangeLog.
3             # See the manual pages for details on the licensing terms.
4             # Pod stripped from pm file by OODoc 2.01.
5 3     3   17468 use warnings;
  3         6  
  3         89  
6 3     3   11 use strict;
  3         3  
  3         110  
7              
8             package POSIX::1003::Proc;
9 3     3   10 use vars '$VERSION';
  3         4  
  3         127  
10             $VERSION = '0.99_06';
11              
12 3     3   9 use base 'POSIX::1003::Module';
  3         3  
  3         552  
13              
14             my @constants;
15             my @functions = qw/
16             abort
17              
18             WEXITSTATUS WIFEXITED WIFSIGNALED WIFSTOPPED
19             WSTOPSIG WTERMSIG
20              
21             _exit pause setpgid setsid tcgetpgrp tcsetpgrp
22             ctermid cuserid getcwd nice
23             /;
24              
25             our @IN_CORE = qw/wait waitpid/;
26             push @functions, @IN_CORE;
27              
28             our %EXPORT_TAGS =
29             ( constants => \@constants
30             , functions => \@functions
31             , tables => [ '%proc' ]
32             );
33              
34             my $proc;
35             our %proc;
36              
37             BEGIN {
38 3     3   25 $proc = proc_table;
39 3         9 push @constants, keys %$proc;
40 3         16 tie %proc, 'POSIX::1003::ReadOnlyTable', $proc;
41             }
42              
43              
44             # When the next where automatically imported from POSIX, they are
45             # considered constant and therefore without parameter. Therefore,
46             # these are linked explicitly.
47             *WIFEXITED = \&POSIX::WIFEXITED;
48             *WIFSIGNALED = \&POSIX::WIFSIGNALED;
49             *WIFSTOPPED = \&POSIX::WIFSTOPPED;
50             *WEXITSTATUS = \&POSIX::WEXITSTATUS;
51             *WTERMSIG = \&POSIX::WTERMSIG;
52             *WSTOPSIG = \&POSIX::WSTOPSIG;
53              
54             #-------------------------------------
55              
56 0     0 1 0 sub cuserid() {goto &POSIX::cuserid}
57 0     0 1 0 sub ctermid() {goto &POSIX::ctermid}
58 0     0   0 sub _exit($) {goto &POSIX::_exit}
59 0     0 1 0 sub pause() {goto &POSIX::pause}
60 0     0 1 0 sub setpgid($$) {goto &POSIX::setpgid}
61 0     0 1 0 sub setsid() {goto &POSIX::setsid}
62 0     0 0 0 sub cgetpgrp($) {goto &POSIX::cgetpgrp}
63 0     0 1 0 sub tcsetpgrp($$) {goto &POSIX::tcsetpgrp}
64              
65              
66 0     0 1 0 sub nice($) {goto &POSIX::nice}
67              
68              
69 0     0 1 0 sub times5() {goto &POSIX::times}
70              
71              
72             sub _create_constant($)
73 4     4   3 { my ($class, $name) = @_;
74 4         7 my $val = $proc->{$name};
75 4     0   27 sub() {$val};
  0            
76             }
77              
78             1;