This fix only removes the dependency on compile time constants. The code
has other (old) problems that need to be addressed.
PR: 1791
Reviewed-by: bde, tegge
o Add more checks for buffer overflows
o Use snprintf rather than strcat/cpy and have better checks for max
length exceeded.
Most of these changes are not exploitable buffer overruns, but it never
hurts to be safe.
Inspired by and obtained from: OpenBSD
says it pretends to make.
This bug was apparently harmless except for normal cases involving
.ORDER statements when it made debugging of -jN using -n very
confusing. E.g., for:
.ORDER: beforedepend .depend
depend: beforedepend .depend
where beforedepend depends on something so that it is not initially
up to date, `make [-n] -j2 depend' causes `make' to wait for itself
to make beforedepend. This works fine without -n. The job to make
beforedepend has normally been started, and beforedepend is marked
as made when the job completes. However, with -n, the pseudo-job
for making beforedepend has normally completed, and in any case
there was no chance of beforedepend being marked as made. `make'
actually exited almost immediately with status 0 instead of waiting
forever.
it if flags were explicitly specified on the command line. Do not warn
if we were merely trying to preserve flags or remove UF_NODUMP. NFS does
not support flags.
I'm not sure that this is ideal, but it should do for now. Installing
a plain file onto a NFS server must work, we used to silently ignore the
attempt. Doing a binary install looses the flags anyway since cpio
doens't preserve them with the cdrom/network images.
XXX make world should not use flags or chown/chgrp in the obj/tmp area.
This is based on a suggestion from Ken Merry <ken@plutotech.com>.
Here is a some example for avoiding a confusion.
It asssumes a logged host domain is "spec.co.jp". All
example is longer than UT_HOSTNAMELEN value.
1) turbo.tama.spec.co.jp: 192.19.0.2 -> trubo.tama
2) turbo.tama.foo.co.jp : 192.19.0.2 -> 192.19.0.2
3) specgw.spec.co.jp : 202.32.13.1 -> specgw
Submitted by: Atsushi Murai <amurai@spec.co.jp>
Clean up (or if antipodic: down) some of the msgbuf stuff.
Use an inline function rather than a macro for timecounter delta.
Maintain process "on-cpu" time as 64 bits of microseconds to avoid
needless second rollover overhead.
Avoid calling microuptime the second time in mi_switch() if we do
not pass through _idle in cpu_switch()
This should reduce our context-switch overhead a bit, in particular
on pre-P5 and SMP systems.
WARNING: Programs which muck about with struct proc in userland
will have to be fixed.
Reviewed, but found imperfect by: bde