How to get a fqn hostname
Werner Modenbach
modenbach at alc.de
Mon Oct 8 16:27:26 BST 2001
On Montag, 8. Oktober 2001 15:51 Jan H. Schrewe wrote / Am Montag, 8. Oktober
>
> Here is a small prgram that should help you (for me it works fine):
>
> #include <unistd.h>
> #include <netdb.h>
>
> int main () {
> char hostname[100];
> int length = 100;
> struct hostent *he;
>
> gethostname( hostname, length );
> printf( "Hostname: %s\n", hostname );
>
> he = gethostbyname( hostname );
> printf( "FQN-Hostname: %s\n", he->h_name );
>
> }
>
> hope that helps
>
OK!!! Thanks Jan, it's exactly what I needed.
- Werner -
--
--------------------------------------------------------------
ALC Computertechnik GmbH
\_ \_ \_\_\_ Kaiserstr. 100
\_\_ \_ \_ D-52134 Herzogenrath
\_ \_ \_ \_ Germany
\_\_\_\_ \_ \_ Fon +49 2407 95810
\_ \_ \_ \_ Fax +49 2407 958139
\_ \_ \_\_\_\_ \_\_\_ http://www.alc.de
===========================================================
Werner Modenbach modenbach at alc.de
--------------------------------------------------------------
-
to unsubscribe from this list send an email to kdevelop-request at kdevelop.org with the following body:
unsubscribe »your-email-address«
More information about the KDevelop
mailing list