Subject: Re: gethostname and getdomainname
To: Christos Zoulas <christos@zoulas.com>
From: Ignatios Souvatzis <is@jocelyn.rhein.de>
List: tech-userlevel
Date: 11/14/1999 22:54:25
On Sun, Nov 14, 1999 at 04:50:48PM -0500, Christos Zoulas wrote:
> On Nov 14, 10:01pm, is@jocelyn.rhein.de (Ignatios Souvatzis) wrote:
> -- Subject: Re: gethostname and getdomainname
> 
> | 
> | --IJpNTDwzlM2Ie8A6
> | Content-Type: text/plain; charset=us-ascii
> | 
> | On Sun, Nov 14, 1999 at 09:29:10PM +0100, Ignatios Souvatzis wrote:
> | 
> | > I really think we should also swallow the error there.
> | > 
> | > > I still think though that it is better
> | > > to make sysctl return a non-null-terminated string.
> | > 
> | > Thats fine with me. 
> | > 
> | > To summarize, I would
> | > 
> | > - fix sysctl so that it returns the truncated string, non-null-terminated,
> | >   and create an appropriate error. I think copyoutstr will do the job nicely
> | >   for us.
> | 
> | Didn't need to. First, it returns an errno not documented in sysctl(3), 2nd,
> | I need to explictly get at the length anyhow (for passing it back), so it 
> | can use copyout, like before.
> | 
> | Here's the kern_sysctl.c patch for review:
> 
> Looks fine to me. I still think gethostname() should return an error
> if it truncates. How else will you know if it did truncate?

I don't know wether XPGwhatwasit specifies an error, but SUSV2 does not, and
no other system does, so it wouldn't be portable.

I guess nobody else really cared...

	-is