From owner-freebsd-bugs Mon Jul 24 00:14:00 1995 Return-Path: bugs-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.11/8.6.6) id AAA07328 for bugs-outgoing; Mon, 24 Jul 1995 00:14:00 -0700 Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.34]) by freefall.cdrom.com (8.6.11/8.6.6) with ESMTP id AAA07314 for ; Mon, 24 Jul 1995 00:13:48 -0700 Received: (from bde@localhost) by godzilla.zeta.org.au (8.6.9/8.6.9) id RAA05945; Mon, 24 Jul 1995 17:10:46 +1000 Date: Mon, 24 Jul 1995 17:10:46 +1000 From: Bruce Evans Message-Id: <199507240710.RAA05945@godzilla.zeta.org.au> To: bde@zeta.org.au, mpp@mpp.minn.net Subject: Re: uname library routine (Was Re: subyte()) Cc: freebsd-bugs@freebsd.org Sender: bugs-owner@freebsd.org Precedence: bulk >After fiddling with the libc uname() routine, I found that >the version doesn't get returned because it is too big to >fit into the 32 character string in the version field of the >utsname structure. Should the uname libc routine be hacked >to read the version into a different (larger buffer) >and then copy just some of that information back into >the utsname.version field? Maybe search for the first ":" and >truncate it there (sort of like what the kernel uname() >routine is doing)? There seems to be a bug in sysctl(). It's supposed to copy as much data as possible before returning ENOMEM. uname() does everything right to take advantage of this, except possibly something to ensure null termination of the strings. uname() guarantees null termination but the sysctl() man page doesn't mention it. Returning one byte more of real data and letting the caller zero it is more useful. Bruce