🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.object.corba
Article #30

Re: How can a CORBA client find its own hostname

#30
From: Todd Graham Lewis
Date: Mon, 15 Mar 1999 00:00
25 lines
1515 bytes
On Sun, 14 Mar 1999, Sander van Geloven wrote:

> Does anyone know how a CORBA client can find its own hostname. I am
> looking for a short example.

Not CORBA, unix!

	#include <sys/utsname.h>
	#include <string.h>

	struct utsname foo;
	char * nodename;
	size_t bar;

	if(!uname(&foo)){
		bar=strlen(foo.nodename);
		nodename=(char *)malloc(bar);
		strncpy(nodename, foo.nodename, bar);
	}

--
Todd Graham Lewis            32�49'N,83�36'W         (800) 719-4664, x22804
******Linux******         MindSpring Enterprises      tlewis@mindspring.net

"A pint of sweat will save a gallon of blood."          -- George S. Patton
Technical Details
Message-ID: <Pine.LNX.4.04.9903150315570.8481-100000@reflections.eng.mindspring.net>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <36EC1AE9.885D9344@dds.nl>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: 108bbb,a6e219f75eba7547
X-Google-Attributes: gid108bbb,public
X-Google-Thread: 10b07f,a6e219f75eba7547
X-Google-Attributes: gid10b07f,public
X-Google-Thread: f753e,a6e219f75eba7547
X-Google-Attributes: gidf753e,public
From: Todd Graham Lewis <tlewis@mindspring.net>
Subject: Re: How can a CORBA client find its own hostname
Date: 1999/03/15
Message-ID: <Pine.LNX.4.04.9903150315570.8481-100000@reflections.eng.mindspring.net>
X-Deja-AN: 455139395
Content-Transfer-Encoding: 8BIT
References: <36EC1AE9.885D9344@dds.nl>
X-Sender: tlewis@reflections.eng.mindspring.net
X-Server-Date: 15 Mar 1999 08:25:49 GMT
Content-Type: TEXT/PLAIN; charset=X-UNKNOWN
Organization: MindSpring Enterprises
Mime-Version: 1.0
Newsgroups: comp.object.corba,comp.lang.java.corba,borland.public.jbuilder.corba-rmi