version 1.25, 2002/02/23 00:27:20
|
version 1.26, 2002/03/07 22:58:45
|
|
|
#include <netdb.h> | #include <netdb.h> |
#include <Pegasus/Common/Tracer.h> | #include <Pegasus/Common/Tracer.h> |
#include <Pegasus/Common/Destroyer.h> | #include <Pegasus/Common/Destroyer.h> |
|
#include <Pegasus/Common/Exception.h> |
| |
#ifdef PEGASUS_PLATFORM_LINUX_IX86_GNU | #ifdef PEGASUS_PLATFORM_LINUX_IX86_GNU |
#include <pwd.h> | #include <pwd.h> |
|
|
} | } |
} | } |
| |
|
String System::getPrivilegedUserName() |
|
{ |
|
static String userName = String::EMPTY; |
|
|
|
if (userName == String::EMPTY) |
|
{ |
|
struct passwd* pwd = NULL; |
|
|
|
// |
|
// get the privileged user's UID. |
|
// |
|
pwd = getpwuid(0); |
|
if ( pwd != NULL ) |
|
{ |
|
// |
|
// get the user name |
|
// |
|
userName.assign(pwd->pw_name); |
|
} |
|
else |
|
{ |
|
PEGASUS_ASSERT(0); |
|
} |
|
} |
|
|
|
return (userName); |
|
} |
|
|
Uint32 System::getPID() | Uint32 System::getPID() |
{ | { |
// | // |