version 1.86, 2004/06/28 23:12:51
|
version 1.92, 2004/10/17 20:39:17
|
|
|
//%2003//////////////////////////////////////////////////////////////////////// |
//%2004//////////////////////////////////////////////////////////////////////// |
// | // |
// Copyright (c) 2000, 2001, 2002 BMC Software, Hewlett-Packard Development |
// Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development |
// Company, L. P., IBM Corp., The Open Group, Tivoli Systems. |
// Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems. |
// Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L. P.; | // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L. P.; |
// IBM Corp.; EMC Corporation, The Open Group. | // IBM Corp.; EMC Corporation, The Open Group. |
|
// Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.; |
|
// IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group. |
// | // |
// Permission is hereby granted, free of charge, to any person obtaining a copy | // Permission is hereby granted, free of charge, to any person obtaining a copy |
// of this software and associated documentation files (the "Software"), to | // of this software and associated documentation files (the "Software"), to |
|
|
// Bapu Patil (bapu_patil@hp.com) | // Bapu Patil (bapu_patil@hp.com) |
// | // |
// Modified By: Dave Rosckes (rosckes@us.ibm.com) | // Modified By: Dave Rosckes (rosckes@us.ibm.com) |
|
// Amit K Arora (amita@in.ibm.com) for PEP101 |
// | // |
//%///////////////////////////////////////////////////////////////////////////// | //%///////////////////////////////////////////////////////////////////////////// |
| |
|
|
#include <netdb.h> | #include <netdb.h> |
#include "System.h" | #include "System.h" |
#include <Pegasus/Common/Tracer.h> | #include <Pegasus/Common/Tracer.h> |
#include <Pegasus/Common/Destroyer.h> |
|
#include <Pegasus/Common/InternalException.h> | #include <Pegasus/Common/InternalException.h> |
#ifdef PEGASUS_ZOS_SECURITY | #ifdef PEGASUS_ZOS_SECURITY |
#include "DynamicLibraryzOS_inline.h" | #include "DynamicLibraryzOS_inline.h" |
|
|
{ | { |
char str[50]; | char str[50]; |
time_t rawTime; | time_t rawTime; |
|
struct tm tmBuffer; |
| |
time(&rawTime); | time(&rawTime); |
strftime(str, 40,"%m/%d/%Y-%T", localtime(&rawTime)); |
strftime(str, 40,"%m/%d/%Y-%T", localtime_r(&rawTime, &tmBuffer)); |
String time = str; |
return String(str); |
return time; |
|
} | } |
| |
void System::sleep(Uint32 seconds) | void System::sleep(Uint32 seconds) |
|
|
| |
String System::getFullyQualifiedHostName () | String System::getFullyQualifiedHostName () |
{ | { |
#ifdef PEGASUS_OS_HPUX |
#if defined(PEGASUS_OS_HPUX) || defined(PEGASUS_OS_AIX) || defined(PEGASUS_OS_LINUX) |
char hostName [PEGASUS_MAXHOSTNAMELEN]; | char hostName [PEGASUS_MAXHOSTNAMELEN]; |
struct hostent *he; | struct hostent *he; |
String fqName; | String fqName; |
|
|
return String::EMPTY; | return String::EMPTY; |
} | } |
| |
if (he = gethostbyname (hostName)) |
if ((he = gethostbyname (hostName))) |
{ | { |
strcpy (hostName, he->h_name); | strcpy (hostName, he->h_name); |
} | } |
|
|
| |
String System::getSystemCreationClassName () | String System::getSystemCreationClassName () |
{ | { |
#ifdef PEGASUS_OS_HPUX |
// |
|
// The value returned should match the value of the CreationClassName key |
|
// property used in the instrumentation of the CIM_ComputerSystem class |
|
// as determined by the provider for the CIM_ComputerSystem class |
|
// |
|
#if defined(PEGASUS_OS_HPUX) || defined(PEGASUS_OS_LINUX) |
return "CIM_ComputerSystem"; | return "CIM_ComputerSystem"; |
#else | #else |
// | // |