Environment.hpp
#if !defined(__ENVIRONMENT_HPP)
#define __ENVIRONMENT_HPP
/*
CoreLinux++
Copyright (C) 1999,2000 CoreLinux Consortium
The CoreLinux++ Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The CoreLinux++ Library Library is distributed in the hope that it will
be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#if !defined IN_COMMON_HPP
#error Environment.hpp is included by Common.hpp only.
#endif
namespace corelinux
{
DECLARE_CLASS(Environment);
class Environment
{
public:
inline bool operator==( EnvironmentCref ) const
{
return true;
}
//
// Accessors
//
static UserIdentifier getUserId( void );
static UserIdentifier getEffectiveUserId( void );
static GroupIdentifier getGroupId( void );
static GroupIdentifier getEffectiveGroupId( void );
static CharPtr getEnvironmentValue( CharCptr );
//
// Mutators
//
static Int setEnvironmentNameValue( CharPtr );
//
// Functions for library
//
static Int setupCommonAccess( CharCptr, const CreateDisposition & );
static Int removeCommonAccess( CharCptr );
static ProcessIdentifier getProcessGroupId( void );
static ProcessIdentifier getProcessGroupId( ProcessIdentifierRef );
static void setThreadPriority( ProcessIdentifier, Int );
static Int getThreadPriority( ProcessIdentifier );
protected:
Environment( void ) throw (Assertion)
{
NEVER_GET_HERE;
}
Environment( EnvironmentCref )
throw (Assertion)
{
NEVER_GET_HERE;
}
EnvironmentRef operator=( EnvironmentCref )
throw (Assertion)
{
NEVER_GET_HERE;
return (*this);
}
private:
};
}
#endif
/*
Common rcs information do not modify
$Author: dulimart $
$Revision: 1.4 $
$Date: 2001/03/20 04:06:00 $
$Locker: $
*/
corelinux::Environment::setThreadPriority
static void setThreadPriority(ProcessIdentifier, Int)
set priority for a specific process
Definition: Environment.cpp:206
corelinux::Environment::getThreadPriority
static Int getThreadPriority(ProcessIdentifier)
get priority for a specific process
Definition: Environment.cpp:211
corelinux::Environment::getProcessGroupId
static ProcessIdentifier getProcessGroupId(void)
Retrieve the process group id for the current process.
Definition: Environment.cpp:72
corelinux::Environment::setEnvironmentNameValue
static Int setEnvironmentNameValue(CharPtr)
Sets an environment name=value.
Definition: Environment.cpp:93
corelinux::Environment::removeCommonAccess
static Int removeCommonAccess(CharCptr)
The reverse of setupCommonAccess.
Definition: Environment.cpp:187
corelinux::Environment::getEffectiveUserId
static UserIdentifier getEffectiveUserId(void)
Retreive the effective user id for the current process.
Definition: Environment.cpp:51
corelinux::CreateDisposition
CreateDisposition
Creation dispositions for various system utilities.
Definition: AccessRights.hpp:63
corelinux::ScalarIdentifier
ScalarIdentifier provides a templated interface for declaring CoreLinux Identifiers for simple scalar...
Definition: ScalarIdentifiers.hpp:37
corelinux::Environment
Environment is a class utility which encapsulates.
Definition: Environment.hpp:37
corelinux::Environment::getUserId
static UserIdentifier getUserId(void)
Retreive the real user id for the current process.
Definition: Environment.cpp:44
corelinux::Environment::setupCommonAccess
static Int setupCommonAccess(CharCptr, const CreateDisposition &)
Basically, creates a filename for use by those Linux system api that require a key (IPC mainly)...
Definition: Environment.cpp:103
corelinux::Assertion
Assertion is-a Exception created when an assertion fails.
Definition: Assertion.hpp:423
corelinux::Environment::getEnvironmentValue
static CharPtr getEnvironmentValue(CharCptr)
Retrieve the environmental value variable from the (name=value) pair.
Definition: Environment.cpp:86
corelinux::Environment::getGroupId
static GroupIdentifier getGroupId(void)
Retreive the real group id for the current process.
Definition: Environment.cpp:58
corelinux::Environment::operator==
bool operator==(EnvironmentCref) const
Equality operator.
Definition: Environment.hpp:43
corelinux::Environment::getEffectiveGroupId
static GroupIdentifier getEffectiveGroupId(void)
Retreive the effective group id for the current process.
Definition: Environment.cpp:65

This is the CoreLinux++ reference manual
Provided by The CoreLinux Consortium