installed into CVS

This commit is contained in:
Jeff Hill
2000-06-27 22:57:02 +00:00
parent d0260ff39a
commit bdfd67f9cc
2 changed files with 72 additions and 0 deletions

29
src/ca/localHostName.cpp Normal file
View File

@@ -0,0 +1,29 @@
/* $Id$
*
* L O S A L A M O S
* Los Alamos National Laboratory
* Los Alamos, New Mexico 87545
*
* Copyright, 1986, The Regents of the University of California.
*
* Author: Jeff Hill
*/
#include <string.h>
#include "osiSock.h"
#include "localHostName.h"
localHostName localHostNameAtLoadTime;
localHostName::localHostName ()
{
int status = gethostname ( this->cache, sizeof ( this->cache ) );
if ( status ) {
strncpy ( this->cache, "<unknown host>", sizeof ( this->cache ) );
localHostName::cache [ sizeof ( this->cache ) - 1u ] = '\0';
}
this->length = strlen ( this->cache );
}