TutGetNodeName


Name

TutGetNodeName — get the name of the current node

Synopsis

T_STR TutGetNodeName(name_return) 
T_STR name_return; 

Arguments

name_return — storage for node name

Return Values

String containing node name.

Diagnostics

None

Description

TutGetNodeName is a convenience function that gets the name of the current node. On UNIX, TutGetNodeName uses either the uname or gethostname function. On Windows, TutGetNodeName uses the WinSock gethostname function. On MVS, TutGetNodeName uses the IBM TCP/IP gethostname function. If that fails, it uses the SMF ID. On OpenVMS TutGetNodeName translates the logical SYS$NODE and removes the trailing double colon.

If TutGetNodeName cannot obtain the node name from the operating system, it stores UNKNOWN in name_return.

Caution

There is no way to know ahead of time how much storage is needed for name_return.

The value of name_return cannot be NULL. Storage for name_return must be managed by the caller.

See Also

None

Examples

This example prints the name of the current node:

T_CHAR node_name[80]; 
TutOut("Current node name is %s.\n", TutGetNodeName(node_name)); 

TIBCO SmartSockets™ Utilities
Software Release 6.8, July 2006
Copyright © TIBCO Software Inc. All rights reserved
www.tibco.com