From owner-cvs-all Fri Mar 23 20:40:58 2001 Delivered-To: cvs-all@freebsd.org Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 084D237B719; Fri, 23 Mar 2001 20:40:50 -0800 (PST) (envelope-from peter@FreeBSD.org) Received: (from peter@localhost) by freefall.freebsd.org (8.11.1/8.11.1) id f2O4en383425; Fri, 23 Mar 2001 20:40:49 -0800 (PST) (envelope-from peter) Message-Id: <200103240440.f2O4en383425@freefall.freebsd.org> From: Peter Wemm Date: Fri, 23 Mar 2001 20:40:49 -0800 (PST) To: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/sys/kern kern_xxx.c src/sys/sys utsname.h src/lib/libc/gen Makefile.inc __xuname.c uname.c X-FreeBSD-CVS-Branch: HEAD Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG peter 2001/03/23 20:40:49 PST Modified files: sys/kern kern_xxx.c sys/sys utsname.h lib/libc/gen Makefile.inc __xuname.c uname.c Log: This is kind of a hack, but it should work. Currently, world is broken because libc/rpc/key_call.c references uname(), and ps/print.c also defines uname(), and ps is linked statically. This leads to a symbol clash. The userland uname(3) kinda sucked anyway as the hostname etc was too short. And since the libc rpc interface now uses the utsname.nodename which gets truncated, I was tempted into doing something about it. Create a new userland uname function, called __xuname() which takes an extra argument that allows you to change the size of the fields. uname() becomes a static inline function in sys/utsname.h that passes the extra argument in. struct utsname has its field members expanded by default now in userland. We still provide a 'uname' externally linkable function for things that either think that they ``know'' the utsname format and assume 32 character strings and bypass the include file, or objects that are linked against old libcs. ie: just about every plausible case that I can think of is covered. Should we ever change the default lengths again, a libc major bump should not be required as the size is now passed to the function. XXX the uname(2) in the kernel is for FreeBSD 1.1 binary compatability! All the uname(3) functions that are exported to userland are actually implemented in libc with sysctl. uname(1) uses sysctl directly and does not call uname(3). PR: bin/4688 Revision Changes Path 1.32 +9 -1 src/sys/kern/kern_xxx.c 1.9 +15 -3 src/sys/sys/utsname.h 1.75 +2 -2 src/lib/libc/gen/Makefile.inc 1.8 +10 -3 src/lib/libc/gen/__xuname.c 1.8 +5 -79 src/lib/libc/gen/uname.c To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message