From owner-freebsd-arch Sat Jan 20 16: 3:20 2001 Delivered-To: freebsd-arch@freebsd.org Received: from mobile.wemm.org (c1315225-a.plstn1.sfba.home.com [65.0.135.147]) by hub.freebsd.org (Postfix) with ESMTP id 09C4137B401 for ; Sat, 20 Jan 2001 16:03:03 -0800 (PST) Received: from netplex.com.au (localhost [127.0.0.1]) by mobile.wemm.org (8.11.1/8.11.1) with ESMTP id f0L02rk43575; Sat, 20 Jan 2001 16:02:54 -0800 (PST) (envelope-from peter@netplex.com.au) Message-Id: <200101210002.f0L02rk43575@mobile.wemm.org> X-Mailer: exmh version 2.2 06/23/2000 with nmh-1.0.4 To: "Jacques A. Vidrine" Cc: Daniel Eischen , arch@FreeBSD.ORG Subject: Re: Request For Review: libc/libc_r changes to allow -lc_r In-Reply-To: <20010120153158.A88123@hamlet.nectar.com> Date: Sat, 20 Jan 2001 16:02:53 -0800 From: Peter Wemm Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG "Jacques A. Vidrine" wrote: > On Fri, Jan 19, 2001 at 07:38:00PM -0500, Daniel Eischen wrote: > [snip] > > Overview of the changes > > ----------------------- > > Thanks for the hard work and the great overview! > > I have one objection: > > [snip] > > _thread_sys_foo - actual syscall > > _foo - weak definition to _thread_sys_foo > > foo - weak definition to _thread_sys_foo > > > > I've changed all the instances of foo() to _foo() in libc for > > those hidden system calls. Anyone modifying or adding to libc > > will have to be careful to use the same conventions. > > Please, no. Kill `un-namespace' and let us continue to use the > correct name for `foo'. Adding underscores in front of lotsa common > calls hurt my eyes and hinders porting between different libc > implementations (e.g. our `old' one, other *BSDs). Hmm. I went through the diff looking for reasons why we needed the un-namespace.h stuff and to use the _ prefix, but now I am not sure. I suspect we probably should add the _ characters and leave the #defines active. Unless I missed something.. On the subject of namespace etc, I wish this went further. Consider malloc(). We provide a strong 'malloc' symbol. I think it would be better if we provided _malloc(), _free(), _calloc() and a weak malloc->_malloc pointer etc. This way if the user process provides an alternative malloc, then libc and everything else should use the one single malloc. There is nothing worse than the internal libc strdup() calling the internal malloc() and passing a pointer back for you to free with *your* free(). > Finally, I hope this will lead us into introducing all non- Standard C > (or at least non-POSIX) function identifiers in the same fashion, so > as to clean up our namespace. For example, err(3). Yes! Something like what bind did with the resolver namespace? ie: if you want to use the res_foo() functions, you must #include in order to get the prototypes and the #define res_foo __res_foo into scope. This stops res_foo() in libc conflicting with your res_foo() in your program. err() is another prime example as you point out. Things like sendfile() would have been good if they could have been handled this way too, but since that was prototyped in a common header ( if I recall correctly), it would not have made much difference for this one. > Thanks again & Cheers, > -- > Jacques Vidrine / n@nectar.com / jvidrine@verio.net / nectar@FreeBSD.org Cheers, -Peter -- Peter Wemm - peter@FreeBSD.org; peter@yahoo-inc.com; peter@netplex.com.au "All of this is for nothing if we don't go to the stars" - JMS/B5 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message