FORTIFY_SOURCE feature of libssp, thus checking the size of arguments to
various string and memory copy and set functions (as well as a few system
calls and other miscellany) where known at function entry. RedHat has
evidently built all "core system packages" with this option for some time.
This option should be used at the top of Makefiles (or Makefile.inc where
this is used for subdirectories) but after any setting of LIB.
This is only useful for userland code, and cannot be used in libc or in
any code which includes the libc internals, because it overrides certain
libc functions with macros. Some effort has been made to make USE_FORT=yes
work correctly for a full-system build by having the bsd.sys.mk logic
disable the feature where it should not be used (libc, libssp iteself,
the kernel) but no attempt has been made to build the entire system with
USE_FORT and doing so will doubtless expose numerous bugs and misfeatures.
Adjust the system build so that all programs and libraries that are setuid,
directly handle network data (including serial comm data), perform
authentication, or appear likely to have (or have a history of having)
data-driven bugs (e.g. file(1)) are built with USE_FORT=yes by default,
with the exception of libc, which cannot use USE_FORT and thus uses
only USE_SSP by default. Tested on i386 with no ill results; USE_FORT=no
per-directory or in a system build will disable if desired.
the history buffer that require knowledge of the readline internals to
make safe (it "knows" that GNU readline mallocs certain returned data,
and thus, with libedit, happily calls free on static variables).
using a #define to turn one into the other, this is pointless and causes
more portability issues than it solves (admittedly, in the year 1702 when
this code was written the opposite may have been the case).
before system header file inclusion magically causing what "read" is
#defined to to pick up a read-like prototype. For sanity's sake, put
prototypes for revolting trace_mr stuff in their own header file (instead
of nowhere at all and using the trick referenced above).
This allows the mouse to be used properly in consoles with different sizes:
before this change it was restricted to the size reported by the console
used to start the daemon.
Problem reported by Blair Sadewitz.
by our native bootloader.
- Restore lwp0.l_cpu (which is required for curcpu()) and
cpu_info_store.ci_curlwp after clearing BSS in case
a kernel is loaded by the firmware directly since these
values are in BSS and initilized before mach_init() is called.
(actually they are restored in mips_machdep.c:mips_vector_init()
but we use curcpu() earlier than that point)
Fixes silent hang right after boot on cobalt.
meesing with the TLB. That would usually show up as misterious kernel
crashes under heavy load.
Prettify the code while here so that traversal of the memory mapped
TLB arrays looks congruent in all functions.
Fixes PR 34706
Enable a few more bits in the I/O requested by ld and check for the fast
response bit when reading back from the queue.
Both changes come from reading the FreeBSD driver and testing on a Dell
CERC SATA controller.
vmspace information fails.
Return the nice value properly to userland via the /proc/<pid>/stat entry.
Use vm sizes from vmspace, rather than rusage structs, for the same
reasons as mentioned previously - see the comment in
kvm_proc.c::kvm_getproc2() about rusage values and zombie processes.
system has. This has the (scary-because-we've-been-running-so-long-
without-it) commit message (for the first version of the change):
Tell the controller how much physical memory we have. Without this
there was a chance that our DMA regions would collide with the
memory window used by the cache on the controller. The result would
be massive data corruption. This seemed to mainly affect systems with
>2GB of memory.
+ in /proc/<pid>/statm emulation, use the memory values from vmspace,
rather than struct rusage, since the rusage values appear to be 0 for
all processes except zombies. cf dsl's comment in
kvm_proc.c::kvm_getproc2()
+ in /proc/<pid>/stat, instead of returning the tv_sec value, return the
number of ticks we've had (roughly equivalent to the Linux jiffies).
Calculate these values from the tv_usec values.
Also:
+ enclose CPU_INFO_ITERATOR and CPU_INFO_FOREACH usage in #ifdef
MULTIPROCESSOR, at the request of Nick Hudson
Together, these changes allow htop to work on NetBSD.