This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project. See the Cygwin home page for more information.
Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

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.mazzilli@inrialpes.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@sourceware.cygnus.com