Print this page
3900 illumos will not build against gcc compiled perl
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/cmd/perl/contrib/Sun/Solaris/Exacct/Exacct.pm
+++ new/usr/src/cmd/perl/contrib/Sun/Solaris/Exacct/Exacct.pm
1 1 #
2 2 # Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved.
3 3 #
4 4
5 5 #
6 6 # Exacct.pm contains wrappers for the exacct error functions and syscalls,
7 7 # and some 'shorthand' convenience functions.
8 8 #
9 9
10 -require 5.8.4;
10 +require 5.0010;
11 11 use strict;
12 12 use warnings;
13 13
14 14 package Sun::Solaris::Exacct;
15 15
16 16 our $VERSION = '1.5';
17 17 use XSLoader;
18 18 XSLoader::load(__PACKAGE__, $VERSION);
19 19
20 20 # @_Constants is set up by the XSUB bootstrap() function.
21 21 our (@EXPORT_OK, %EXPORT_TAGS, @_Constants);
22 22 my @syscalls = qw(getacct putacct wracct);
23 23 my @libcalls = qw(ea_error ea_error_str);
24 24 my @shorthand = qw(ea_register_catalog ea_new_catalog ea_new_file ea_new_item
25 25 ea_new_group ea_dump_object);
26 26 @EXPORT_OK = (@_Constants, @syscalls, @libcalls, @shorthand);
27 27 %EXPORT_TAGS = (CONSTANTS => \@_Constants, SYSCALLS => \@syscalls,
28 28 LIBCALLS => \@libcalls, SHORTHAND => \@shorthand, ALL => \@EXPORT_OK);
29 29
30 30 use base qw(Exporter);
31 31
32 32 #
33 33 # Extend the default Exporter::import to do optional inclusion of all the
34 34 # lower-level Exacct modules. Any export tag prefixed with 'EXACCT_' is
35 35 # interpreted as a request to import that tag from all the Exacct modules.
36 36 #
37 37 sub import
38 38 {
39 39 my (@my_tags, %sub_tags);
40 40 shift(@_);
41 41 foreach my $tag (@_) {
42 42 # Note: Modifies @_
43 43 if ($tag =~ /^:EXACCT_(.*)$/) {
44 44 my $new_tag = ":$1";
45 45 push(@my_tags, $new_tag);
46 46 $sub_tags{$new_tag} = 1;
47 47 } else {
48 48 push(@my_tags, $tag);
49 49 }
50 50 }
51 51
52 52 # Export the taglist with all "EXACCT_" prefixes removed.
53 53 __PACKAGE__->export_to_level(1, undef, @my_tags);
54 54
55 55 # Do sub-module imports if required.
56 56 if (@my_tags = grep(exists($sub_tags{$_}), qw(:ALL :CONSTANTS))) {
57 57
58 58 # ::Catalog
59 59 require Sun::Solaris::Exacct::Catalog;
60 60 Sun::Solaris::Exacct::Catalog->export_to_level(1, undef,
61 61 @my_tags);
62 62
63 63 # ::File and Fcntl
64 64 require Sun::Solaris::Exacct::File;
65 65 Sun::Solaris::Exacct::File->export_to_level(1, undef,
66 66 @my_tags);
67 67 require Fcntl;
68 68 Fcntl->export_to_level(1, undef, ':DEFAULT');
69 69
70 70 # ::Object
71 71 require Sun::Solaris::Exacct::Object;
72 72 Sun::Solaris::Exacct::Object->export_to_level(1, undef,
73 73 @my_tags);
74 74 }
75 75 }
76 76
77 77 #
78 78 # Convenience functions - shorthand for fully qualified method names. Note that
79 79 # goto() is used to call the methods so that any errors will appear to come
80 80 # from the correct place. Because goto() does not understand method call syntax
81 81 # it is necessary to fake up the class a parameter by unshifting the appropriate
82 82 # class name onto the argument lists.
83 83 #
84 84
85 85 sub ea_register_catalog
86 86 {
87 87 unshift(@_, 'Sun::Solaris::Exacct::Catalog');
88 88 goto(&Sun::Solaris::Exacct::Catalog::register);
89 89 }
90 90
91 91 sub ea_new_catalog
92 92 {
93 93 unshift(@_, 'Sun::Solaris::Exacct::Catalog');
94 94 goto(&Sun::Solaris::Exacct::Catalog::new);
95 95 }
96 96
97 97 sub ea_new_file
98 98 {
99 99 unshift(@_, 'Sun::Solaris::Exacct::File');
100 100 goto(&Sun::Solaris::Exacct::File::new);
101 101 }
102 102
103 103 sub ea_new_item
104 104 {
105 105 unshift(@_, 'Sun::Solaris::Exacct::Item');
106 106 goto(&Sun::Solaris::Exacct::Object::Item::new);
107 107 }
108 108
109 109 sub ea_new_group
110 110 {
111 111 unshift(@_, 'Sun::Solaris::Exacct::Group');
112 112 goto(&Sun::Solaris::Exacct::Object::Group::new);
113 113 }
114 114
115 115 sub ea_dump_object
116 116 {
117 117 unshift(@_, 'Sun::Solaris::Exacct::Object');
118 118 goto(&Sun::Solaris::Exacct::Object::dump);
119 119 }
120 120
121 121 1;
↓ open down ↓ |
101 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX