bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: getdomainname: fix several problems


From: Bruno Haible
Subject: Re: getdomainname: fix several problems
Date: Mon, 29 Nov 2010 03:43:56 +0100
User-agent: KMail/1.9.9

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/1) is:
  int sysinfo(int, char *, long);
The return value is a count that may be as large as the third argument (like
for read() and write() in old versions of Unix). I don't know what happens
if the argument is > INT_MAX, <= LONG_MAX. Better play safe.

> >    dnl Where is getdomainname() defined?
> > -  dnl - On Solaris, it is in libnsl.
> > +  dnl - On Solaris, it is in libnsl. But this function is not declared and
> > +  dnl   is deprecated, see
> 
> It's private, not deprecated.

OK, let me write "discouraged". I don't know about the nuances between these
terms.

Bruno



reply via email to

[Prev in Thread] Current Thread [Next in Thread]