version 1.101, 2005/03/30 12:57:58
|
version 1.102, 2005/04/17 15:47:15
|
|
|
| |
String System::getFullyQualifiedHostName () | String System::getFullyQualifiedHostName () |
{ | { |
#if defined(PEGASUS_OS_HPUX) || defined(PEGASUS_OS_AIX) || defined(PEGASUS_OS_LINUX) |
#if defined(PEGASUS_OS_HPUX) || defined(PEGASUS_OS_AIX) || defined(PEGASUS_OS_LINUX) || defined(PEGASUS_OS_OS400) |
char hostName [PEGASUS_MAXHOSTNAMELEN]; | char hostName [PEGASUS_MAXHOSTNAMELEN]; |
struct hostent *he; | struct hostent *he; |
String fqName; | String fqName; |
|
|
strcpy (hostName, he->h_name); | strcpy (hostName, he->h_name); |
} | } |
| |
|
#if defined(PEGASUS_OS_OS400) |
|
EtoA(hostName); |
|
#endif |
|
|
fqName.assign (hostName); | fqName.assign (hostName); |
| |
return fqName; | return fqName; |
|
|
struct servent_data buf; | struct servent_data buf; |
memset(&buf, 0x00, sizeof(struct servent_data)); | memset(&buf, 0x00, sizeof(struct servent_data)); |
| |
if ( (getservbyname_r((char*)serviceName, TCP, &serv_result, |
char srvnameEbcdic[256]; |
|
strcpy(srvnameEbcdic, serviceName); |
|
AtoE(srvnameEbcdic); |
|
|
|
char tcpEbcdic[64]; |
|
strcpy(tcpEbcdic, TCP); |
|
AtoE(tcpEbcdic); |
|
|
|
if ( (getservbyname_r(srvnameEbcdic, tcpEbcdic, &serv_result, |
&buf)) == 0 ) | &buf)) == 0 ) |
#else // PEGASUS_OS_SOLARIS | #else // PEGASUS_OS_SOLARIS |
if ( (serv = getservbyname(serviceName, TCP)) != NULL ) | if ( (serv = getservbyname(serviceName, TCP)) != NULL ) |