On some architectures UCHAR_MAX and USHRT_MAX had type unsigned int.
However, lacking integer suffixes for types smaller than int, their type
should correspond to that of an object of type unsigned char (or short)
when used in an expression with objects of type int. In that case unsigned
char (short) are promoted to int (i.e. signed) so the type of UCHAR_MAX and
USHRT_MAX should also be int.
Where MIN/MAX constants implicitly have the correct type the suffix has
been removed.
While here, correct some comments.
Reviewed by: bde
Approved by: kib (mentor)
When creating a backup file, sed renamed the original before renaming the
changed copy into place, leading to a short time when no file with the
original name was present (usually only visible on SMP systems). Try
creating the backup file using a hard link instead, avoiding this problem.
If creating the hard link fails for any reason, fall back to the old rename
method.
When not creating a backup file, sed already renamed the changed copy onto
the original. This remains unchanged.
I am not adding the suppression of redundant fchown/fchmod to this commit,
because FreeBSD appears to check this in the kernel (for msdosfs at least).
PR: bin/153261
Submitted by: Pedro F. Giffuni
Reviewed by: dds (older version)
Obtained from: Illumos
MFC after: 2 weeks
It was used mainly to discover and fix some 64-bit portability problems
before 64-bit arches were widely available.
Discussed with: bde
Approved by: kib (mentor)
This produces a list of currently supported targets. Here "supported"
means "built in make universe" on the theory that those targets are
more supported than any that might work in 'make buildworld TARGET=x
TARGET_ARCH=y' since the latter are less tested.
Suggested by: rwatson
Implement MACHINE_ARCH=mips64e[lb] to build N64 images. This replaces
MACHINE_ARCH=mipse[lb] TARGET_ABI=n64.
MACHINE_ARCH=mipsn32e[lb] has been added, but currently requires
WITHOUT_CDDL due to atomic issues in libzfs. I've not investigated
this much, but implemented this to preserve as much of the TARGET_ABI
functionality that I could. Since its presence doesn't affect the
working cases, I've kept it in for now.
Added mips64e[lb] to make universe, so more kernels build.
And I think this (finally) closes the curtain on the tbemd tree.
was specified incorrectly, causing the bzero to run past the end of a
malloc(9)'d object.
Submitted by: Eric Youngblut < eyoungblut AT isilon DOT com >
MFC after: 3 days
assembler source for libcompiler_rt as not needed executable stack. This
is done with a hammer instead of properly marking each assembly file
with section .note.GNU-stack to avoid modifying contributed source.
Discussed with: ed
to match the desired priority in td_priority. Otherwise the first time
thread0 used a borrowed priority it would drop down to PUSER instead of
PVM.
- Explicitly initialize the starting priority of new kprocs to PVM to
avoid inheriting some random priority from thread0.
MFC after: 2 weeks
thread and proc have been copied and zeroed from the old thread and
proc. Otherwise attempts to modify thread or process data in sched_fork()
could be undone.
- Don't copy td_{base,}_user_pri from the old thread to the new thread in
sched_fork_thread() in ULE. This is already done courtesy the bcopy()
of the thread copy region.
- Always initialize the real priority (td_priority) of new threads to the
new thread's base priority (td_base_pri) to avoid bogusly inheriting a
borrowed priority from the parent thread.
MFC after: 2 weeks
This was lost when it was converted to using a condition variable instead
of lbolt.
- Drop the priority of flowtable down to PPAUSE when it is idle as well
since it is a similar background task.
MFC after: 2 weeks
obscured vn_start_write() and vn_finished_write() for the
old OpenBSD port, since most uses have been replaced by the
correct calls.
MFC after: 12 days