From ed7668aa585fe38de621f919e1ee84c62cb56104 Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Sun, 6 Apr 2008 17:47:41 +0000 Subject: * 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 --- lib/OpenSLX/Syscall.pm | 45 ++++++++++++++++++++++++++++++++++++--------- 1 file changed, 36 insertions(+), 9 deletions(-) (limited to 'lib/OpenSLX/Syscall.pm') 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 + +Invokes the I syscall in order to enter the 32-bit personality +(C). + +=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; -- cgit v1.2.3-55-g7522