Subject: Re: gethostname and getdomainname
To: Ignatios Souvatzis <is@jocelyn.rhein.de>
From: Christos Zoulas <christos@zoulas.com>
List: tech-userlevel
Date: 11/14/1999 16:50:48
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?

christos