version 1.20, 2002/03/07 22:58:45
|
version 1.27, 2003/01/25 14:38:58
|
|
|
//%///////////////////////////////////////////////////////////////////////////// | //%///////////////////////////////////////////////////////////////////////////// |
// | // |
// Copyright (c) 2000, 2001 The Open group, BMC Software, Tivoli Systems, IBM |
// Copyright (c) 2000, 2001, 2002 BMC Software, Hewlett-Packard Company, IBM, |
|
// The Open Group, Tivoli Systems |
// | // |
// 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 |
|
|
PEGASUS_NAMESPACE_BEGIN | PEGASUS_NAMESPACE_BEGIN |
| |
#include <windows.h> | #include <windows.h> |
|
#include <fcntl.h> |
#include <sys/types.h> | #include <sys/types.h> |
#include <time.h> | #include <time.h> |
#include <sys/timeb.h> | #include <sys/timeb.h> |
|
|
largeInt.QuadPart -= 0x19db1ded53e8000; | largeInt.QuadPart -= 0x19db1ded53e8000; |
seconds = long(largeInt.QuadPart / (10000 * 1000)); | seconds = long(largeInt.QuadPart / (10000 * 1000)); |
milliseconds = long((largeInt.QuadPart % (10000 * 1000)) / 10); | milliseconds = long((largeInt.QuadPart % (10000 * 1000)) / 10); |
|
// This is a real hack. Added the following line after timevalue was |
|
// corrected and this apparently wrong. ks 7 apri 2002 |
|
milliseconds = milliseconds / 1000; |
} | } |
| |
String System::getCurrentASCIITime() | String System::getCurrentASCIITime() |
|
|
return hostname; | return hostname; |
} | } |
| |
|
String System::getFullyQualifiedHostName () |
|
{ |
|
// |
|
// ATTN: Implement this method to return the fully qualified host name |
|
// |
|
return String::EMPTY; |
|
} |
|
|
|
String System::getSystemCreationClassName () |
|
{ |
|
// |
|
// ATTN: Implement this method to return the system creation class name |
|
// |
|
return String::EMPTY; |
|
} |
|
|
Uint32 System::lookupPort( | Uint32 System::lookupPort( |
const char * serviceName, | const char * serviceName, |
Uint32 defaultPort) | Uint32 defaultPort) |
|
|
return password; | return password; |
} | } |
| |
String System::getCurrentLoginName() |
String System::getEffectiveUserName() |
{ | { |
//ATTN: Implement this method to get the current login user name | //ATTN: Implement this method to get the current login user name |
// This is used in local authentication. | // This is used in local authentication. |
|
|
return (String("dummy")); | return (String("dummy")); |
} | } |
| |
Boolean System::isSystemUser(char* userName) |
Boolean System::isSystemUser(const char* userName) |
{ | { |
//ATTN: Implement this method to verify if user is vaild on the local system | //ATTN: Implement this method to verify if user is vaild on the local system |
// This is used in User Manager | // This is used in User Manager |
|
|
return _getpid(); | return _getpid(); |
} | } |
| |
|
Boolean System::truncateFile( |
|
const char* path, |
|
size_t newSize) |
|
{ |
|
int fd = open(path, O_RDWR); |
|
|
|
if (fd == -1) |
|
return false; |
|
|
|
if (chsize(fd, newSize) != 0) |
|
return false; |
|
|
|
close(fd); |
|
return true; |
|
} |
|
|
|
// Is absolute path? |
|
Boolean System::is_absolute_path(const char *path) |
|
{ |
|
char full[_MAX_PATH]; |
|
|
|
return (strcasecmp(_fullpath( full, path, _MAX_PATH ), path) == 0) ? true : false; |
|
} |
|
|
PEGASUS_NAMESPACE_END | PEGASUS_NAMESPACE_END |