Mail Archives: djgpp-workers/1999/05/13/18:15:20
Hello.
Alain Magloire wrote:
> Should not the application be link with the library
>
> cc -o app app.c -lsocket
>
> libsocket.a should overide libc .. no ?
libsocket doesn't override libc's hostname - it provides a function
lsck_gethostname() instead. It does, however, provide getdomainname() (&
lsck_getdomainname(), which is the same function). lsck_gethostname() uses
libc's gethostname() function to obtain the host name if it can't get it
via any other method. lsck_gethostname() can find the proper DNS name of
the computer from Win9x's registry.
I guess libsocket's lsck_gethostname() should really override
gethostname(). Which order are the libraries linked by gcc? i.e. if I do:
gcc -o wotsit wotsit.c -lsocket
does libc get linked before/after libsocket? If the latter is true then I
will make libsocket override libc's gethostname().
My comment about $HOSTNAME was aimed at using DJGPP without libsocket,
e.g. using hostname from shellutils. In bash try:
export HOSTNAME=thingy.foo.com
hostname
hostname will just output the LAN Manager name, rather than the set
environment variable. The environment variable is only used if the LAN
Manager name cannot be found, i.e. when LAN Manager APIs aren't present,
e.g under plain old DOS.
What is the position on placing network-enabled versions of the relevant
utilities on Simtelnet? I think libsocket's Windows code will soon be
stable enough to make this viable.
--
==========================================================================
Rich Dawe - 4th-year MSci Physicist @ Bristol University, UK
richdawe AT bigfoot DOT com, http://www.bigfoot.com/~richdawe/
==========================================================================
- Raw text -