Re: gethostname on 64-bit Windows

2016-06-26 Thread John W. Eaton
On 06/24/2016 11:01 PM, Tatsuro MATSUOKA wrote: - Original Message - From: John W. Eaton <j...@octave.org> To: gnulib <bug-gnulib@gnu.org> Cc: j...@octave.org Date: 2016/6/25, Sat 04:46 Subject: gethostname on 64-bit Windows I needed the attached change to cross co

Re: gethostname on 64-bit Windows

2016-06-24 Thread Tatsuro MATSUOKA
- Original Message - > From: John W. Eaton <j...@octave.org> > To: gnulib <bug-gnulib@gnu.org> > Cc: j...@octave.org > Date: 2016/6/25, Sat 04:46 > Subject: gethostname on 64-bit Windows > > I needed the attached change to cross compile Octave f

gethostname on 64-bit Windows

2016-06-24 Thread John W. Eaton
I needed the attached change to cross compile Octave for i686-w64-mingw32. Without it, rpl_gethostname was undefined because w64 has a gethostname function so gethostname.c is not added to the list of files to build but gethostname was still being redefined to rpl_gethostname. jwe diff -uNr

RE: Trouble with gethostname and mingw-w64 x86_64

2015-05-18 Thread T J
I have a follow-up to this. What was happening is that in the check for `gethostname`, it tries to compile without linking against ws2_32. Note that unistd.h includes winsock2.h on my platform. Now, normally this check will fail (at linking), BUT since a check has been made before for linking

Trouble with gethostname and mingw-w64 x86_64

2014-11-12 Thread T J
acutually works, so forgive me if this is a basic error. I'll start off by saying that building with a 32-bit target works fine. FontForge has `gethostname` as a requirement, so the `gethostname` module is set from Gnulib. When building on 32-bit and when running the configure script

RE: gethostname on HP-NonStop

2010-12-25 Thread Joachim Schmitz
Thanks, that should do, I'll test -Original Message- From: Bruno Haible [mailto:br...@clisp.org] Sent: Friday, December 24, 2010 4:41 PM To: Joachim Schmitz Cc: bug-gnulib@gnu.org Subject: Re: gethostname on HP-NonStop Joachim Schmitz wrote: diff -u ./gllib/unistd.in.h.orig ./gllib

Re: gethostname on HP-NonStop

2010-12-23 Thread Bruno Haible
Joachim Schmitz wrote: gethostname missing (resp. not found, it is available and declared in netdb.h), in various places. I added it to gllib/unistd.in.h source='test-fcntl-h-c++.cc' object='test-fcntl-h-c++.o' libtool=no   DEPDIR=.deps depmode=none /bin/sh ./../build-aux/depcomp  c

RE: gethostname on HP-NonStop

2010-12-23 Thread Joachim Schmitz
Oh well, it is not here. So some kind of workaround is needed. -Original Message- From: Bruno Haible [mailto:br...@clisp.org] Sent: Thursday, December 23, 2010 1:43 PM To: Joachim Schmitz Cc: bug-gnulib@gnu.org Subject: Re: gethostname on HP-NonStop Joachim Schmitz wrote: gethostname

Re: module libposix (was: module gethostname)

2010-09-16 Thread Bruce Korb
Hi Bruno, On Wed, Sep 15, 2010 at 11:18 AM, Bruno Haible br...@clisp.org wrote: Have you tried to follow the approach of  http://www.gnu.org/software/gnulib/manual/html_node/POSIX-Substitutes-Library.html? I haven't, but I would like to hear about success or problems that you encounter. 1.

Re: module libposix (was: module gethostname)

2010-09-16 Thread Ralf Wildenhues
Hi Bruce, * Bruce Korb wrote on Thu, Sep 16, 2010 at 08:00:46PM CEST: 3. config.h needs to be installed. Now, where was that name munger for the config.h header Thinking of AX_PREFIX_CONFIG_H from the Autoconf Macro Archive? BTW, that currently has a PR (with patch) open against it,

Re: module gethostname

2010-09-16 Thread Sam Steingold
Bruno Haible wrote: I am now getting undefined reference to `_gethostname_used_without_requesting_gnulib_module_gethostname' This indicates that you have included gnulib unistd.h, are using gethostname(), and have not asked for the gnulib module 'gethostname'. - If you want to use a POSIX

module gethostname

2010-09-15 Thread Sam Steingold
The only problem which gethostname module fixes is: On mingw, this function has a prototype that differs from that specified by POSIX, and it is defined only in the ws2_32 library. why does it have such extensive dependencies? (sockets! errno!) I have to reiterate my complaint that the gnulib

Re: module gethostname

2010-09-15 Thread Bruce Korb
On Wed, Sep 15, 2010 at 9:34 AM, Paul Eggert egg...@cs.ucla.edu wrote: On 09/15/2010 08:41 AM, Sam Steingold wrote: I have to reiterate my complaint that the gnulib dependencies mean that one has to include (almost) the whole of gnulib if one includes (almost) any part thereof. I agree

Re: module gethostname

2010-09-15 Thread Ralf Wildenhues
Hi Bruce, * Bruce Korb wrote on Wed, Sep 15, 2010 at 07:01:11PM CEST: So, let's start that discussion again: let's make an installable gnulib that basically does all the configure tests for the current target and cover 99% of all configure runs. How about a config.site file? Cheers, Ralf

Re: module gethostname

2010-09-15 Thread Bruce Korb
On Wed, Sep 15, 2010 at 10:04 AM, Ralf Wildenhues ralf.wildenh...@gmx.de wrote: Hi Bruce, * Bruce Korb wrote on Wed, Sep 15, 2010 at 07:01:11PM CEST: So, let's start that discussion again:  let's make an installable gnulib that basically does all the configure tests for the current target

Re: module gethostname

2010-09-15 Thread Dustin J. Mitchell
On Wed, Sep 15, 2010 at 12:01 PM, Bruce Korb bk...@gnu.org wrote: So, let's start that discussion again:  let's make an installable gnulib that basically does all the configure tests for the current target and cover 99% of all configure runs.  If someone has a strange configuration with extra

Re: module gethostname

2010-09-15 Thread Bruno Haible
Sam Steingold wrote: The only problem which gethostname module fixes is: On mingw, this function has a prototype that differs from that specified by POSIX, and it is defined only in the ws2_32 library. why does it have such extensive dependencies? (sockets! errno!) Look at the source code

Re: module gethostname

2010-09-15 Thread Bruno Haible
Bruce, Once upon a time, long ago and far away, I proposed a new library, libcompat that more-or-less would make all target platforms look pretty much identical. Lo and behold, over the past decade, gnulib has gradually grown up to provide all that infrastructure. The only problem with it

Re: module libposix (was: module gethostname)

2010-09-15 Thread Bruce Korb
Hi Bruno, On Wed, Sep 15, 2010 at 11:18 AM, Bruno Haible br...@clisp.org wrote: Have you tried to follow the approach of  http://www.gnu.org/software/gnulib/manual/html_node/POSIX-Substitutes-Library.html? I haven't, but I would like to hear about success or problems that you encounter.

Re: [PATCH] gethostname: fix build on mingw

2010-03-22 Thread Eric Blake
On 03/21/2010 01:45 PM, Matthias Bolte wrote: 2010/3/20 Eric Blake ebl...@redhat.com: Since commit 4e86671a, gethostname failed to compile on mingw. Gnulib's sys/socket.h includes winsock2.h, which then includes unistd.h prior to declaring gethostname. Therefore, unistd.h cannot replace

[PATCHv4] gethostname: fix build on mingw

2010-03-22 Thread Eric Blake
Since commit 4e86671a, gethostname failed to compile on mingw. Gnulib's sys/socket.h includes winsock2.h, which then includes unistd.h prior to declaring gethostname. The fix is to ensure that our replacement unistd.h does not declare any replacements until we are sure that winsock2.h

Re: [PATCHv4] gethostname: fix build on mingw

2010-03-22 Thread Simon Josefsson
Eric Blake ebl...@redhat.com writes: Since commit 4e86671a, gethostname failed to compile on mingw. Gnulib's sys/socket.h includes winsock2.h, which then includes unistd.h prior to declaring gethostname. The fix is to ensure that our replacement unistd.h does not declare any replacements

Re: [PATCHv4] gethostname: fix build on mingw

2010-03-22 Thread Eric Blake
On 03/22/2010 11:39 AM, Simon Josefsson wrote: Eric Blake ebl...@redhat.com writes: Since commit 4e86671a, gethostname failed to compile on mingw. Gnulib's sys/socket.h includes winsock2.h, which then includes unistd.h prior to declaring gethostname. The fix is to ensure that our

Re: [PATCHv4] gethostname: fix build on mingw

2010-03-22 Thread Simon Josefsson
Eric Blake ebl...@redhat.com writes: On 03/22/2010 11:39 AM, Simon Josefsson wrote: Eric Blake ebl...@redhat.com writes: Since commit 4e86671a, gethostname failed to compile on mingw. Gnulib's sys/socket.h includes winsock2.h, which then includes unistd.h prior to declaring gethostname

Re: [PATCHv4] gethostname: fix build on mingw

2010-03-22 Thread Eric Blake
On 03/22/2010 11:56 AM, Simon Josefsson wrote: Typo on line 26. Thanks, now it works. Any reason not to push this? Only that I was not set up to reproduce the failure (cross-compiling from cygwin was running into its own set of problems, because cygwin's gcc-3 compiler mistakenly picks up

Re: [PATCHv4] gethostname: fix build on mingw

2010-03-22 Thread Matthias Bolte
2010/3/22 Eric Blake ebl...@redhat.com: Since commit 4e86671a, gethostname failed to compile on mingw. Gnulib's sys/socket.h includes winsock2.h, which then includes unistd.h prior to declaring gethostname.  The fix is to ensure that our replacement unistd.h does not declare any replacements

Re: [PATCHv4] gethostname: fix build on mingw

2010-03-22 Thread Bruno Haible
Eric Blake wrote: +/* Get all possible declarations of gethostname().  */ +#if @UNISTD_H_HAVE_WINSOCK2_H@ !defined _GL_INCLUDING_WINSOCK2_H +# define _GL_INCLUDING_WINSOCK2_H +# include winsock2.h +# undef _GL_INCLUDING_WINSOCK2_H +#endif Would it be possible to conditionalize

Re: [PATCH] gethostname: fix build on mingw

2010-03-21 Thread Matthias Bolte
this patch and can confirm that this patch fixes the gethostname compile issue on MinGW. Thanks. I think the patch works for including sys/socket.h first, but what happens if you include unistd.h or winsock2.h first?  I think there's still some circularities that need to be resolved

Re: [PATCH] gethostname: fix build on mingw

2010-03-21 Thread Matthias Bolte
2010/3/20 Eric Blake ebl...@redhat.com: Since commit 4e86671a, gethostname failed to compile on mingw. Gnulib's sys/socket.h includes winsock2.h, which then includes unistd.h prior to declaring gethostname.  Therefore, unistd.h cannot replace gethostname until winsock2.h is complete, also

Re: [PATCH] gethostname: fix build on mingw

2010-03-20 Thread Eric Blake
that this patch fixes the gethostname compile issue on MinGW. Thanks. I think the patch works for including sys/socket.h first, but what happens if you include unistd.h or winsock2.h first? I think there's still some circularities that need to be resolved. That is, gnulib's unistd.h needs to be smarter

[PATCH] gethostname: fix build on mingw

2010-03-20 Thread Eric Blake
Since commit 4e86671a, gethostname failed to compile on mingw. Gnulib's sys/socket.h includes winsock2.h, which then includes unistd.h prior to declaring gethostname. Therefore, unistd.h cannot replace gethostname until winsock2.h is complete, also fixing things if a .c includes unistd.h (or even

[PATCH] gethostname: fix build on mingw

2010-03-19 Thread Eric Blake
Since commit 4e86671a, gethostname failed to compile on mingw. Gnulib's sys/socket.h includes winsock2.h, which then includes unistd.h prior to declaring gethostname. Therefore, unistd.h cannot replace gethostname until winsock2.h is complete. * lib/sys_socket.in.h (includes): Set witness when

Re: [PATCH] gethostname: fix build on mingw

2010-03-19 Thread Matthias Bolte
2010/3/20 Eric Blake ebl...@redhat.com: Since commit 4e86671a, gethostname failed to compile on mingw. Gnulib's sys/socket.h includes winsock2.h, which then includes unistd.h prior to declaring gethostname.  Therefore, unistd.h cannot replace gethostname until winsock2.h is complete. * lib

Re: gethostname on Windows

2009-08-03 Thread Simon Josefsson
#define GetComputerNameEx GetComputerNameExA. - With older versions of mingw, none of the declarations are present at all, not even of the enum value ComputerNameDnsHostname. - GetComputerName() does not return the right kind of hostname. - gethostname() requires linking

Re: gethostname, socket need startup code

2009-08-03 Thread Simon Josefsson
Bruno Haible br...@clisp.org writes: Hi Simon, On mingw, the gethostname test fails for me: gethostname failed, rc -1 errno 10093 FAIL: test-gethostname.exe The reason is that the WSAStartup function has not been called. Why not make this initialization implicitly in the gethostname

Re: gethostname, socket need startup code

2009-08-03 Thread Bruno Haible
Simon Josefsson wrote: Looks fine to me, please push it. Pushed. Likewise, the 'sys_utsname' and 'uname' modules are pushed as well. Bruno

Re: gethostname on Windows

2009-08-02 Thread Bruno Haible
to `_GetComputerNameEx' collect2: ld returned 1 exit status j...@mocca:~$ 2) What is the maximum string size that GetComputerNameEx can return? For the gethostname, the max size is documented. 3) Is the GetComputerNameEx semantics right? You are right. In summary: - GetComputerNameEx

Re: gethostname, socket need startup code

2009-08-02 Thread Bruno Haible
Paolo Bonzini wrote: I'm wondering if some programs out there used WSAStartup autonomously without going through the sockets module... That would not hurt. WSAStartup succeeds when called repeatedly, even when called with different version numbers: $ cat foo.c #include winsock2.h #include

Re: gethostname on Windows

2009-08-02 Thread Bruno Haible
Martin Lambers wrote: This requires to include limits.h in gethostname.c, to get INT_MAX. Martin diff --git a/lib/gethostname.c b/lib/gethostname.c index ef58a40..422184a 100644 --- a/lib/gethostname.c +++ b/lib/gethostname.c @@ -76,6 +76,9 @@ gethostname (char *name, size_t len

Re: gethostname, socket need startup code

2009-08-02 Thread Paolo Bonzini
Good. No one asks worse than 1.1 so the patch is okay. Paolo

Re: gethostname inadvertently replaced on W32

2009-07-29 Thread Simon Josefsson
Martin Lambers mar...@marlam.de writes: On Tue, 28. Jul 2009, 23:18:09 +0200, Simon Josefsson wrote: OTOH, I haven't tested whether my old patch still works. Martin, have you? It applied cleanly (except for the ChangeLog entry) and I tested it on Debian lenny and with a MinGW cross

gethostname inadvertently replaced on W32

2009-07-28 Thread Martin Lambers
Hello everybody, W32 has gethostname in ws2_32.dll. This is not detected by gethostname.m4, and gethostname is inadvertently replaced by a function that always returns an empty string. The following patch fixes this for me. It works on Debian and with a MinGW cross compiler. I tried to change

Re: gethostname inadvertently replaced on W32

2009-07-28 Thread Martin Lambers
On Tue, Jul 28, 2009 at 10:08:34AM +0200, Martin Lambers wrote: The following patch fixes this for me. Sorry, this is not true (I forgot to 'make clean' and did not see this earlier). The unistd.h header from gnulib defines gethostname to rpl_gethostname, but no such function is available

Re: gethostname inadvertently replaced on W32

2009-07-28 Thread Martin Lambers
? Without it, the gethostname module is broken on W32. Regards, Martin

Re: gethostname inadvertently replaced on W32

2009-07-28 Thread Simon Josefsson
, would you please reconsider applying the patch? Without it, the gethostname module is broken on W32. Re-reading that thread, I think my patch is a reasonable way forward. Avoiding linking to -lws2_32 is nice, but using GetComputerNameEx has some issues (see my third e-mail in that thread

Re: gethostname inadvertently replaced on W32

2009-07-28 Thread Martin Lambers
On Tue, 28. Jul 2009, 23:18:09 +0200, Simon Josefsson wrote: OTOH, I haven't tested whether my old patch still works. Martin, have you? It applied cleanly (except for the ChangeLog entry) and I tested it on Debian lenny and with a MinGW cross compiler. This time I built from scratch, to avoid

Re: gethostname on Windows

2009-04-02 Thread Simon Josefsson
Bruno Haible br...@clisp.org writes: Simon Josefsson wrote: The current gethostname module will return an empty string on mingw: strcpy (name, ); /* Hardcode your system name if you want. */ This is sub-optimal since Windows has a gethostname function in -lws2_32

Re: gethostname on Windows

2009-04-02 Thread Simon Josefsson
I managed to rewrite the code in GSS to not need the gethostname function at all, so I don't care strongly about the patch to make gethostname work under mingw anymore. My initial patch could be used, but Bruno's concern about linking to -lws2_32 may be a reason against. /Simon

Re: gethostname on Windows

2009-04-01 Thread Bruno Haible
Simon Josefsson wrote: The current gethostname module will return an empty string on mingw: strcpy (name, ); /* Hardcode your system name if you want. */ This is sub-optimal since Windows has a gethostname function in -lws2_32. The following patch should make gethostname

gethostname on Windows

2009-03-31 Thread Simon Josefsson
The current gethostname module will return an empty string on mingw: strcpy (name, );/* Hardcode your system name if you want. */ This is sub-optimal since Windows has a gethostname function in -lws2_32. The following patch should make gethostname return proper values. Tested

gethostname: LGPL - LGPLv2+

2008-10-27 Thread Jim Meyering
I'd like to use the gethostname module in libvirt (LGPLv2+), for use when building for mingw. Considering the size of the module (trivial, 10-line gethostname function and minimal gethostname.m4), would anyone object to relaxing its license from LGPL to LGPLv2+? This is mainly to avoid gnulib's

Re: gethostname: LGPL - LGPLv2+

2008-10-27 Thread Simon Josefsson
Jim Meyering [EMAIL PROTECTED] writes: I'd like to use the gethostname module in libvirt (LGPLv2+), for use when building for mingw. Considering the size of the module (trivial, 10-line gethostname function and minimal gethostname.m4), would anyone object to relaxing its license from LGPL

Re: gethostname: LGPL - LGPLv2+

2008-10-27 Thread Jim Meyering
Jim Meyering [EMAIL PROTECTED] wrote: I'd like to use the gethostname module in libvirt (LGPLv2+), for use when building for mingw. Considering the size of the module (trivial, 10-line gethostname function and minimal gethostname.m4), would anyone object to relaxing its license from LGPL

Re: gethostname fix for mingw (was: Re: Problem with gethostbyname)

2008-10-25 Thread Bruno Haible
Ben Pfaff wrote: Fix gethostname on mingw. * lib/unistd.in.h: Bypass bad winsock2 prototype for gethostname. Prevent calling gethostname on mingw without using the gethostname module. * gethostname.m4: Invoke gl_PREREQ_SYS_H_WINSOCK2 if it is available. * doc

Re: gethostname fix for mingw

2008-10-23 Thread Simon Josefsson
/3.4.5/../../../../include/winsock2.h:635: error: conflicting types for 'gethostname' ./unistd.h:313: error: previous declaration of 'gethostname' was here I've seen this as well recently. I can see what is going wrong: - The gethostname module fails to find gethostname

Re: gethostname on mingw, LIBS

2008-10-23 Thread Bruno Haible
Hi Simon, Note that this does not resolve the issue with mingw. On mingw, winsock2.h declares gethostname() also - but it requires linking with -lws2_32, right? Yes. Win32 also has GetComputerName that does not need -lws2_32. It would be easier to use, but which one is right

Re: gethostname fix for mingw (was: Re: Problem with gethostbyname)

2008-10-23 Thread Bruno Haible
]@ +# if HAVE_WINSOCK2_H +# /* Bypass bad prototype for gethostname(). */ +# include winsock2.h +# undef gethostname +# define gethostname rpl_gethostname +# endif extern int gethostname(char *name, size_t len); # endif +#elif @UNISTD_H_HAVE_WINSOCK2_H@ +# undef gethostname +# define

Re: gethostname on mingw, LIBS

2008-10-23 Thread Simon Josefsson
Bruno Haible [EMAIL PROTECTED] writes: Maybe the same approach cannot be used for gethostname: ... I'm not sure. It seems pretty clear that MINGW_LIBS and GetModuleHandle are two approaches that can solve this problem. And with GetComputerNameEx, there is no link requirement at all. I

Re: declare gethostname in unistd.h

2008-10-22 Thread Simon Josefsson
Bruno, the patch causes build failures on mingw: ./unistd.h:313: error: conflicting types for 'gethostname' /usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/winsock2.h:635: error: previous declaration of 'gethostname' was here The problem is that the native

gethostname fix for mingw (was: Re: Problem with gethostbyname)

2008-10-22 Thread Ben Pfaff
: error: conflicting types for 'gethostname' ./unistd.h:313: error: previous declaration of 'gethostname' was here I can see what is going wrong: - The gethostname module fails to find gethostname() because it is in the ws2_32 library, which it doesn't try to link

Re: declare gethostname in unistd.h

2008-10-20 Thread Simon Josefsson
Bruno Haible [EMAIL PROTECTED] writes: Hi Simon, Here's a proposed patch so that on platforms where gethostname() is missing and substituted by gnulib, it is declared in unistd.h. OK to commit? Hi. Yes, please do. Note that this does not resolve the issue with mingw. On mingw, winsock2.h

declare gethostname in unistd.h

2008-10-19 Thread Bruno Haible
Hi Simon, Here's a proposed patch so that on platforms where gethostname() is missing and substituted by gnulib, it is declared in unistd.h. OK to commit? Note that this does not resolve the issue with mingw. On mingw, winsock2.h declares gethostname() also - but it requires linking

Re: gethostname

2008-08-13 Thread Bruno Haible
Hello Ben, I missed seeing that in the show-portability output, even though it was right there. I think that part of the reason was that the output is grouped by library. When I adjust the sorting to be by OS, it is easier for me to see that ... ... ---

Re: gethostname

2008-08-13 Thread Simon Josefsson
Ben Pfaff [EMAIL PROTECTED] writes: libcsolaris-2.10 libnsl solaris-2.10 libnsl solaris-2.4 libcsolaris-2.5.1 libnsl solaris-2.5.1 ... -| sed -e 's,^\(\) *,\1,' | sort

Re: gethostname

2008-08-13 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Simon Josefsson on 8/13/2008 4:59 AM: | Is there a sort option that results in the output being something like | the below? | | libnsl solaris-2.4 | libcsolaris-2.5.1 | libnsl

Re: gethostname

2008-08-12 Thread Bruno Haible
more. Simon Josefsson wrote: I think the right solution here should be to apply the patch below. If there are problems on any system caused by that, the solution to that problem should be to create a module for sys/utsname.h and uname. The gnulib docs (doc/posix-functions/{gethostname,uname

Re: gethostname

2008-08-12 Thread Simon Josefsson
should be to apply the patch below. If there are problems on any system caused by that, the solution to that problem should be to create a module for sys/utsname.h and uname. The gethostname module shouldn't depend on such modules, they need to be added manually by maintainers who want compatibility

Re: gethostname

2008-08-12 Thread Sam Steingold
the right solution here should be to apply the patch below. If there are problems on any system caused by that, the solution to that problem should be to create a module for sys/utsname.h and uname. The gethostname module shouldn't depend on such modules, they need to be added manually by maintainers who

Re: gethostname

2008-08-12 Thread Ben Pfaff
Sam Steingold [EMAIL PROTECTED] writes: 1. is this module ever needed on a unix system? i.e., are there any unix systems still in use that lack gethostname? 2. are there any unix systems still in use that lack uname? Among the platforms represented in Bruno Haible's collection of library

Re: gethostname

2008-08-12 Thread Sam Steingold
Ben Pfaff wrote: Sam Steingold [EMAIL PROTECTED] writes: 1. is this module ever needed on a unix system? i.e., are there any unix systems still in use that lack gethostname? 2. are there any unix systems still in use that lack uname? Among the platforms represented in Bruno Haible's

Re: gethostname

2008-08-12 Thread Simon Josefsson
/009695399/functions/uname.html I think the right solution here should be to apply the patch below. If there are problems on any system caused by that, the solution to that problem should be to create a module for sys/utsname.h and uname. The gethostname module shouldn't depend on such modules

Re: gethostname

2008-08-12 Thread Ben Pfaff
Sam Steingold [EMAIL PROTECTED] writes: Ben Pfaff wrote: Sam Steingold [EMAIL PROTECTED] writes: 1. is this module ever needed on a unix system? i.e., are there any unix systems still in use that lack gethostname? 2. are there any unix systems still in use that lack uname? Among

Re: gethostname

2008-08-12 Thread Sam Steingold
://www.opengroup.org/onlinepubs/009695399/functions/uname.html I think the right solution here should be to apply the patch below. If there are problems on any system caused by that, the solution to that problem should be to create a module for sys/utsname.h and uname. The gethostname module shouldn't depend

Re: gethostname

2008-08-12 Thread Simon Josefsson
and uname. The gethostname module shouldn't depend on such modules, they need to be added manually by maintainers who want compatibility with non-POSIX systems. Thoughts? note that gethostname is just as posix as uname, http://www.opengroup.org/onlinepubs/009695399/functions/gethostname.html so

Re: gethostname

2008-08-12 Thread Sam Steingold
Ben Pfaff wrote: Sam Steingold [EMAIL PROTECTED] writes: Ben Pfaff wrote: Sam Steingold [EMAIL PROTECTED] writes: 1. is this module ever needed on a unix system? i.e., are there any unix systems still in use that lack gethostname? 2. are there any unix systems still in use that lack uname

Re: gethostname

2008-08-12 Thread Ben Pfaff
Simon Josefsson [EMAIL PROTECTED] writes: I don't know what nsk-G06 is, is it a platform gnulib supports? I think it's the Tandem (now HP) NonStop Kernel. I don't know whether gnulib supports it. -- Ben Pfaff http://benpfaff.org

Re: gethostname

2008-08-12 Thread Simon Josefsson
Sam Steingold [EMAIL PROTECTED] writes: note: woe32 does have gethostname, so mingw is fully covered. Not quite, MinGW only has gethostname if you link to -lws2_32. The current m4 test doesn't check for this, so it fails to detect that gethostname exists. My patch attempts to test

Re: gethostname

2008-08-12 Thread Bruno Haible
Ben Pfaff wrote: Solaris has gethostname in libnsl, Solaris = 2.5.1 also has it in libc. Since Solaris 2.4 is not worth supporting today any more, the current gethostname module is right in *not* testing for -lnsl. Bruno

Re: gethostname

2008-08-12 Thread Ben Pfaff
Bruno Haible [EMAIL PROTECTED] writes: Ben Pfaff wrote: Solaris has gethostname in libnsl, Solaris = 2.5.1 also has it in libc. Since Solaris 2.4 is not worth supporting today any more, the current gethostname module is right in *not* testing for -lnsl. You are right, of course. I

gethostname

2008-08-11 Thread Sam Steingold
gnulib/lib/gethostname.c says: #ifdef HAVE_UNAME # include sys/utsname.h #endif 1. why aren't you testing for HAVE_SYS_UTSNAME_H instead? 2. are there really systems without uname sys/utsname.h, given that these are in posix? http://www.opengroup.org/onlinepubs/009695399/functions/uname.html

Re: gethostname

2008-08-11 Thread Simon Josefsson
://www.opengroup.org/onlinepubs/009695399/functions/uname.html I think the right solution here should be to apply the patch below. If there are problems on any system caused by that, the solution to that problem should be to create a module for sys/utsname.h and uname. The gethostname module shouldn't depend

Re: gethostname

2008-08-11 Thread Sam Steingold
for sys/utsname.h and uname. The gethostname module shouldn't depend on such modules, they need to be added manually by maintainers who want compatibility with non-POSIX systems. Thoughts? note that gethostname is just as posix as uname, http://www.opengroup.org/onlinepubs/009695399/functions

Re: (x)gethostname

2008-01-24 Thread Simon Josefsson
reimplements every DLL, so in particular Wine's winsock is a different implementation that Windows winsock. I checked real Windows behaviour here, and it does indeed require that WSAStartup is called before gethostname. Otherwise, gethostname will return -1 and doesn't populate the buffer. So

Re: (x)gethostname

2008-01-24 Thread Simon Josefsson
Here is an updated patch to get gethostname working under MinGW. It uses the recent new gnulib module 'sockets'. The module works like this: If the gethostname function is not found on the system, it pulls in gethostname.c into the gnulib library, and defines gethostname to rpl_gethostname

Re: (x)gethostname

2008-01-24 Thread Simon Josefsson
Brian Dessent [EMAIL PROTECTED] writes: Simon Josefsson wrote: 3) Is there any chance that the #define gethostname rpl_gethostname and replacement prototype of gethostname in gnulib's unistd.h will cause problems? Consider that gethostname in winsock2.h is declared with PASCAL calling

Re: gethostname-test

2008-01-18 Thread Simon Josefsson
Bruno Haible [EMAIL PROTECTED] writes: Hi Simon, 2008-01-17 Simon Josefsson [EMAIL PROTECTED] +* modules/gethostname-tests: New file. + +* tests/test-gethostname.c: New file. Thanks. A nice test. Just a fix to make it compile with gcc -Wall: Oops, thanks. /Simon 2008-01

Re: (x)gethostname

2008-01-18 Thread Bruno Haible
Simon Josefsson wrote: For mingw, @GNULIB_GETHOSTNAME@ will be 0 since it has a gethostname (if sys/socket.h is pulled in). Huh? GNULIB_GETHOSTNAME is set to 1 by the gl_MODULE_INDICATOR([gethostname]) line, independently of platforms. It is 0 if the gethostname module is not used. Bruno

Re: (x)gethostname

2008-01-18 Thread Bruno Haible
Hi Simon, But this is still not complete: The doc/functions/gethostname.texi file says that the problem is that mingw lacks a gethostname function. This is not the case now, and I'm not sure it ever was. Where did that information come from? I wrote it: I saw that the .m4 macro only

Re: (x)gethostname

2008-01-18 Thread Bruno Haible
Simon, If we modify gethostname.m4 as I suggested, it will detect that mingw do have a gethostname function, and consequently, the gethostname module is not be needed. Actually, the replacement function is not needed. But the piece of configure.ac from modules/gethostname is expanded

Re: (x)gethostname

2008-01-18 Thread Simon Josefsson
Simon Josefsson [EMAIL PROTECTED] writes: For reference, the Windows documentation for gethostname is: http://msdn2.microsoft.com/en-us/library/ms738527.aspx Thanks for the reference. So, to accomodate this function, we need a rpl_gethostname that calls gethostname and accomodates 1

Re: (x)gethostname

2008-01-18 Thread Simon Josefsson
Bruno Haible [EMAIL PROTECTED] writes: Hi Simon, But this is still not complete: The doc/functions/gethostname.texi file says that the problem is that mingw lacks a gethostname function. This is not the case now, and I'm not sure it ever was. Where did that information come from? I

Re: (x)gethostname

2008-01-18 Thread Simon Josefsson
Bruno Haible [EMAIL PROTECTED] writes: Simon Josefsson wrote: For mingw, @GNULIB_GETHOSTNAME@ will be 0 since it has a gethostname (if sys/socket.h is pulled in). Huh? GNULIB_GETHOSTNAME is set to 1 by the gl_MODULE_INDICATOR([gethostname]) line, independently of platforms. It is 0

Re: (x)gethostname

2008-01-18 Thread Simon Josefsson
Bruno Haible [EMAIL PROTECTED] writes: Simon, If we modify gethostname.m4 as I suggested, it will detect that mingw do have a gethostname function, and consequently, the gethostname module is not be needed. Actually, the replacement function is not needed. But the piece of configure.ac

Re: missing strcpy prototype in gethostname module

2008-01-17 Thread Simon Josefsson
Bruno Haible [EMAIL PROTECTED] writes: Simon Josefsson wrote: @@ -21,6 +21,8 @@ #ifdef HAVE_UNAME # include sys/utsname.h +#else +# include string.h #endif /* Put up to LEN chars of the host name into NAME. While at it, you could make the patch complete: The function strncpy

Re: (x)gethostname

2008-01-17 Thread Simon Josefsson
Simon Josefsson [EMAIL PROTECTED] writes: 1) Modify gethostname module to look for gethostname in winsock2.h and -lws2_32, similar to what's in getaddrinfo.m4. This will make gethostname depend on sys/socket.h, just like getaddrinfo does. 2) Modify unistd module to make sure

gethostname-test

2008-01-17 Thread Simon Josefsson
This will simplify gethostname module improvements. Applied. /Simon diff --git a/ChangeLog b/ChangeLog index 776e8ff..f52d4c2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2008-01-17 Simon Josefsson [EMAIL PROTECTED] + * modules/gethostname-tests: New file

Re: (x)gethostname

2008-01-17 Thread Simon Josefsson
Bruno Haible [EMAIL PROTECTED] writes: Simon Josefsson wrote: 2008-01-16 Simon Josefsson [EMAIL PROTECTED] * lib/unistd.in.h: Include sys/socket.h, to get to winsock2.h, which declares gethostname on MinGW. * modules/unistd (Depends-on): Add sys_socket. Half OK

Re: (x)gethostname

2008-01-17 Thread Simon Josefsson
Bruno Haible [EMAIL PROTECTED] writes: + /* mingw fails to declare gethostname in unistd.h. */ + #if @GNULIB_GETHOSTNAME@ ((defined _WIN32 || defined __WIN32__) ! defined __CYGWIN__) + # include sys/socket.h + #endif + I tried your patch now, to take care of problem 1), but it doesn't

Re: gethostname-test

2008-01-17 Thread Bruno Haible
Hi Simon, 2008-01-17 Simon Josefsson [EMAIL PROTECTED] + * modules/gethostname-tests: New file. + + * tests/test-gethostname.c: New file. Thanks. A nice test. Just a fix to make it compile with gcc -Wall: 2008-01-17 Bruno Haible [EMAIL PROTECTED] * tests/test

(x)gethostname

2008-01-16 Thread Simon Josefsson
Building shishi on mingw leads to: ../../../src/shishi-0.0.34/gl/xgethostname.c: In function 'xgethostname': ../../../src/shishi-0.0.34/gl/xgethostname.c:61: warning: implicit declaration of function 'gethostname' According to http://www.opengroup.org/onlinepubs/009695399/functions

  1   2   >