Re: getdomainname: fix several problems

2010-11-28 Thread Paul Eggert
On 11/28/2010 06:43 PM, Bruno Haible wrote: > The declaration of sysinfo on all three platforms (Solaris, IRIX, OSF/1) is: > int sysinfo(int, char *, long); Ah, sorry, I was relying on the Solaris man page, which says it returns "long". http://docs.sun.com/app/docs/doc/816-5167/sysinfo-2 Since

Re: getdomainname: fix several problems

2010-11-28 Thread Bruno Haible
Hi Paul, Thanks for the review. > > + if (len > INT_MAX) > > +len = INT_MAX; > > + ret = sysinfo (SI_SRPC_DOMAIN, name, len); > > 'ret' should be of type long int, not int, and > the INT_MAX should be LONG_MAX (twice). The declaration of sysinfo on all three platforms (Solaris, IRIX, OSF/

Re: getdomainname: fix several problems

2010-11-28 Thread Paul Eggert
Thanks, that looks good, except for a couple of minor details: > + int ret; > + > + if (len > INT_MAX) > +len = INT_MAX; > + ret = sysinfo (SI_SRPC_DOMAIN, name, len); 'ret' should be of type long int, not int, and the INT_MAX should be LONG_MAX (twice). >dnl Where is getdomainname()

Re: getdomainname: fix several problems

2010-11-28 Thread Bruno Haible
Hi Paul, > who needs getdomainname and why? If the caller wants the DNS domain, > they could well be barking up the wrong tree here. It's a glibc function, and some programs use it. There's a big warning in our unistd.in.h that this function is not related to the DNS domain. >

Re: getdomainname: fix several problems

2010-11-28 Thread Simon Josefsson
Bruno Haible writes: > Tested with a unit test on glibc, MacOS X 10.5, AIX 5.1, OSF/1 5.1, Solaris > 10, > mingw. OK to commit? Thank you! Seems fine to me. Paul Eggert writes: > On 11/28/2010 08:56 AM, Bruno Haible wrote: >> So what the gnulib replacement was doing, was to return a >> dumm

Re: getdomainname: fix several problems

2010-11-28 Thread Paul Eggert
On 11/28/2010 08:56 AM, Bruno Haible wrote: > So what the gnulib replacement was doing, was to return a > dummy string instead of calling the system's function. It is better > to call the system's function. says that libnsl's g

getdomainname: fix several problems

2010-11-28 Thread Bruno Haible
Hi, When I saw this configure output on a Solaris 10 machine checking for getdomainname... no I couldn't believe it. The situation on Solaris is that is has the getdomainname() function in libnsl, not in libc. And it is not declared. So what the gnulib replacement was doing, was to return a du

Re: sys_socket: ensure ss_family

2010-11-28 Thread Simon Josefsson
Bruno Haible writes: > Hi Simon, > > On AIX 5.1, I'm seeing this compilation failure: > > gcc -D_ALL_SOURCE -DHAVE_CONFIG_H -I. -DGNULIB_STRICT_CHECKING=1 -I. -I. > -I.. -I./.. -I../gllib -I./../gllib-g -O2 -MT test-sys_socket.o -MD -MP > -MF .deps/test-sys_socket.Tpo -c -o test-sys_soc

Re: getpass: get system declaration

2010-11-28 Thread Simon Josefsson
Bruno Haible writes: > On Solaris at least, getpass() is not declared in or if > __EXTENSIONS__ is not defined. This fixes the autoconf test and the use of > in lib/getpass.h. > > By the way, on all systems (including glibc), getpass() is declared by > including . I would propose to move its d

sys_socket: ensure ss_family

2010-11-28 Thread Bruno Haible
Hi Simon, On AIX 5.1, I'm seeing this compilation failure: gcc -D_ALL_SOURCE -DHAVE_CONFIG_H -I. -DGNULIB_STRICT_CHECKING=1 -I. -I. -I.. -I./.. -I../gllib -I./../gllib-g -O2 -MT test-sys_socket.o -MD -MP -MF .deps/test-sys_socket.Tpo -c -o test-sys_socket.o test-sys_socket.c test-sys_so