| 1 | package Linux::Perl::uname; | ||||||||||
| 2 | |||||||||||
| 3 | =encoding utf-8 | ||||||||||
| 4 | |||||||||||
| 5 | =head1 NAME | ||||||||||
| 6 | |||||||||||
| 7 | Linux::Perl::uname | ||||||||||
| 8 | |||||||||||
| 9 | =head1 SYNOPSIS | ||||||||||
| 10 | |||||||||||
| 11 | my @parts = Linux::Perl::uname->uname(); | ||||||||||
| 12 | |||||||||||
| 13 | my @parts = Linux::Perl::uname::x86_64->uname(); | ||||||||||
| 14 | |||||||||||
| 15 | =head1 DESCRIPTION | ||||||||||
| 16 | |||||||||||
| 17 | This module returns the list of strings from the C<uname> system call. | ||||||||||
| 18 | See C<man 2 uname> for the specifics of what that means. | ||||||||||
| 19 | |||||||||||
| 20 | =cut | ||||||||||
| 21 | |||||||||||
| 22 | 3 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 23 | 3 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 24 | |||||||||||
| 25 | 3 | ▶ | use Call::Context; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 26 | 3 | ▶ | use Linux::Perl; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 27 | |||||||||||
| 28 | 3 | ▶ | use constant BUFFER_SIZE => 257 * 6; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 29 | |||||||||||
| 30 | sub uname { | ||||||||||
| 31 | 2 | ▶ | my ($class) = @_; | ||||||||
|
Subroutine
uname: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||
| 32 | |||||||||||
| 33 | 2 | Call::Context::must_be_list(); | |||||||||
| 34 | |||||||||||
| 35 | 2 | ▶ | if (!$class->can('NR_uname')) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 36 | 1 | require Linux::Perl::ArchLoader; | |||||||||
| 37 | 1 | $class = Linux::Perl::ArchLoader::get_arch_module($class); | |||||||||
| 38 | } | ||||||||||
| 39 | |||||||||||
| 40 | 2 | my $buf = ("\0" x BUFFER_SIZE); | |||||||||
| 41 | 2 | Linux::Perl::call( $class->NR_uname(), $buf ); | |||||||||
| 42 | |||||||||||
| 43 | 2 | return split m<\0+>, $buf; | |||||||||
| 44 | } | ||||||||||
| 45 | |||||||||||
| 46 | 3 | 1; | |||||||||