delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/04/21/07:45:55

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
Sender: Aldo DOT Mazzilli AT inrialpes DOT fr
Message-ID: <371DC833.71FF@inria.fr>
Date: Wed, 21 Apr 1999 14:44:35 +0200
From: Aldo Mazzilli <aldo DOT mazzilli AT inria DOT fr>
Organization: INRIA
X-Mailer: Mozilla 3.01Gold (X11; I; SunOS 5.5 sun4u)
MIME-Version: 1.0
To: gnu-win32 AT cygnus DOT com, crossgcc AT cygnus DOT com
Subject: gethostname

Hello,

I have to port a little C program to WindowsNT and I have some problems
with the following 'gethostname' command.

I just want to get the HOSTNAME value using :
	- gcc with cygwin32 libs (local compilation)
and 	- egcs with mingw32 libs (cross-compilation)

None of these both solutions work.

Do you know why the following program can't give me the HOSTNAME value :
---------
main ()
{
     char HOSTNAME[4096];
 
     gethostname (HOSTNAME, 4096);
        printf("HOST : %s",HOSTNAME) ;
}
---------

NB : it seems that WindowsNT requires to start up the Windows Sockets
API using WSAStartup() . Am I right ?

Thanks in advance ...
Aldo
-- 
=======================================================================
,',',',',',',' Aldo MAZZILLI             | INRIA Rhone-Alpes          |
,',',',',',',' aldo DOT mazzilli AT inrialpes DOT fr| 655, avenue de l'Europe    |
,',',',',',',' Tel : 04 76 61 53 91      | 38330 Montbonnot St Martin |
,',',',',',',' Fax : 04 76 61 52 52      | FRANCE                     |
,',' *** Site WEB : http://www.inrialpes.fr/vasy/people/Aldo.Mazzilli |
=======================================================================

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019