30 const char * pErrStr =
"<unknown host>";
32 if ( this->attachedToSockLib ) {
33 status = gethostname (
37 strncpy ( this->
cache, pErrStr,
sizeof ( this->
cache ) );
39 this->
cache [
sizeof ( this->
cache ) - 1u ] =
'\0';
40 this->length = strlen ( this->
cache );
45 if ( this->attachedToSockLib ) {
51 char * pBuf,
unsigned bufLength )
const 54 strncpy ( pBuf, this->
cache, bufLength );
55 if ( this->length < bufLength ) {
59 unsigned reducedSize = bufLength - 1;
60 pBuf [ reducedSize ] =
'\0';
epicsSingleton< localHostName > localHostNameCache
unsigned getName(char *pBuf, unsigned bufLength) const