From mboxrd@z Thu Jan 1 00:00:00 1970 From: Enache Adrian To: 9fans@cse.psu.edu Subject: Re: [9fans] ls, rc question -- proposed change to rc/glob.c Message-ID: <20040321232928.GA1197@ratsnest.hole> References: <393a7f63e7c4973e661988f1009f5d7a@vitanuova.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Date: Mon, 22 Mar 2004 01:29:28 +0200 Topicbox-Message-UUID: 3c37546c-eacd-11e9-9e20-41e7f4b1d025 On Sun, Mar 21, 2004 a.d., ron minnich wrote: > should these yield the same results? If you don't care, then the libc.a > approach is fine. If you do want the same results, I think you may be > stuck doing the uniqueness tricks in the kernel a la BSD, which to me > anyway is unattractive. I'm afraid the uniqueness tricks are done in library/userland in BSD. (the McKusick paper referred to in lexnames.html already tells it). Just try to read a "-o union" mounted directory with open/getdirentries. The hack is in libc/gen/opendir.c. Quoting from there: /* * The strategy here is to read all the directory * entries into a buffer, sort the buffer, and * remove duplicate entries by setting the inode * number to zero. */ Only bloating the kernel with a sort/uniq filter could be worse than that. Regards, Adi