diff options
author | Oliver Tappe | 2008-04-06 19:47:41 +0200 |
---|---|---|
committer | Oliver Tappe | 2008-04-06 19:47:41 +0200 |
commit | ed7668aa585fe38de621f919e1ee84c62cb56104 (patch) | |
tree | 542a547045422f145751548ca88b3cb702d834af /lib/OpenSLX/Syscall.pm | |
parent | * made names of distro module consistent across OpenSLX - now the always star... (diff) | |
download | core-ed7668aa585fe38de621f919e1ee84c62cb56104.tar.gz core-ed7668aa585fe38de621f919e1ee84c62cb56104.tar.xz core-ed7668aa585fe38de621f919e1ee84c62cb56104.zip |
* added PODs to all Perl-modules in lib, documenting those functions that are meant
to be used by other OpenSLX components (i.e. scripts and plugins)
* applied minor cleanups and convenience extensions to a couple of functions
git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@1722 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'lib/OpenSLX/Syscall.pm')
-rw-r--r-- | lib/OpenSLX/Syscall.pm | 45 |
1 files changed, 36 insertions, 9 deletions
diff --git a/lib/OpenSLX/Syscall.pm b/lib/OpenSLX/Syscall.pm index 5d82a361..a46d9ac6 100644 --- a/lib/OpenSLX/Syscall.pm +++ b/lib/OpenSLX/Syscall.pm @@ -18,8 +18,42 @@ use warnings; our $VERSION = 1.01; +=head1 NAME + +OpenSLX::Syscall - provides wrapper functions for syscalls. + +=head1 DESCRIPTION + +This module exports one wrapper function for each syscall that OpenSLX is +using. Each of these functions takes care to load all required Perl-headers +before trying to invoke the respective syscall. + +=cut + use OpenSLX::Basics; +=head1 PUBLIC FUNCTIONS + +=over + +=item B<enter32BitPersonality()> + +Invokes the I<personality()> syscall in order to enter the 32-bit personality +(C<PER_LINUX32>). + +=cut + +sub enter32BitPersonality +{ + _loadPerlHeader('syscall.ph'); + _loadPerlHeader('linux/personality.ph', 'sys/personality.ph'); + + syscall(&SYS_personality, PER_LINUX32()) != -1 + or warn _tr("unable to invoke syscall '%s'! ($!)", 'personality'); + + return; +} + sub _loadPerlHeader { my @phFiles = @_; @@ -42,15 +76,8 @@ sub _loadPerlHeader ); } -sub enter32BitPersonality -{ - _loadPerlHeader('syscall.ph'); - _loadPerlHeader('linux/personality.ph', 'sys/personality.ph'); +=back - syscall(&SYS_personality, PER_LINUX32()) != -1 - or warn _tr("unable to invoke syscall '%s'! ($!)", 'personality'); - - return; -} +=cut 1; |