used since dosetitimer() does this anyway. The compat functions hadn't
been updated since ITIMER_MONOTONIC was introduced, so they reported
that that ITIMER_MONOTONIC timer was invalid.
returned on error. Therefore we must restrict the lengths of any
buffers to NETBSD32_SSIZE_MAX with compat32 to avoid garbage return
values.
Fixes ATF lib/libc/sys/t_write:write_err.
make _lwp_park return the remaining time to sleep in the "ts" argument
if it is a relative timestamp, as discussed in tech-kern.
for compat32. Thanks skrll@ for some cleanup tips.
Only include elf32 hooks if we have elf32 defined and elf32 is not the
"native" emulation. This allows for having compat_netbsd32 without
elf32 (although it's probably not too useful), and also enables arm's
old-ABI usage of compat_netbsd32.
Linux is less strict than NetBSD and permits namelen to be larger
than valid struct sockaddr_in*. If this is the case, truncate the value
to the correct size, so that NetBSD networking does not return an error.
Reviewed by kamil
Passing a negative value to these legacy compat ioctls results in
left shift on a negative value which is undefined behaviour and results
in the tty (at least, possibly other things) locking up.
The argument to the ioctl should always be > 0. Return EINVAL otherwise.
While here, adjustments to code style to match current guidelines.
Found by UBSan.
Reported-by: syzbot+39cd551a05298b222756@syzkaller.appspotmail.com
The poorly named uvm.h is generally supposed to be for uvm-internal
users only.
- Narrow it to files that actually need it -- mostly files that need
to query whether curlwp is the pagedaemon, which should maybe be
exposed by an external header.
- Use uvm_extern.h where feasible and uvm_*.h for things not exposed
by it. We should split up uvm_extern.h but this will serve for now
to reduce the uvm.h dependencies.
- Use uvm_stat.h and #ifdef UVMHIST uvm.h for files that use
UVMHIST(ubchist), since ubchist is declared in uvm.h but the
reference evaporates if UVMHIST is not defined, so we reduce header
file dependencies.
- Make uvm_device.h and uvm_swap.h independently includable while
here.
ok chs@