This is basically a ``C compilation'' of the former whereis.pl file,
employing the same algorithms, and aiming at being mostly
UI-compatible to the old (legally tainted) 4.3BSD whereis(1). In
comparision, the 4.4BSD-Lite version is just another variant of
which(1) only, where in particular the option to search for source
directories is sorely missing.
While i was at it, i added two more options which i contemplated doing
long since. -x will suppress the run of locate(1) to find sources
that could not be found otherwise, potentially saving a lot of time
(but obviously, risking to not find some sources that are well hidden
in the tree). -q will omit the leading name of the query, so in
particular, you can now do something like:
cd `whereis -qs ls`
I'd explicitly like to thank johan for his review which was quite a
bit more than an average review, including sending me a lot of diffs.
Bruce Evans [Thu, 11 Jul 2002 20:43:37 +0000 (20:43 +0000)]
Fixed misspelling of "hint." as "hints." in the description of the "hint."
keyword and in the description of rp's hints.
Didn't fix rp's hints being mostly in comments so that they are harder to
use (they don't get linted either way because makeLINT.sh strips them and
there is no compile-time syntax checking of hints anyway).
Bruce Evans [Thu, 11 Jul 2002 18:06:09 +0000 (18:06 +0000)]
Set NO_WERROR to ignore the following warning which is emitted on
alphas:
.../elf2aout.c:130: warning: cast increases required alignment of
target type
The warning is about casting ((char *)e + phoff) to a struct pointer,
where e is aligned but phoff might be garbage, so I think the warning
should be emitted on most machines (even on i386's, alignment checking
might be on) and the correct fix would involve validation phoff before
using it.
Bruce Evans [Thu, 11 Jul 2002 17:49:41 +0000 (17:49 +0000)]
Fixed 4 printf format errors that were fatal on alphas. %qd is not even
suitable for printing quad_t's since it is equivalent to %lld but quad_t
is unsigned long on alphas. quad_t shouldn't be used anyway.
Alfred Perlstein [Thu, 11 Jul 2002 17:39:50 +0000 (17:39 +0000)]
Fix return values in the sm_notify_1 service routine to return an answer
most of the time (unless fork fails). This should fix the problem where
FreeBSD won't respond to a remote host and therefor the remote hosts
tries indefinitely to contact the FreeBSD hosts thereby irritating the
system administrator.
Bruce Evans [Thu, 11 Jul 2002 17:33:37 +0000 (17:33 +0000)]
Uncommented WARNS=0. ipfw2.c is full of printf format errors that are
fatal on alphas.
Fixed setting of WARNS. WARNS should never be set unconditionally, since
this breaks testing of different WARNS values by setting it at a higher
level (e.g., on the command line).
Bruce Evans [Thu, 11 Jul 2002 17:28:29 +0000 (17:28 +0000)]
Fixed a printf format error that was fatal on alphas. Adding WFORMAT=0
to the Makefile didn't affect this bug because WFORMAT only controls
higher- level format checking (not the -Wformat that is implicit in
-Wall).
Fixed a nearby printf format error that was benign and 3 nearby style bugs.
Ruslan Ermilov [Thu, 11 Jul 2002 16:43:59 +0000 (16:43 +0000)]
Pass -DBOOTSTRAPPING to the kernel's build tool (sys/dev/aic7xxx/aicasm).
This way, it has a chance to be built with gcc 2.95.x (using the bandaid
in share/mk/bsd.cpu.mk,v 1.11).
Ruslan Ermilov [Thu, 11 Jul 2002 16:27:04 +0000 (16:27 +0000)]
Do not override the CFLAGS with its standard value. At some point,
different architectures may choose to use different default values
for CFLAGS, for example. (It was added in rev. 1.200 as a measure
to make boot images fit the floppies, and was never reverted.)
Ruslan Ermilov [Thu, 11 Jul 2002 14:13:37 +0000 (14:13 +0000)]
Do not override the standard `distribute' target that is currently
available from bsd.obj.mk.
The native version was identical (and pretty much unused except in
the -DMODULES_WITH_WORLD case, which it is not for "make release")
except that the "bin" -> "base" change of the default DISTRIBUTION
name did not propagate here.
Tim J. Robbins [Thu, 11 Jul 2002 06:42:11 +0000 (06:42 +0000)]
Don't assume the shell's controlling terminal is attached to file descriptor
2. Instead, open /dev/tty. This problem stopped commands in subshells from
being executed correctly if standard error was redirected.
Tim J. Robbins [Thu, 11 Jul 2002 06:26:48 +0000 (06:26 +0000)]
Remove support for the "old" tty driver by unifdef -UOLD_TTY_DRIVER;
many other parts of the shell are no longer compatible with this, and it
makes jobs.c quite cluttered with #ifdef's.
Move the MSIZE and MCLSHIFT options out of the undocumented section in
NOTES. Add some comments about the potential problems associated with NIC
driver modules and changing these options.
Fix sorting problems in sys/conf/options with the MSIZE and MCLSHIFT
options.
Matt Jacob [Thu, 11 Jul 2002 03:25:04 +0000 (03:25 +0000)]
'Support' for ISP SBus cards.
This code does not imply that SBus cards work yet. They hang for me.
But I can't netboot the latest snapshot on my ultra1e, and things
hang at bus_setup_intr time.
Since I'm offline for a while, I thought I'd toss this in in case somebody
else who has a bit better luck wants to fart around with it. Please try
and wait until I get back to check things in.
Matthew Dillon [Thu, 11 Jul 2002 02:51:02 +0000 (02:51 +0000)]
Disable format checking for NULL-passing prototypes (really only err*(),
warn*(), and setproctitle() functions) to buildworld work again. This
can be cleaned up later if/when a new GCC supports the feature (but personally
I think it's a waste of time to keep mod'ing imported GCC sources for this
since only three procedures are involved).
Alan Cox [Thu, 11 Jul 2002 02:39:24 +0000 (02:39 +0000)]
o Add a "needs wakeup" flag to the vm_map for use by kmem_alloc_wait()
and kmem_free_wakeup(). Previously, kmem_free_wakeup() always
called wakeup(). In general, no one was sleeping.
o Export vm_map_unlock_and_wait() and vm_map_wakeup() from vm_map.c
for use in vm_kern.c.
Jonathan Mini [Thu, 11 Jul 2002 02:18:33 +0000 (02:18 +0000)]
Revert removal of cred_free_thread(): It is used to ensure that a thread's
credentials are not improperly borrowed when the thread is not current in
the kernel.
Matthew Dillon [Wed, 10 Jul 2002 20:15:58 +0000 (20:15 +0000)]
Remove the critmode sysctl - the new method for critical_enter/exit (already
the default) is now the only method for i386.
Remove the paraphanalia that supported critmode. Remove td_critnest, clean
up the assembly, and clean up (mostly remove) the old junk from
cpu_critical_enter() and cpu_critical_exit().
Matthew Dillon [Wed, 10 Jul 2002 17:02:32 +0000 (17:02 +0000)]
Replace the global buffer hash table with per-vnode splay trees using a
methodology similar to the vm_map_entry splay and the VM splay that Alan
Cox is working on. Extensive testing has appeared to have shown no
increase in overhead.
Disadvantages
Dirties more cache lines during lookups.
Not as fast as a hash table lookup (but still N log N and optimal
when there is locality of reference).
Advantages
vnode->v_dirtyblkhd is now perfectly sorted, making fsync/sync/filesystem
syncer operate more efficiently.
I get to rip out all the old hacks (some of which were mine) that tried
to keep the v_dirtyblkhd tailq sorted.
The per-vnode splay tree should be easier to lock / SMPng pushdown on
vnodes will be easier.
This commit along with another that Alan is working on for the VM page
global hash table will allow me to implement ranged fsync(), optimize
server-side nfs commit rpcs, and implement partial syncs by the
filesystem syncer (aka filesystem syncer would detect that someone is
trying to get the vnode lock, remembers its place, and skip to the
next vnode).
Note that the buffer cache splay is somewhat more complex then other splays
due to special handling of background bitmap writes (multiple buffers with
the same lblkno in the same vnode), and B_INVAL discontinuities between the
old hash table and the existence of the buffer on the v_cleanblkhd list.
Incorporate changes made to the NetBSD version of this driver.
- Remove some obsolete code (NetBSD gem.c r1.12)
- Clean up how the local MAC address is programmed (NetBSD gem.c r1.13)
- Make the driver work on PowerMacs with gigabit interfaces
(NetBSD gem.c r1.14 and r1.15, gemreg.h r1.3 and r1.4, gemvar.h r1.6 and 1.7)
- Suppress RX_MAC interrutps regarding the FRAME_COUNT register.
(NetBSD gem.c r1.16 and r1.17)
- Fix receiver lockups. (NetBSD gem.c r1.18, gemvar.h r1.8)
- Distinguish between Apple and Sun variants (NetBSD if_gem_pci.c r1.9)