Home | History | Annotate | only in /src/sys/compat/sunos
History log of /src/sys/compat/sunos
RevisionDateAuthorComments
 1.7 07-Mar-2015  christos fix typo
 1.6 14-Jan-2014  christos branches: 1.6.6;
use new bsd.syscall.mk
 1.5 11-Dec-2005  christos branches: 1.5.110; 1.5.120; 1.5.126;
merge ktrace-lwp.
 1.4 26-Feb-2005  perry make this rebuild generated files by default
 1.3 15-Nov-2003  thorpej branches: 1.3.8; 1.3.10;
We have CVS; there is no reason to make .bak files when generating the
syscall tables.
 1.2 26-Oct-2003  lukem Use ${HOST_SH} instead of `sh'.

If necessary, pull in <bsd.sys.mk> to get the definition of HOST_SH;
Makefiles that pull in one of (most of) <bsd.*.mk> will get this anyway.
 1.1 05-May-1996  veego branches: 1.1.64;
Added a missing Makefile and run it
Moved the prototyp for sunos_sendsig in an #ifndef sparc
 1.1.64.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.1.64.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.64.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.64.1 03-Aug-2004  skrll Sync with HEAD
 1.3.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.3.8.1 29-Apr-2005  kent sync with -current
 1.5.126.1 18-May-2014  rmind sync with head
 1.5.120.2 03-Dec-2017  jdolecek update from HEAD
 1.5.120.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.5.110.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.6.6.1 06-Apr-2015  skrll Sync with HEAD
 1.5 04-Dec-1997  tv Standardize COMPAT_SUNOS -- remove all references to
sunos_exec_aout_makecmds() in machdep.c for various architectures and put
it in exec_conf.c like the other emulations; rename exec.h to
sunos_exec.h.
 1.4 25-Oct-1994  deraadt rename, new syscall interface, etc.
 1.3 29-Jun-1994  cgd New RCS ID's, take two. they're more aesthecially pleasant, and use 'NetBSD'
 1.2 28-Jan-1994  jtc Fix spelling error in Copyright notice
 1.1 28-Nov-1993  deraadt branches: 1.1.2;
compat exec() stuff is done more sensibly now
(hpux and ultrix compat stuff will be done the same way)
 1.1.2.2 28-Nov-1993  deraadt compat exec() stuff is done more sensibly now
(hpux and ultrix compat stuff will be done the same way)
 1.1.2.1 28-Nov-1993  deraadt file exec.h was added on branch magnum on 1993-11-28 18:03:19 +0000
 1.11 12-Feb-2019  mrg compat_sunos depends upon compat_09. fixes:

[ 1.8785495] WARNING: module error: built-in module compat_sunos can't find builtin dependency `compat_09'
[ 1.8785495] WARNING: module error: built-in module compat_sunos prerequisite compat_09 failed, error 2
 1.10 27-Jan-2019  pgoyette Merge the [pgoyette-compat] branch
 1.9 17-Nov-2014  uebayasi branches: 1.9.18; 1.9.20;
Define compat modules (but without dependencies yet).
 1.8 19-Nov-2008  ad branches: 1.8.26;
Make the emulations, exec formats, coredump, NFS, and the NFS server
into modules. By and large this commit:

- shuffles header files and ifdefs
- splits code out where necessary to be modular
- adds module glue for each of the components
- adds/replaces hooks for things that can be installed at runtime
 1.7 02-Feb-2001  mrg branches: 1.7.122; 1.7.126; 1.7.132; 1.7.136;
don't build these files if we're doing compat_netbsd32 as well.
a different set are required.
 1.6 01-Dec-2000  jdolecek put aout specific sunos code from sunos_exec.c to separate file
sunos_exec_aout.c
make LKM safe
add EMUL_GETPID_PASS_PPID|EMUL_GETID_PASS_EID to emul_sunos flags
 1.5 06-Aug-1998  mrg branches: 1.5.12;
if syscall_debug & compat_sunos, include sunos_syscalls.c
 1.4 20-Jul-1997  pk branches: 1.4.8;
config.new => config
 1.3 24-Jun-1995  christos Use compat_util.[ch]
 1.2 11-Jun-1995  pk Go with the flow; use `/emul/sunos' pseudo-root (from Matthew Green).
Note: sunos_stat() and sunos_lstat() were added too.
 1.1 27-Apr-1995  christos Try to make the reboot system call compile under sun3 with RB_STRING
support [not tested]
Add files.sunos
Rename system call switch table file from sunos_init_sysent.c to sunos_sysent.c
like other emulations.
 1.4.8.1 30-Jul-1998  eeh Split vm_offset_t and vm_size_t into paddr_t, psize_t, vaddr_t, and vsize_t.
 1.5.12.2 11-Feb-2001  bouyer Sync with HEAD.
 1.5.12.1 08-Dec-2000  bouyer Sync with HEAD.
 1.7.136.1 19-Jan-2009  skrll Sync with HEAD.
 1.7.132.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.7.126.1 04-May-2009  yamt sync with head.
 1.7.122.1 17-Jan-2009  mjf Sync with HEAD.
 1.8.26.1 03-Dec-2017  jdolecek update from HEAD
 1.9.20.1 10-Jun-2019  christos Sync with HEAD
 1.9.18.1 12-Mar-2018  pgoyette Update dependencies for modules when they are built-in. Now we don't
(or at least, shouldn't) need reminders in the GENERIC config files
about which module options require other options.

Update branch status doc accordingly.
 1.10 25-Oct-1994  mycroft Clean up deleted files.
 1.9 30-Jun-1994  cgd fix a botch, and gen syscall files
 1.8 30-Jun-1994  cgd fix up for new ID format, and consistency
 1.7 29-Jun-1994  cgd New RCS ID's, take two. they're more aesthecially pleasant, and use 'NetBSD'
 1.6 01-May-1994  cgd keep appropriate id's in 'created from' lines
 1.5 04-Apr-1994  deraadt SYS_* -> SUN_SYS_* to avoid name space clash
 1.4 22-Nov-1993  deraadt branches: 1.4.2;
moved from arch/sparc/sunos to compat/sunos
 1.3 10-Nov-1993  deraadt chmod 444 on the output files is a bad idea
 1.2 11-Oct-1993  deraadt various changes, suffice to say that 4.4 syscalls do not look like ours
 1.1 02-Oct-1993  deraadt Chris Torek's sparc port. Missing lots of things.
 1.4.2.2 22-Nov-1993  deraadt moved from arch/sparc/sunos to compat/sunos
 1.4.2.1 22-Nov-1993  deraadt file makesyscalls.sh was added on branch magnum on 1993-11-22 22:54:49 +0000
 1.7 25-Oct-1994  mycroft Clean up deleted files.
 1.6 12-Jul-1994  gwr Avoid some macro redefinitions that have appeared since exec.h
now includes exec_aout.h
 1.5 29-Jun-1994  cgd branches: 1.5.2;
New RCS ID's, take two. they're more aesthecially pleasant, and use 'NetBSD'
 1.4 28-Jan-1994  jtc Fix spelling error in Copyright notice
 1.3 28-Jan-1994  deraadt for new exec, from mw
 1.2 12-Dec-1993  deraadt m68k/sparc sunos binary compatibility code, pulled down from magnum branch
for consumption by the m68k masses
 1.1 28-Nov-1993  deraadt branches: 1.1.2;
compat exec() stuff is done more sensibly now
(hpux and ultrix compat stuff will be done the same way)
 1.1.2.2 28-Nov-1993  deraadt handle the emul mode more carefully.
 1.1.2.1 28-Nov-1993  deraadt file sun_exec.c was added on branch magnum on 1993-11-28 22:59:35 +0000
 1.5.2.1 12-Jul-1994  cgd update from trunk, per gwr & theo
 1.4 28-Nov-1993  mycroft Clean up deleted files.
 1.3 22-Nov-1993  deraadt branches: 1.3.2;
moved from arch/sparc/sunos to compat/sunos
 1.2 20-Nov-1993  deraadt cannonicalize #include's
 1.1 10-Nov-1993  deraadt sunos compat execve() helper routines.
these routines are not useful/used on the sparc, but are needed
by the sun3.
 1.3.2.1 24-Nov-1993  deraadt munged includes into better shape
 1.13 25-Oct-1994  mycroft Clean up deleted files.
 1.12 20-Oct-1994  cgd pay a small amount of lip service to the new syscall args mechanism.
In reality, none of these will compile.
 1.11 29-Jun-1994  cgd New RCS ID's, take two. they're more aesthecially pleasant, and use 'NetBSD'
 1.10 21-May-1994  deraadt bail on SIOCGARP
 1.9 26-Apr-1994  pk Fix typo.
Give TIOCTCNTL a try.
 1.8 28-Jan-1994  jtc Fix spelling error in Copyright notice
 1.7 15-Jan-1994  deraadt sync with magnum
 1.6 12-Dec-1993  deraadt m68k/sparc sunos binary compatibility code, pulled down from magnum branch
for consumption by the m68k masses
 1.5 22-Nov-1993  deraadt branches: 1.5.2;
moved from arch/sparc/sunos to compat/sunos
 1.4 20-Nov-1993  deraadt fake support for TIOCSSOFTCAR and TIOCGSOFTCAR
(one of which used to point to NetBSD's TIOCSTAT :-)
 1.3 14-Nov-1993  deraadt disassembly shows the %f2 register being accessed, and of course the
kernel panics.
why wasit using %f2? some expressions were too complicated and gcc2 (with
the optimizer off, mind you) ran out of integer registers and thus used
started using a float register for a temporary.
 1.2 10-Nov-1993  deraadt replacement set of sun ioctl functions. markus wild added a
whole slew of new ioctl's that are much more close to reality.

the comat-sunos tree is now almost good enough to be used in
both m68k and sparc kernels.
 1.1 02-Oct-1993  deraadt Chris Torek's sparc port. Missing lots of things.
 1.5.2.4 28-Dec-1993  pk Pass address of argument in TIOCSIG ioctl function.
One EOPNOTSUPP => ENODEV on tty descriptors.
 1.5.2.3 30-Nov-1993  pk One more ioctl translation (TIOCSIGNAL).
 1.5.2.2 28-Nov-1993  deraadt initial SIOC* support from pk. needs more work.
 1.5.2.1 22-Nov-1993  deraadt file sun_ioctl.c was added on branch magnum on 1993-11-28 02:31:11 +0000
 1.33 25-Oct-1994  mycroft Clean up deleted files.
 1.32 20-Oct-1994  cgd pay a small amount of lip service to the new syscall args mechanism.
In reality, none of these will compile.
 1.31 28-Sep-1994  deraadt use STACKGAPBASE
 1.30 29-Jun-1994  cgd New RCS ID's, take two. they're more aesthecially pleasant, and use 'NetBSD'
 1.29 22-Jun-1994  pk sun_mount: fill in one more field.
 1.28 15-Jun-1994  deraadt async_daemon only if NFSCLIENT
 1.27 10-Jun-1994  pk Adapt to 4.4-lite.
 1.26 08-Jun-1994  mycroft Minor change.
 1.25 06-Jun-1994  deraadt tricky
 1.24 24-May-1994  deraadt maxfdescs -> maxfiles
 1.23 21-May-1994  deraadt iszerodev
 1.22 19-May-1994  deraadt fix uname after sysctl
 1.21 05-May-1994  deraadt p->p_sig -> p->p_siglist
 1.20 05-May-1994  cgd fix my forgetfulness; from gwr
 1.19 04-May-1994  cgd expand the rlimit struct, kill last vestiges of off_t bogosity.
 1.18 29-Apr-1994  cgd kill syscall name aliases. no user-visible changes
 1.17 26-Apr-1994  pk SunOS's RLIMIT_NOFILE is different: add sun_[gs]rlimit().
 1.16 24-Apr-1994  deraadt make sunos mount(2) work again
 1.15 02-Apr-1994  cgd sickness to get SunOS mmap right
 1.14 27-Mar-1994  cgd expand uid_t/gid_t/off_t
 1.13 03-Mar-1994  deraadt DoH!
 1.12 03-Mar-1994  deraadt first cut at a SUNOS_COMPAT sysconf() system call.
 1.11 20-Feb-1994  chopps place conditional around sun_nfssvc.
 1.10 12-Dec-1993  deraadt m68k/sparc sunos binary compatibility code, pulled down from magnum branch
for consumption by the m68k masses
 1.9 22-Nov-1993  deraadt branches: 1.9.2;
moved from arch/sparc/sunos to compat/sunos
 1.8 20-Nov-1993  deraadt new compat functions: sun_open, sun_auditsys, sun_setpgid, sun_uname
some from Markus.
 1.7 12-Nov-1993  deraadt specdev.h moves
 1.6 10-Nov-1993  deraadt silly typo
 1.5 10-Nov-1993  deraadt support both sun3 & sparc concepts of minor/major #'s for /dev/zero
 1.4 15-Oct-1993  deraadt fix sun_getdents()
fix sun_mmap()
Note: delete the "struct dirent" in here when sys/dirent.h is created.
 1.3 13-Oct-1993  deraadt Add a stub auditsys() system call that does nothing.
SunOS /sbin/fsck calls it..
 1.2 11-Oct-1993  deraadt various changes, suffice to say that 4.4 syscalls do not look like ours
 1.1 02-Oct-1993  deraadt Chris Torek's sparc port. Missing lots of things.
 1.9.2.11 23-Jan-1994  deraadt make sun_misc compile without NFSSERVER. thanks to
Niklas Hallqvist <niklas@appli.se>
 1.9.2.10 01-Dec-1993  pk Introduced sun_mknod() which also deals with FIFOs (ie. `mknod xxx p' on SunOS).
 1.9.2.9 30-Nov-1993  deraadt impliment fstatfs() and statfs() better
 1.9.2.8 27-Nov-1993  deraadt very rudimentary exportfs(2) support, ie. "return 0"
 1.9.2.7 27-Nov-1993  deraadt statfs(2) and fstatfs(2) support. `df' now works.
 1.9.2.6 27-Nov-1993  deraadt add vhangup(2)
generalize m68k support for /dev/zero..
 1.9.2.5 26-Nov-1993  deraadt add real wimpy quotactl(2) emulation
 1.9.2.4 26-Nov-1993  deraadt add basically bogus ustat(2) support.
 1.9.2.3 26-Nov-1993  deraadt nfssvc(2) system call emulation. might work, might not -- have to
wait for exportfs(2) support for mountd..
 1.9.2.2 26-Nov-1993  deraadt added mount(2) nfs support
 1.9.2.1 22-Nov-1993  deraadt file sun_misc.c was added on branch magnum on 1993-11-26 12:07:43 +0000
 1.18 01-Mar-1995  mycroft Clean up deleted files.
 1.17 30-Jun-1994  cgd fix a botch, and gen syscall files
 1.16 14-Jun-1994  chopps update to match recent getdtablesize() change
 1.15 07-May-1994  deraadt follow
 1.14 01-May-1994  cgd sun syscalls.master update
 1.13 26-Apr-1994  pk SunOS's RLIMIT_NOFILE is different: add sun_[gs]rlimit().
 1.12 04-Apr-1994  deraadt nice unique SUN_SYS_ names..
 1.11 27-Mar-1994  cgd expand uid_t/gid_t/off_t
 1.10 03-Mar-1994  deraadt update to syscall.master (for sysconf)
 1.9 12-Dec-1993  deraadt update to latest syscalls.master
 1.8 22-Nov-1993  deraadt branches: 1.8.2;
moved from arch/sparc/sunos to compat/sunos
 1.7 20-Nov-1993  deraadt update to new syscalls.master
 1.6 14-Nov-1993  deraadt update to latest syscalls.master
 1.5 10-Nov-1993  deraadt update from new syscalls.master
 1.4 15-Oct-1993  deraadt rebuilt from syscall.master: {get,set}domainname change
 1.3 13-Oct-1993  deraadt rebuild files from syscalls.master
 1.2 11-Oct-1993  deraadt various changes, suffice to say that 4.4 syscalls do not look like ours
 1.1 02-Oct-1993  deraadt Chris Torek's sparc port. Missing lots of things.
 1.8.2.6 01-Dec-1993  deraadt update with new sun_mknod
 1.8.2.5 27-Nov-1993  deraadt update (as always)
 1.8.2.4 27-Nov-1993  deraadt update
 1.8.2.3 27-Nov-1993  deraadt update..
 1.8.2.2 26-Nov-1993  deraadt update to syscalls.master
 1.8.2.1 22-Nov-1993  deraadt file sun_syscall.h was added on branch magnum on 1993-11-26 13:39:12 +0000
 1.18 01-Mar-1995  mycroft Clean up deleted files.
 1.17 30-Jun-1994  cgd fix a botch, and gen syscall files
 1.16 14-Jun-1994  chopps update to match recent getdtablesize() change
 1.15 07-May-1994  deraadt follow
 1.14 01-May-1994  cgd sun syscalls.master update
 1.13 26-Apr-1994  pk SunOS's RLIMIT_NOFILE is different: add sun_[gs]rlimit().
 1.12 04-Apr-1994  deraadt nice unique SUN_SYS_ names..
 1.11 27-Mar-1994  cgd expand uid_t/gid_t/off_t
 1.10 03-Mar-1994  deraadt update to syscall.master (for sysconf)
 1.9 12-Dec-1993  deraadt update to latest syscalls.master
 1.8 22-Nov-1993  deraadt branches: 1.8.2;
moved from arch/sparc/sunos to compat/sunos
 1.7 20-Nov-1993  deraadt update to new syscalls.master
 1.6 14-Nov-1993  deraadt update to latest syscalls.master
 1.5 10-Nov-1993  deraadt update from new syscalls.master
 1.4 15-Oct-1993  deraadt rebuilt from syscall.master: {get,set}domainname change
 1.3 13-Oct-1993  deraadt rebuild files from syscalls.master
 1.2 11-Oct-1993  deraadt various changes, suffice to say that 4.4 syscalls do not look like ours
 1.1 02-Oct-1993  deraadt Chris Torek's sparc port. Missing lots of things.
 1.8.2.6 01-Dec-1993  deraadt update with new sun_mknod
 1.8.2.5 27-Nov-1993  deraadt update (as always)
 1.8.2.4 27-Nov-1993  deraadt update
 1.8.2.3 27-Nov-1993  deraadt update..
 1.8.2.2 26-Nov-1993  deraadt update to syscalls.master
 1.8.2.1 22-Nov-1993  deraadt file sun_syscalls.c was added on branch magnum on 1993-11-26 13:39:14 +0000
 1.18 01-Mar-1995  mycroft Clean up deleted files.
 1.17 30-Jun-1994  cgd fix a botch, and gen syscall files
 1.16 14-Jun-1994  chopps update to match recent getdtablesize() change
 1.15 07-May-1994  deraadt follow
 1.14 01-May-1994  cgd sun syscalls.master update
 1.13 26-Apr-1994  pk SunOS's RLIMIT_NOFILE is different: add sun_[gs]rlimit().
 1.12 04-Apr-1994  deraadt nice unique SUN_SYS_ names..
 1.11 27-Mar-1994  cgd expand uid_t/gid_t/off_t
 1.10 03-Mar-1994  deraadt update to syscall.master (for sysconf)
 1.9 12-Dec-1993  deraadt update to latest syscalls.master
 1.8 22-Nov-1993  deraadt branches: 1.8.2;
moved from arch/sparc/sunos to compat/sunos
 1.7 20-Nov-1993  deraadt update to new syscalls.master
 1.6 14-Nov-1993  deraadt update to latest syscalls.master
 1.5 10-Nov-1993  deraadt update from new syscalls.master
 1.4 15-Oct-1993  deraadt rebuilt from syscall.master: {get,set}domainname change
 1.3 13-Oct-1993  deraadt rebuild files from syscalls.master
 1.2 11-Oct-1993  deraadt various changes, suffice to say that 4.4 syscalls do not look like ours
 1.1 02-Oct-1993  deraadt Chris Torek's sparc port. Missing lots of things.
 1.8.2.6 01-Dec-1993  deraadt update with new sun_mknod
 1.8.2.5 27-Nov-1993  deraadt update (as always)
 1.8.2.4 27-Nov-1993  deraadt update
 1.8.2.3 27-Nov-1993  deraadt update..
 1.8.2.2 26-Nov-1993  deraadt update to syscalls.master
 1.8.2.1 22-Nov-1993  deraadt file sun_sysent.c was added on branch magnum on 1993-11-26 13:39:15 +0000
 1.24 06-Sep-2015  dholland More on PR 41200: headers that declare ioctls should include sys/ioccom.h.
This covers (I think) all the MI headers outside of external/ (and dist/).
 1.23 11-Jan-2009  christos branches: 1.23.24; 1.23.42;
merge christos-time_t
 1.22 04-Dec-2007  dsl branches: 1.22.12; 1.22.14; 1.22.18; 1.22.26;
Remove all the __P
 1.21 04-Mar-2007  christos branches: 1.21.14; 1.21.16; 1.21.22; 1.21.24;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.20 11-Dec-2005  christos branches: 1.20.26;
merge ktrace-lwp.
 1.19 19-Aug-2005  christos 64 bit inode changes.
 1.18 26-Mar-2004  drochner branches: 1.18.16;
all ports define __HAVE_SIGINFO now, so remove the CPP conditionals
 1.17 28-Sep-2003  cl catch up with const sigset_t and const ksiginfo_t
 1.16 26-Sep-2003  simonb Fix "constify sendsig/trapsignal" fallout for non-siginfo'd archs. Test
compiled on most architectures.
 1.15 22-Sep-2003  cl SA_SIGINFO support for m68k (compat sunos)
 1.14 24-Jan-2003  fvdl branches: 1.14.2;
Bump daddr_t to 64 bits. Replace it with int32_t in all places where
it was used on-disk, so that on-disk formats remain the same.
Remove ufs_daddr_t and ufs_lbn_t for the time being.
 1.13 04-Jul-2002  thorpej Add kernel support for having userland provide the signal trampoline:

* struct sigacts gets a new sigact_sigdesc structure, which has the
sigaction and the trampoline/version. Version 0 means "legacy kernel
provided trampoline". Other versions are coordinated with machine-
dependent code in libc.
* sigaction1() grows two more arguments -- the trampoline pointer and
the trampoline version.
* A new __sigaction_sigtramp() system call is provided to register a
trampoline along with a signal handler.
* The handler is no longer passed to sensig() functions. Instead,
sendsig() looks up the handler by peeking in the sigacts for the
process getting the signal (since it has to look in there for the
trampoline anyway).
* Native sendsig() functions now select the appropriate trampoline and
its arguments based on the trampoline version in the sigacts.

Changes to libc to use the new facility will be checked in later. Kernel
version not bumped; we will ride the 1.6C bump made recently.
 1.12 02-Feb-2001  mrg branches: 1.12.2; 1.12.4; 1.12.16;
make this useful when compiled on sparc64: two members in sunos_nfs_args
become typedefs.
 1.11 13-Sep-1998  pk branches: 1.11.12;
Since the last signal restructuring the sparc also has an sunos_sendsig().
 1.10 22-Aug-1998  mrg change sunos compat structure members from long to int so they stay the same on sparc64
 1.9 07-Sep-1996  mycroft Definition of pollfd is no longer needed.
 1.8 05-May-1996  veego Added a missing Makefile and run it
Moved the prototyp for sunos_sendsig in an #ifndef sparc
 1.7 05-May-1996  briggs Put prototype for sunos_sendsig() in sunos.h as suggested by veego.
 1.6 18-Feb-1996  pk Adapt compat NFS mount code to NFSv3.
 1.5 09-Oct-1995  mycroft Remove struct sunos_dirent from here.
 1.4 04-Mar-1995  pk Move SunOS audio_info compat stuff here (from sparc/dev/bsd_audio.c).
 1.3 20-Nov-1994  deraadt ptrace from chs+@CS.cmu.edu, poll from christos
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 25-Oct-1994  deraadt and these
 1.11.12.1 11-Feb-2001  bouyer Sync with HEAD.
 1.12.16.1 15-Jul-2002  gehenna catch up with -current.
 1.12.4.1 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.12.2.1 01-Aug-2002  nathanw Catch up to -current.
 1.14.2.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.14.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.14.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.14.2.1 03-Aug-2004  skrll Sync with HEAD
 1.18.16.3 07-Dec-2007  yamt sync with head
 1.18.16.2 03-Sep-2007  yamt sync with head.
 1.18.16.1 21-Jun-2006  yamt sync with head.
 1.20.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.21.24.1 08-Dec-2007  ad Sync with head.
 1.21.22.1 08-Dec-2007  mjf Sync with HEAD.
 1.21.16.1 09-Jan-2008  matt sync with HEAD
 1.21.14.1 09-Dec-2007  jmcneill Sync with HEAD.
 1.22.26.1 19-Jan-2009  skrll Sync with HEAD.
 1.22.18.1 04-May-2009  yamt sync with head.
 1.22.14.1 29-Mar-2008  christos Welcome to the time_t=long long dev_t=uint64_t branch.
 1.22.12.1 17-Jan-2009  mjf Sync with HEAD.
 1.23.42.1 22-Sep-2015  skrll Sync with HEAD
 1.23.24.1 03-Dec-2017  jdolecek update from HEAD
 1.4 19-Dec-2018  maxv Remove compat_svr4 and compat_svr4_32, as discussed on tech-kern@ recently,
but also as discussed several times in the past.
 1.3 28-Apr-2008  martin branches: 1.3.86; 1.3.88;
Remove clause 3 and 4 from TNF licenses
 1.2 05-Sep-1998  christos branches: 1.2.144; 1.2.146; 1.2.148;
Assign copyright to TNF.
 1.1 09-Oct-1995  mycroft Use cookies for directory offset, mostly from Greg Hudson.
 1.2.148.1 16-May-2008  yamt sync with head.
 1.2.146.1 18-May-2008  yamt sync with head.
 1.2.144.1 02-Jun-2008  mjf Sync with HEAD.
 1.3.88.1 10-Jun-2019  christos Sync with HEAD
 1.3.86.1 26-Dec-2018  pgoyette Sync with HEAD, resolve a few conflicts
 1.57 10-Aug-2018  pgoyette Allow syscall_establish() to install new syscalls when the existing
entry-point is either sys_nomodule or sys_nosys. Update the
makesyscalls.sh script to create a const array of bits to allow
syscall_disestablish() to properly restore the original entry-point.
Update all the initializers of struct emul to initialize the pointer
to the bit array struct emul.

XXX Regen of all files created by makesyscalls.sh will come soon,
XXX followed by a kernel version bump (since struct emul is being
XXX modified).

This commit should address PR kern/45781 and also removes the need
for the work-around for that PR in file

sys/arch/usermode/modules/syscallemu/syscallemu.c
 1.56 06-May-2018  kamil branches: 1.56.2;
Remove an element from struct emul: e_tracesig

e_tracesig used to be implemented for Darwin compat. Nowadays the Darwin
compatiblity layer is gone and there are no other users.

This functionality isn't used where it shall be used in the existing
codebase.

If we want to emulate debugging interfaces in compat layers we would need
to implement that from scratch anyway. We would need to be bug compatible
with other OSes too.

Proposed on tech-kern@.

Welcome to NetBSD 8.99.16!

Sponsored by <The NetBSD Foundation>
 1.55 09-Jan-2018  maya branches: 1.55.2;
remove struct emul's e_fault.

It used to be used by COMPAT_IRIX for the purpose of overriding
uvm_fault (only implemented in MIPS), now removed.

Ride 8.99.12 version bump.
 1.54 19-Feb-2012  rmind Remove COMPAT_SA / KERN_SA. Welcome to 6.99.3!
Approved by core@.
 1.53 07-Jul-2010  chs branches: 1.53.8; 1.53.12;
many changes for COMPAT_LINUX:
- update the linux syscall table for each platform.
- support new-style (NPTL) linux pthreads on all platforms.
clone() with CLONE_THREAD uses 1 process with many LWPs
instead of separate processes.
- move the contents of sys__lwp_setprivate() into a new
lwp_setprivate() and use that everywhere.
- update linux_release[] and linux32_release[] to "2.6.18".
- adjust placement of emul fork/exec/exit hooks as needed
and adjust other emul code to match.
- convert all struct emul definitions to use named initializers.
- change the pid allocator to allow multiple pids to refer to the same proc.
- remove a few fields from struct proc that are no longer needed.
- disable the non-functional "vdso" code in linux32/amd64,
glibc works fine without it.
- fix a race in the futex code where we could miss a wakeup after
a requeue operation.
- redo futex locking to be a little more efficient.
 1.52 19-Nov-2008  ad branches: 1.52.6; 1.52.8;
Make the emulations, exec formats, coredump, NFS, and the NFS server
into modules. By and large this commit:

- shuffles header files and ifdefs
- splits code out where necessary to be modular
- adds module glue for each of the components
- adds/replaces hooks for things that can be installed at runtime
 1.51 04-Dec-2007  dsl branches: 1.51.12; 1.51.16; 1.51.22; 1.51.24;
Remove all the __P
 1.50 11-Dec-2005  christos branches: 1.50.44; 1.50.46; 1.50.52; 1.50.56;
merge ktrace-lwp.
 1.49 11-Jul-2005  christos Add a sunos_machdep include file to deal with MD implementations of
sunos_syscall_intern.
 1.48 10-Jul-2005  christos More syscall_intern lossage.
 1.47 26-Mar-2005  fvdl branches: 1.47.2;
Fix some things regarding COMPAT_NETBSD32 and limits/VM addresses.

* For sparc64 and amd64, define *SIZ32 VM constants.
* Add a new function pointer to struct emul, pointing at a function
that will return the default VM map address. The default function
is uvm_map_defaultaddr, which just uses the VM_DEFAULT_ADDRESS
macro. This gives emulations control over the default map address,
and allows things to be mapped at the right address (in 32bit range)
for COMPAT_NETBSD32.
* Add code to adjust the data and stack limits when a COMPAT_NETBSD32
or COMPAT_SVR4_32 binary is executed.
* Don't use USRSTACK in kern_resource.c, use p_vmspace->vm_minsaddr
instead (emulations might have set it differently)
* Since this changes struct emul, bump kernel version to 3.99.2

Tested on amd64, compile-tested on sparc64.
 1.46 26-Feb-2005  perry branches: 1.46.2;
nuke trailing whitespace
 1.45 20-Dec-2003  fvdl branches: 1.45.8; 1.45.10;
Put back Emmanuel's sigfilter hooks, as decided by Core.
 1.44 20-Dec-2003  manu Introduce lwp_emuldata and the associated hooks. No hook is provided for the
exec case, as the emulation already has the ability to intercept that
with the e_proc_exec hook. It is the responsability of the emulation to
take appropriaye action about lwp_emuldata in e_proc_exec.

Patch reviewed by Christos.
 1.43 05-Dec-2003  jdolecek back the sigfilter emulation hook change off
 1.42 03-Dec-2003  manu Add a sigfilter emulation hook. It is used at the beginning of kpsignal2()
so that a specific emulation has the oportunity to filter out some signals.

if sigfilter returns 0, then no signal is sent by kpsignal2().

There is another place where signals can be generated: trapsignal. Since this
function is already an emulation hook, no call to the sigfilter hook was
introduced in trapsignal.

This is needed to emulate the softsignal feature in COMPAT_DARWIN (signals
sent as Mach exception messages)
 1.41 24-Aug-2003  chs add support for non-executable mappings (where the hardware allows this)
and make the stack and heap non-executable by default. the changes
fall into two basic catagories:

- pmap and trap-handler changes. these are all MD:
= alpha: we already track per-page execute permission with the (software)
PG_EXEC bit, so just have the trap handler pay attention to it.
= i386: use a new GDT segment for %cs for processes that have no
executable mappings above a certain threshold (currently the
bottom of the stack). track per-page execute permission with
the last unused PTE bit.
= powerpc/ibm4xx: just use the hardware exec bit.
= powerpc/oea: we already track per-page exec bits, but the hardware only
implements non-exec mappings at the segment level. so track the
number of executable mappings in each segment and turn on the no-exec
segment bit iff the count is 0. adjust the trap handler to deal.
= sparc (sun4m): fix our use of the hardware protection bits.
fix the trap handler to recognize text faults.
= sparc64: split the existing unified TSB into data and instruction TSBs,
and only load TTEs into the appropriate TSB(s) for the permissions.
fix the trap handler to check for execute permission.
= not yet implemented: amd64, hppa, sh5

- changes in all the emulations that put a signal trampoline on the stack.
instead, we now put the trampoline into a uvm_aobj and map that into
the process separately.

originally from openbsd, adapted for netbsd by me.
 1.40 10-Nov-2002  jdolecek branches: 1.40.6;
handle __HAVE_MINIMAL_EMUL
 1.39 01-Nov-2002  jdolecek set struct emul's nsysent to compat SYS_NSYSENT, not SYS_MAXSYSCALL
 1.38 21-Sep-2002  manu - Introduce a e_fault field in struct proc to provide emulation specific
memory fault handler. IRIX uses irix_vm_fault, and all other emulation
use NULL, which means to use uvm_fault.

- While we are there, explicitely set to NULL the uninitialized fields in
struct emul: e_fault and e_sysctl on most ports

- e_fault is used by the trap handler, for now only on mips. In order to avoid
intrusive modifications in UVM, the function pointed by e_fault does not
has exactly the same protoype as uvm_fault:
int uvm_fault __P((struct vm_map *, vaddr_t, vm_fault_t, vm_prot_t));
int e_fault __P((struct proc *, vaddr_t, vm_fault_t, vm_prot_t));

- In IRIX share groups, all the VM space is shared, except one page.
This bounds us to have different VM spaces and synchronize modifications
to the VM space accross share group members. We need an IRIX specific hook
to the page fault handler in order to propagate VM space modifications
caused by page faults.
 1.37 13-Jul-2002  scw m68k syscall rototill:

- Switch all m68k-based ports over to __HAVE_SYSCALL_INTERN.
- Add systrace glue.
- Define struct mdproc in <m68k/proc.h> instead of <machine/proc.h>.
(They were all defined exactly the same anyway, other than a couple
of the MDP_* flags.)
 1.36 13-Nov-2001  lukem branches: 1.36.8;
add RCSIDs (including regeneration of files as appropriate)
 1.35 18-Sep-2001  jdolecek Make the setregs hook emulation-specific, rather than executable
format specific.
Struct emul has a e_setregs hook back, which points to emulation-specific
setregs function. es_setregs of struct execsw now only points to
optional executable-specific setup function (this is only used for
ECOFF).
 1.34 18-Jun-2001  christos branches: 1.34.2; 1.34.4;
Add an e_trapsignal member to struct emul, so that emulated processes can
send the appropriate signal depending on the trap type.
 1.33 16-Jun-2001  manu Removed obsoletes EMUL_NO_BSD_ASYNCIO_PIPE and EMUL_NO_SIGIO_ON_READ flags.
Async I/O OS specifities should now handled in OS specific code. Linux
has been done, but other emulation should be handled. See case LINUX_F_SETFL
in sys/compat/linux/common/linux_file.c:linux_sys_fcntl() for more details.

The data that has been collected yet:

Net Free Open Linux SunOS AIX OSF1 Darwin
send SIGIO to write end of pipe Y N N N N N Y Y
send SIGIO to read end of pipe Y Y N N N ? Y ?
send SIGIO to write end of socket Y Y Y N N Y Y Y
send SIGIO to read end of socket Y Y Y Y Y ? Y ?
 1.32 30-May-2001  mrg use _KERNEL_OPT.
 1.31 07-May-2001  manu Changed EMUL_BSD_ASYNCIO_PIPE to EMUL_NO_BSD_ASYNCIO_PIPE, so that
the native emulation (NetBSD) does not have a flag.
 1.30 06-May-2001  manu Added two flags to emulation packages:

EMUL_BSD_ASYNCIO_PIPE notes that the emulated binaries expect the original
BSD pipe behavior for asynchronous I/O, which is to fire SIGIO on read() and
write(). OSes without this flag do not expect any SIGIO to be fired on
read() and write() for pipes, even when async I/O was requested. As far as
we know, the OSes that need EMUL_BSD_ASYNCIO_PIPE are NetBSD, OSF/1 and
Darwin.

EMUL_NO_SIGIO_ON_READ notes that the emulated binaries that requested
asynchrnous I/O expect the reader process to be notified by a SIGIO, but
not the writer process. OSes without this flag expect the reader and the
writer to be notified when some data has arrived or when some data have been
read. As far as we know, the OSes that need EMUL_NO_SIGIO_ON_READ are Linux
and SunOS.
 1.29 11-Dec-2000  mycroft branches: 1.29.2;
Introduce 2 new flags in types.h:
* __HAVE_SYSCALL_INTERN. If this is defined, e_syscall is replaced by
e_syscall_intern, which is called at key places in the kernel. This can be
used to set a MD syscall handler pointer. This obsoletes and replaces the
*_HAS_SEPARATED_SYSCALL flags.
* __HAVE_MINIMAL_EMUL. If this is defined, certain (deprecated) elements in
struct emul are omitted.
 1.28 09-Dec-2000  jdolecek always fill in e_syscall in respective emul_*; if the emulation doesn't
have it's own separated *_syscall() function, use syscall()
 1.27 09-Dec-2000  mycroft Get rid of the damn EMUL_GET* flags.
 1.26 01-Dec-2000  jdolecek put aout specific sunos code from sunos_exec.c to separate file
sunos_exec_aout.c
make LKM safe
add EMUL_GETPID_PASS_PPID|EMUL_GETID_PASS_EID to emul_sunos flags
 1.25 01-Dec-2000  jdolecek fix the emulation path
 1.24 01-Dec-2000  jdolecek add e_path (emulation path) to struct emul, which replaces emulation-specific
*_emul_path variables

change macros CHECK_ALT_{CREAT|EXIST} to use that, 'root' doesn't need
to be passed explicitly any more and *_CHECK_ALT_{CREAT|EXIST} are removed
change explicit emul_find() calls in probe functions to get the emulation
path from the checked exec switch entry's emulation

remove no longer needed header files

add e_flags and e_syscall to struct emul; these are unsed and empty for now
 1.23 24-Nov-2000  scw Make these compile with the latest execsw[] changes. Someone with
SunOS binaries needs to test this...
 1.22 21-Nov-2000  jdolecek restructure struct emul and execsw, in preparation to make emulations LKMable:
* move all exec-type specific information from struct emul to execsw[] and
provide single struct emul per emulation
* elf:
- kern/exec_elf32.c:probe_funcs[] is gone, execsw[] how has one entry
per emulation and contains pointer to respective probe function
- interp is allocated via MALLOC() rather than on stack
- elf_args structure is allocated via MALLOC() rather than malloc()
* ecoff: the per-emulation hooks moved from alpha and mips specific code
to OSF1 and Ultrix compat code as appropriate, execsw[] has one entry per
emulation supporting ecoff with appropriate probe function
* the makecmds/probe functions don't set emulation, pointer to emulation is
part of appropriate execsw[] entry
* constify couple of structures
 1.21 13-Nov-2000  jdolecek change the type of *syscallnames[] array to 'const char * const foo[]'
 1.20 28-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.19 06-Jun-2000  soren defopt SYSCALL_DEBUG.
 1.18 11-Apr-2000  chs branches: 1.18.2;
add a new function vn_marktext() for exec code to let others know
that the vnode is now being used as process text.
 1.17 29-Apr-1999  christos branches: 1.17.2;
Need sunos_sigcode and sunos_esigcode now that our sigreturn is
different.
 1.16 01-Apr-1999  drochner branches: 1.16.2;
remove unneeded <vm/*> includes
 1.15 13-Sep-1998  pk Everyone uses sunos_sendsig().
 1.14 09-Aug-1998  mrg use __sparc__ not sparc
 1.13 04-Dec-1997  tv Standardize COMPAT_SUNOS -- remove all references to
sunos_exec_aout_makecmds() in machdep.c for various architectures and put
it in exec_conf.c like the other emulations; rename exec.h to
sunos_exec.h.
 1.12 07-Oct-1996  cgd don't include <machine/exec.h> explicitly. No other changes needed, since
<sys/exec.h> was already being included.
 1.11 05-May-1996  briggs Put prototype for sunos_sendsig() in sunos.h as suggested by veego.
 1.10 14-Mar-1996  christos Bring prototypes into scope and fix compiler warnings.
 1.9 25-Jun-1995  briggs Add sunos_emul_path (/emul/sunos). I don't know if this is correct, but
this will at least aid the compilation step and is similar to the
others.
 1.8 22-Apr-1995  christos - added struct emul to all emulations.
- removed all setup functions.
- added copyargs() functions where needed.
 1.7 25-Oct-1994  deraadt rename, new syscall interface, etc.
 1.6 12-Jul-1994  gwr Avoid some macro redefinitions that have appeared since exec.h
now includes exec_aout.h
 1.5 29-Jun-1994  cgd branches: 1.5.2;
New RCS ID's, take two. they're more aesthecially pleasant, and use 'NetBSD'
 1.4 28-Jan-1994  jtc Fix spelling error in Copyright notice
 1.3 28-Jan-1994  deraadt for new exec, from mw
 1.2 12-Dec-1993  deraadt m68k/sparc sunos binary compatibility code, pulled down from magnum branch
for consumption by the m68k masses
 1.1 28-Nov-1993  deraadt branches: 1.1.2;
compat exec() stuff is done more sensibly now
(hpux and ultrix compat stuff will be done the same way)
 1.1.2.1 28-Nov-1993  deraadt handle the emul mode more carefully.
 1.5.2.1 12-Jul-1994  cgd update from trunk, per gwr & theo
 1.16.2.1 30-Apr-1999  perry branches: 1.16.2.1.2;
pullup 1.16->1.17 (christos)
 1.16.2.1.2.2 04-Jul-1999  chs after setting VTEXT on a vnode, flush any UBC mappings
to try to prevent unnecessary VAC aliases.
 1.16.2.1.2.1 21-Jun-1999  thorpej Sync w/ -current.
 1.17.2.4 13-Dec-2000  bouyer Sync with HEAD (for UBC fixes).
 1.17.2.3 08-Dec-2000  bouyer Sync with HEAD.
 1.17.2.2 22-Nov-2000  bouyer Sync with HEAD.
 1.17.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.18.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.29.2.6 11-Nov-2002  nathanw Catch up to -current
 1.29.2.5 18-Oct-2002  nathanw Catch up to -current.
 1.29.2.4 01-Aug-2002  nathanw Catch up to -current.
 1.29.2.3 14-Nov-2001  nathanw Catch up to -current.
 1.29.2.2 21-Sep-2001  nathanw Catch up to -current.
 1.29.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.34.4.1 01-Oct-2001  fvdl Catch up with -current.
 1.34.2.3 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.34.2.2 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.34.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.36.8.1 15-Jul-2002  gehenna catch up with -current.
 1.40.6.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.40.6.5 01-Apr-2005  skrll Sync with HEAD.
 1.40.6.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.40.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.40.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.40.6.1 03-Aug-2004  skrll Sync with HEAD
 1.45.10.2 26-Mar-2005  yamt sync with head.
 1.45.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.45.8.1 29-Apr-2005  kent sync with -current
 1.46.2.1 18-Sep-2005  tron Pull up following revision(s) (requested by fvdl in ticket #798):
sys/compat/sunos/sunos_exec.c: revision 1.47
sys/compat/pecoff/pecoff_emul.c: revision 1.11
sys/arch/sparc64/sparc64/netbsd32_machdep.c: revision 1.45
sys/arch/amd64/amd64/netbsd32_machdep.c: revision 1.12
sys/sys/proc.h: revision 1.198
sys/compat/mach/mach_exec.c: revision 1.56
sys/compat/freebsd/freebsd_exec.c: revision 1.27
sys/arch/sparc64/include/vmparam.h: revision 1.27
sys/kern/kern_resource.c: revision 1.91
sys/compat/netbsd32/netbsd32_netbsd.c: revision 1.88
sys/compat/osf1/osf1_exec.c: revision 1.39
sys/compat/svr4_32/svr4_32_resource.c: revision 1.5
sys/compat/ultrix/ultrix_misc.c: revision 1.99
sys/compat/svr4_32/svr4_32_exec.h: revision 1.9
sys/kern/exec_elf32.c: revision 1.103
sys/compat/aoutm68k/aoutm68k_exec.c: revision 1.19
sys/compat/sunos32/sunos32_exec.c: revision 1.20
sys/compat/hpux/hpux_exec.c: revision 1.46
sys/compat/darwin/darwin_exec.c: revision 1.40
sys/kern/sysv_shm.c: revision 1.83
sys/uvm/uvm_extern.h: revision 1.99
sys/uvm/uvm_mmap.c: revision 1.89
sys/kern/kern_exec.c: revision 1.195
sys/compat/netbsd32/netbsd32.h: revision 1.31
sys/arch/sparc64/sparc64/svr4_32_machdep.c: revision 1.20
sys/compat/svr4/svr4_exec.c: revision 1.56
sys/compat/irix/irix_exec.c: revision 1.41
sys/compat/ibcs2/ibcs2_exec.c: revision 1.63
sys/compat/svr4_32/svr4_32_exec.c: revision 1.16
sys/arch/amd64/include/vmparam.h: revision 1.8
sys/compat/linux/common/linux_exec.c: revision 1.73
Fix some things regarding COMPAT_NETBSD32 and limits/VM addresses.
* For sparc64 and amd64, define *SIZ32 VM constants.
* Add a new function pointer to struct emul, pointing at a function
that will return the default VM map address. The default function
is uvm_map_defaultaddr, which just uses the VM_DEFAULT_ADDRESS
macro. This gives emulations control over the default map address,
and allows things to be mapped at the right address (in 32bit range)
for COMPAT_NETBSD32.
* Add code to adjust the data and stack limits when a COMPAT_NETBSD32
or COMPAT_SVR4_32 binary is executed.
* Don't use USRSTACK in kern_resource.c, use p_vmspace->vm_minsaddr
instead (emulations might have set it differently)
* Since this changes struct emul, bump kernel version to 3.99.2
Tested on amd64, compile-tested on sparc64.
 1.47.2.2 07-Dec-2007  yamt sync with head
 1.47.2.1 21-Jun-2006  yamt sync with head.
 1.50.56.1 08-Dec-2007  ad Sync with head.
 1.50.52.1 08-Dec-2007  mjf Sync with HEAD.
 1.50.46.1 09-Jan-2008  matt sync with HEAD
 1.50.44.1 09-Dec-2007  jmcneill Sync with HEAD.
 1.51.24.1 19-Jan-2009  skrll Sync with HEAD.
 1.51.22.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.51.16.2 11-Aug-2010  yamt sync with head.
 1.51.16.1 04-May-2009  yamt sync with head.
 1.51.12.1 17-Jan-2009  mjf Sync with HEAD.
 1.52.8.1 05-Mar-2011  rmind sync with head
 1.52.6.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.53.12.1 24-Feb-2012  mrg sync to -current.
 1.53.8.1 17-Apr-2012  yamt sync with head
 1.55.2.2 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.55.2.1 21-May-2018  pgoyette Sync with HEAD
 1.56.2.1 10-Jun-2019  christos Sync with HEAD
 1.11 19-Nov-2008  ad Make the emulations, exec formats, coredump, NFS, and the NFS server
into modules. By and large this commit:

- shuffles header files and ifdefs
- splits code out where necessary to be modular
- adds module glue for each of the components
- adds/replaces hooks for things that can be installed at runtime
 1.10 04-Dec-2007  dsl branches: 1.10.12; 1.10.16; 1.10.22; 1.10.24;
Remove all the __P
 1.9 11-Dec-2005  christos branches: 1.9.44; 1.9.46; 1.9.52; 1.9.56;
merge ktrace-lwp.
 1.8 12-Jul-2005  christos Delete define for sunos_syscall_intern.
 1.7 10-Jul-2005  christos define sunos_syscall_intern now that sparc needs it.
 1.6 29-Jun-2003  fvdl branches: 1.6.2; 1.6.18;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.5 28-Jun-2003  darrenr Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records. The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V
 1.4 26-Nov-2001  fredette Added support for running 68010 SunOS executables.
 1.3 24-Nov-2000  scw branches: 1.3.2; 1.3.4;
Make these compile with the latest execsw[] changes. Someone with
SunOS binaries needs to test this...
 1.2 09-Aug-1998  mrg branches: 1.2.12;
use __sparc__ not sparc
 1.1 04-Dec-1997  tv Standardize COMPAT_SUNOS -- remove all references to
sunos_exec_aout_makecmds() in machdep.c for various architectures and put
it in exec_conf.c like the other emulations; rename exec.h to
sunos_exec.h.
 1.2.12.1 08-Dec-2000  bouyer Sync with HEAD.
 1.3.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.3.2.1 08-Jan-2002  nathanw Catch up to -current.
 1.6.18.2 07-Dec-2007  yamt sync with head
 1.6.18.1 21-Jun-2006  yamt sync with head.
 1.6.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.6.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.6.2.1 02-Jul-2003  darrenr Apply the aborted ktrace-lwp changes to a specific branch. This is just for
others to review, I'm concerned that patch fuziness may have resulted in some
errant code being generated but I'll look at that later by comparing the diff
from the base to the branch with the file I attempt to apply to it. This will,
at the very least, put the changes in a better context for others to review
them and attempt to tinker with removing passing of 'struct lwp' through
the kernel.
 1.9.56.1 08-Dec-2007  ad Sync with head.
 1.9.52.1 08-Dec-2007  mjf Sync with HEAD.
 1.9.46.1 09-Jan-2008  matt sync with HEAD
 1.9.44.1 09-Dec-2007  jmcneill Sync with HEAD.
 1.10.24.1 19-Jan-2009  skrll Sync with HEAD.
 1.10.22.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.10.16.1 04-May-2009  yamt sync with head.
 1.10.12.1 17-Jan-2009  mjf Sync with HEAD.
 1.19 18-Oct-2015  maxv Make sure we have space for the aout header.
 1.18 15-Aug-2009  matt branches: 1.18.22; 1.18.40;
Include <sys/exec_aout.h> explicitly instead of relying on <sys/exec.h> to
do it for you.
 1.17 08-Dec-2007  dsl branches: 1.17.16;
ANSIfy most of the function definitions in sys/compat (but not ndis).
All by the magic of sed ...
 1.16 04-Dec-2007  dsl Remove all the __P
 1.15 19-Oct-2007  ad branches: 1.15.2; 1.15.4;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.14 11-Dec-2005  christos branches: 1.14.30; 1.14.44; 1.14.46; 1.14.50;
merge ktrace-lwp.
 1.13 26-Feb-2005  perry branches: 1.13.4;
nuke trailing whitespace
 1.12 30-Jan-2005  christos Don't try to map a 0 size bss.
 1.11 08-Aug-2003  christos branches: 1.11.8; 1.11.10;
- GC all the setup_stack functions
- add one for linux/i386
 1.10 29-Jun-2003  fvdl branches: 1.10.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.9 29-Jun-2003  darrenr More changes for providing lwpid for ktrace (sparc GENERIC built)
 1.8 28-Jun-2003  darrenr Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records. The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V
 1.7 01-Apr-2003  thorpej Use PAGE_SIZE rather than NBPG.
 1.6 05-Oct-2002  chs count executable image pages as executable for vm-usage purposes.
also, always do the VTEXT vs. v_writecount mutual exclusion
(which we previously skipped if the text or data segment was empty).
 1.5 27-Sep-2002  provos remove trailing \n in panic(). approved perry.
 1.4 26-Nov-2001  fredette branches: 1.4.10;
Added support for running 68010 SunOS executables.
 1.3 13-Nov-2001  lukem add RCSIDs (including regeneration of files as appropriate)
 1.2 30-Oct-2001  thorpej - Add a new vnode flag VEXECMAP, which indicates that a vnode has
executable mappings. Stop overloading VTEXT for this purpose (VTEXT
also has another meaning).
- Rename vn_marktext() to vn_markexec(), and use it when executable
mappings of a vnode are established.
- In places where we want to set VTEXT, set it in v_flag directly, rather
than making a function call to do this (it no longer makes sense to
use a function call, since we no longer overload VTEXT with VEXECMAP's
meaning).

VEXECMAP suggested by Chuq Silvers.
 1.1 01-Dec-2000  jdolecek branches: 1.1.2; 1.1.4; 1.1.6; 1.1.10;
put aout specific sunos code from sunos_exec.c to separate file
sunos_exec_aout.c
 1.1.10.1 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.1.6.2 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.1.6.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.4.3 18-Oct-2002  nathanw Catch up to -current.
 1.1.4.2 08-Jan-2002  nathanw Catch up to -current.
 1.1.4.1 14-Nov-2001  nathanw Catch up to -current.
 1.1.2.2 08-Dec-2000  bouyer Sync with HEAD.
 1.1.2.1 01-Dec-2000  bouyer file sunos_exec_aout.c was added on branch thorpej_scsipi on 2000-12-08 09:08:43 +0000
 1.4.10.2 02-Oct-2003  tron Pull up revision 1.6 (requested by junyoung in ticket #1488):
count executable image pages as executable for vm-usage purposes.
also, always do the VTEXT vs. v_writecount mutual exclusion
(which we previously skipped if the text or data segment was empty).
 1.4.10.1 27-Sep-2003  tron Pull up revision 1.5 (requested by junyoung in ticket #1466):
remove trailing \n in panic(). approved perry.
 1.10.2.8 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.10.2.7 04-Feb-2005  skrll Sync with HEAD.
 1.10.2.6 04-Feb-2005  skrll Adapt to branch.
 1.10.2.5 21-Nov-2004  skrll Adapt to branch.
 1.10.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.10.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.10.2.2 03-Aug-2004  skrll Sync with HEAD
 1.10.2.1 02-Jul-2003  darrenr Apply the aborted ktrace-lwp changes to a specific branch. This is just for
others to review, I'm concerned that patch fuziness may have resulted in some
errant code being generated but I'll look at that later by comparing the diff
from the base to the branch with the file I attempt to apply to it. This will,
at the very least, put the changes in a better context for others to review
them and attempt to tinker with removing passing of 'struct lwp' through
the kernel.
 1.11.10.2 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.11.10.1 12-Feb-2005  yamt sync with head.
 1.11.8.1 29-Apr-2005  kent sync with -current
 1.13.4.4 21-Jan-2008  yamt sync with head
 1.13.4.3 07-Dec-2007  yamt sync with head
 1.13.4.2 27-Oct-2007  yamt sync with head.
 1.13.4.1 21-Jun-2006  yamt sync with head.
 1.14.50.1 25-Oct-2007  bouyer Sync with HEAD.
 1.14.46.2 09-Jan-2008  matt sync with HEAD
 1.14.46.1 06-Nov-2007  matt sync with HEAD
 1.14.44.2 09-Dec-2007  jmcneill Sync with HEAD.
 1.14.44.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.14.30.1 23-Oct-2007  ad Sync with head.
 1.15.4.2 26-Dec-2007  ad Sync with head.
 1.15.4.1 08-Dec-2007  ad Sync with head.
 1.15.2.2 27-Dec-2007  mjf Sync with HEAD.
 1.15.2.1 08-Dec-2007  mjf Sync with HEAD.
 1.17.16.1 19-Aug-2009  yamt sync with head.
 1.18.40.1 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.18.22.1 03-Dec-2017  jdolecek update from HEAD
 1.10 27-Apr-1995  christos Try to make the reboot system call compile under sun3 with RB_STRING
support [not tested]
Add files.sunos
Rename system call switch table file from sunos_init_sysent.c to sunos_sysent.c
like other emulations.
 1.9 22-Apr-1995  christos syscalls.master was changed
 1.8 22-Apr-1995  christos - added struct emul to all emulations.
- removed all setup functions.
- added copyargs() functions where needed.
 1.7 06-Dec-1994  deraadt update
 1.6 26-Nov-1994  deraadt update
 1.5 20-Nov-1994  deraadt new syscalls
 1.4 14-Nov-1994  deraadt syscalls.master changed
 1.3 26-Oct-1994  deraadt update
 1.2 25-Oct-1994  deraadt and we update these
 1.1 25-Oct-1994  deraadt and these
 1.71 07-Sep-2021  riastradh sys/compat: Memset zero before copyout.

Just in case of uninitialized padding which would lead to kernel
stack disclosure. If the compiler can prove the memset redundant
then it can optimize it away; otherwise better safe than sorry.
 1.70 23-Sep-2019  christos Add missing break
 1.69 23-Apr-2019  msaitoh branches: 1.69.2;
KNF. No functional change.
 1.68 08-Oct-2016  maxv branches: 1.68.8; 1.68.16;
Uninitialized var, found by mootja; not tested, but obvious enough
 1.67 12-Dec-2015  nakayama branches: 1.67.2;
Redo previous. zero check before modulo.
 1.66 11-Dec-2015  mlelstv d_secpercyl is gone and we use the value from disklabel anyway.
 1.65 11-Dec-2015  mlelstv PR 50518 bad switch
 1.64 08-Dec-2015  christos Replace DIOCGPART -> DIOCGPARTINFO which returns the data needed instead of
pointers.
 1.63 26-Sep-2015  christos rename sun ioctls
 1.62 05-Sep-2014  matt branches: 1.62.2;
Try not to use f_data, use f_{vnode,socket,pipe,mqueue,kqueue,ksem} to get
a correctly typed pointer.
 1.61 19-Nov-2008  ad branches: 1.61.26;
Make the emulations, exec formats, coredump, NFS, and the NFS server
into modules. By and large this commit:

- shuffles header files and ifdefs
- splits code out where necessary to be modular
- adds module glue for each of the components
- adds/replaces hooks for things that can be installed at runtime
 1.60 21-Mar-2008  ad branches: 1.60.4; 1.60.6; 1.60.10; 1.60.12;
Catch up with descriptor handling changes. See kern_descrip.c revision
1.173 for details.
 1.59 20-Dec-2007  dsl branches: 1.59.6;
Convert all the system call entry points from:
int foo(struct lwp *l, void *v, register_t *retval)
to:
int foo(struct lwp *l, const struct foo_args *uap, register_t *retval)
Fixup compat code to not write into 'uap' and (in some cases) to actually
pass a correctly formatted 'uap' structure with the right name to the
next routine.
A few 'compat' routines that just call standard ones have been deleted.
All the 'compat' code compiles (along with the kernels required to test
build it).
98% done by automated scripts.
 1.58 08-Dec-2007  dsl branches: 1.58.4;
ANSIfy most of the function definitions in sys/compat (but not ndis).
All by the magic of sed ...
 1.57 04-Dec-2007  dsl Remove all the __P
 1.56 01-Jun-2007  he branches: 1.56.6; 1.56.8; 1.56.14; 1.56.16;
Fallout from the interface ioctl changes:

OSIOCGIFADDR -> OOSIOCGIFADDR
OSIOCGIFDSTADDR -> OOSIOCGIFDSTADDR
OSIOCGIFNETMASK -> OOSIOCGIFNETMASK

Also, one instance of needing to include <net/if.h> before
<compat/sys/sockio.h> due to use of IFNAMSIZ in the latter.

Discussed with christos.
 1.55 29-May-2007  christos Add a sockaddr_storage member to "struct ifreq" maintaining backwards
compatibility with the older ioctls. This avoids stack smashing and
abuse of "struct sockaddr" when ioctls placed "struct sockaddr_foo's" that
were longer than "struct sockaddr".
XXX: Some of the emulations might be broken; I tried to add code for
them but I did not test them.
 1.54 12-May-2007  dsl Split the fcntl locking code out from its copyin/out.
Use to avoid all the stackgap stuff in compat code.
 1.53 04-Mar-2007  christos branches: 1.53.2; 1.53.4;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.52 09-Feb-2007  ad branches: 1.52.2;
Merge newlock2 to head.
 1.51 11-Dec-2005  christos branches: 1.51.20;
merge ktrace-lwp.
 1.50 02-Jun-2005  tsutsui branches: 1.50.2;
Fix shadow warnings.
 1.49 01-Jun-2004  pk sunos_ioctl(): acquire a reference to the file.
This also fixes a locking botch reported in PR#25738.
 1.48 25-Apr-2004  matt Constify the speedtab arrays
 1.47 29-Jun-2003  fvdl branches: 1.47.2; 1.47.4;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.46 29-Jun-2003  darrenr More changes for providing lwpid for ktrace (sparc GENERIC built)
 1.45 21-Mar-2003  dsl Change 'data' argument to fo_ioctl and fo_fcntl from 'caddr_t' to 'void *'.
Avoids a lot of casting and removes the need for some line breaks.
Removed a load of (caddr_t) casts from calls to copyin/copyout as well.
(approved by christos - he has a plan to remove caddr_t...)
 1.44 23-Feb-2003  pk Make updating a file's reference and use count MP-safe.
 1.43 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.42 04-Jan-2003  wiz Spell output with two ts.
 1.41 30-May-2002  thorpej Statements must follow labels.
 1.40 16-Mar-2002  christos branches: 1.40.4; 1.40.6;
make the stackgap_{init,alloc} functions MP friendly (i.e. pass struct proc *
in, instead of using curproc). While there add an optional size argument to
stackgap_init.
 1.39 02-Mar-2002  mrg move the COMPAT_SUNOS TIOCGPGRP handling in the compat sunos code proper.
this is the final fix needed for it to run properly as an LKM. no more
COMPAT_SUNOS hacks around the tree!
 1.38 13-Nov-2001  lukem add RCSIDs (including regeneration of files as appropriate)
 1.37 14-Jun-2001  thorpej branches: 1.37.2;
Fix a partial construction problem that can cause race conditions
between creation of a file descriptor and close(2) when using kernel
assisted threads. What we do is stick descriptors in the table, but
mark them as "larval". This causes essentially everything to treat
it as a non-existent descriptor, except for fdalloc(), which sees a
filled slot so that it won't (incorrectly) allocate it again. When
a descriptor is fully constructed, the code that has constructed it
marks it as "mature" (which actually clears the "larval" flag), and
things continue to work as normal.

While here, gather all the code that gets a descriptor from the table
into a fd_getfile() function, and call it, rather than having the
same (sometimes incorrect) code copied all over the place.
 1.36 30-May-2001  mrg use _KERNEL_OPT.
 1.35 03-Feb-2001  mrg branches: 1.35.2;
add missing !LKM check, noted by <tih@kpnQwest.no>
 1.34 02-Feb-2001  mrg sunos_ioctl.c is included by sunos32_ioctl.c. include the sunos32 &
netbsd32 headers if we are in sunos32 mode.
 1.33 01-Dec-2000  jdolecek add e_path (emulation path) to struct emul, which replaces emulation-specific
*_emul_path variables

change macros CHECK_ALT_{CREAT|EXIST} to use that, 'root' doesn't need
to be passed explicitly any more and *_CHECK_ALT_{CREAT|EXIST} are removed
change explicit emul_find() calls in probe functions to get the emulation
path from the checked exec switch entry's emulation

remove no longer needed header files

add e_flags and e_syscall to struct emul; these are unsed and empty for now
 1.32 27-Jul-2000  mrg fix LP64 warnings.
 1.31 30-Mar-2000  augustss Kill register declarations.
 1.30 09-Aug-1998  perry branches: 1.30.12;
bzero->memset, bcopy->memcpy, bcmp->memcmp
 1.29 20-Jun-1998  mrg use <dev/sun/disklabel.h> for new (old) compat ioctls: DKIOCGGEOM, DKIOCINFO and DKIOCGPART
 1.28 11-Dec-1997  pk Pull in fcntl GETLK/SETLK/UNLK compat functions from SVR4 sibling.
 1.27 19-Oct-1997  is - Doesn't need to privately define AUDIO_SPEAKER and AUDIO_HEADPHONE any
longer.
- XXX Don't access the nonexistant backlog structure element.
 1.26 11-May-1997  jeremy Ignore use of sunos_audioio.monitor_gain because it has no equivalent in the
audio sub-system. It used to use the ``__spare'' member of the audio_info
struct, but that has been removed.
 1.25 02-Jul-1996  pk Translate EIO to ENOTTY after a SunOS `TIOCGETPGRP' (tcgetpgrp(3)) fails
on a pty (see also kern/pty_tty.c).
 1.24 26-May-1996  pk I_SIGSET => I_SETSIG (pointed out by Greg Earle).
 1.23 14-Mar-1996  christos Bring prototypes into scope and fix compiler warnings.
 1.22 28-Feb-1996  pk Insert sunos_sys_fcntl().
 1.21 07-Oct-1995  mycroft Prefix names of system call implementation functions with `sys_'.
 1.20 19-Sep-1995  thorpej Make system calls conform to a standard prototype and bring those
prototypes into scope.
 1.19 11-Jun-1995  pk Go with the flow; use `/emul/sunos' pseudo-root (from Matthew Green).
Note: sunos_stat() and sunos_lstat() were added too.
 1.18 04-May-1995  pk init `mode' field in sunaudiogetinfo().
 1.17 02-Apr-1995  pk Fix TCGETA compat, from Matthew Green.
SunOS `setaudioinfo' does implicit `getaudioinfo'.
Recognise streams flush/setsig ioctls.
 1.16 04-Mar-1995  pk Move SunOS audio_info compat stuff here (from sparc/dev/bsd_audio.c).
 1.15 20-Nov-1994  deraadt improve VMIN/VTIME emulation (from chs+@CS.cmu.edu)
 1.14 31-Oct-1994  deraadt fix CS[5678] code
 1.13 25-Oct-1994  deraadt rename, new syscall interface, etc.
 1.12 20-Oct-1994  cgd pay a small amount of lip service to the new syscall args mechanism.
In reality, none of these will compile.
 1.11 29-Jun-1994  cgd New RCS ID's, take two. they're more aesthecially pleasant, and use 'NetBSD'
 1.10 21-May-1994  deraadt bail on SIOCGARP
 1.9 26-Apr-1994  pk Fix typo.
Give TIOCTCNTL a try.
 1.8 28-Jan-1994  jtc Fix spelling error in Copyright notice
 1.7 15-Jan-1994  deraadt sync with magnum
 1.6 12-Dec-1993  deraadt m68k/sparc sunos binary compatibility code, pulled down from magnum branch
for consumption by the m68k masses
 1.5 22-Nov-1993  deraadt branches: 1.5.2;
moved from arch/sparc/sunos to compat/sunos
 1.4 20-Nov-1993  deraadt fake support for TIOCSSOFTCAR and TIOCGSOFTCAR
(one of which used to point to NetBSD's TIOCSTAT :-)
 1.3 14-Nov-1993  deraadt disassembly shows the %f2 register being accessed, and of course the
kernel panics.
why wasit using %f2? some expressions were too complicated and gcc2 (with
the optimizer off, mind you) ran out of integer registers and thus used
started using a float register for a temporary.
 1.2 10-Nov-1993  deraadt replacement set of sun ioctl functions. markus wild added a
whole slew of new ioctl's that are much more close to reality.

the comat-sunos tree is now almost good enough to be used in
both m68k and sparc kernels.
 1.1 02-Oct-1993  deraadt Chris Torek's sparc port. Missing lots of things.
 1.5.2.3 28-Dec-1993  pk Pass address of argument in TIOCSIG ioctl function.
One EOPNOTSUPP => ENODEV on tty descriptors.
 1.5.2.2 30-Nov-1993  pk One more ioctl translation (TIOCSIGNAL).
 1.5.2.1 28-Nov-1993  deraadt initial SIOC* support from pk. needs more work.
 1.30.12.3 11-Feb-2001  bouyer Sync with HEAD.
 1.30.12.2 08-Dec-2000  bouyer Sync with HEAD.
 1.30.12.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.35.2.8 07-Jan-2003  thorpej Sync with HEAD.
 1.35.2.7 12-Jul-2002  nathanw No longer need to pull in lwp.h; proc.h pulls it in for us.
 1.35.2.6 20-Jun-2002  nathanw Catch up to -current.
 1.35.2.5 29-May-2002  nathanw #include <sys/sa.h> before <sys/syscallargs.h>, to provide sa_upcall_t
now that <sys/param.h> doesn't include <sys/sa.h>.

(Behold the Power of Ed)
 1.35.2.4 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.35.2.3 15-Nov-2001  pk LWP system call signature conversion.
 1.35.2.2 14-Nov-2001  nathanw Catch up to -current.
 1.35.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.37.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.37.2.2 16-Mar-2002  jdolecek Catch up with -current.
 1.37.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.40.6.1 30-May-2002  tv Pull up revision 1.41 (requested by thorpej in ticket #92):
Statements must follow labels.
 1.40.4.1 20-Jun-2002  gehenna catch up with -current.
 1.47.4.1 04-Jun-2004  jmc Pullup rev 1.49 (requested by pk in ticket #434)

sunos_ioctl(): acquire a reference to the file. PR#25738
 1.47.2.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.47.2.4 21-Nov-2004  skrll Adapt to branch.
 1.47.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.47.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.47.2.1 03-Aug-2004  skrll Sync with HEAD
 1.50.2.6 24-Mar-2008  yamt sync with head.
 1.50.2.5 21-Jan-2008  yamt sync with head
 1.50.2.4 07-Dec-2007  yamt sync with head
 1.50.2.3 03-Sep-2007  yamt sync with head.
 1.50.2.2 26-Feb-2007  yamt sync with head.
 1.50.2.1 21-Jun-2006  yamt sync with head.
 1.51.20.1 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.52.2.2 17-May-2007  yamt sync with head.
 1.52.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.53.4.1 11-Jul-2007  mjf Sync with head.
 1.53.2.2 09-Jun-2007  ad Sync with head.
 1.53.2.1 27-May-2007  ad Sync with head.
 1.56.16.2 26-Dec-2007  ad Sync with head.
 1.56.16.1 08-Dec-2007  ad Sync with head.
 1.56.14.2 27-Dec-2007  mjf Sync with HEAD.
 1.56.14.1 08-Dec-2007  mjf Sync with HEAD.
 1.56.8.1 09-Jan-2008  matt sync with HEAD
 1.56.6.1 09-Dec-2007  jmcneill Sync with HEAD.
 1.58.4.1 02-Jan-2008  bouyer Sync with HEAD
 1.59.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.59.6.1 03-Apr-2008  mjf Sync with HEAD.
 1.60.12.1 19-Jan-2009  skrll Sync with HEAD.
 1.60.10.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.60.6.2 14-May-2008  wrstuden Per discussion with ad, remove most of the #include <sys/sa.h> lines
as they were including sa.h just for the type(s) needed for syscallargs.h.

Instead, create a new file, sys/satypes.h, which contains just the
types needed for syscallargs.h. Yes, there's only one now, but that
may change and it's probably more likely to change if it'd be difficult
to handle. :-)

Per discussion with matt at n dot o, add an include of satypes.h to
sigtypes.h. Upcall handlers are kinda signal handlers, and signalling
is the header file that's already included for syscallargs.h that
closest matches SA.

This shaves about 3000 lines off of the diff of the branch relative
to the base. That also represents about 18% of the total before this
checkin.

I think this reduction is very good thing.
 1.60.6.1 10-May-2008  wrstuden Initial checkin of re-adding SA. Everything except kern_sa.c
compiles in GENERIC for i386. This is still a work-in-progress, but
this checkin covers most of the mechanical work (changing signalling
to be able to accomidate SA's process-wide signalling and re-adding
includes of sys/sa.h and savar.h). Subsequent changes will be much
more interesting.

Also, kern_sa.c has received partial cleanup. There's still more
to do, though.
 1.60.4.1 04-May-2009  yamt sync with head.
 1.61.26.1 03-Dec-2017  jdolecek update from HEAD
 1.62.2.2 05-Dec-2016  skrll Sync with HEAD
 1.62.2.1 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.67.2.1 04-Nov-2016  pgoyette Sync with HEAD
 1.68.16.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.68.16.1 10-Jun-2019  christos Sync with HEAD
 1.68.8.1 21-Jun-2023  martin Pull up following revision(s) (requested by riastradh in ticket #1836):

sys/compat/linux/arch/i386/linux_machdep.c: revision 1.168
sys/compat/sunos/sunos_misc.c: revision 1.177
sys/compat/netbsd32/netbsd32_compat_50.c: revision 1.52
sys/compat/common/kern_resource_43.c: revision 1.23
sys/compat/netbsd32/netbsd32_conv.h: revision 1.46
sys/compat/linux/arch/i386/linux_ptrace.c: revision 1.35
sys/compat/common/vfs_syscalls_12.c: revision 1.38
sys/compat/ultrix/ultrix_misc.c: revision 1.126
sys/compat/common/kern_sig_43.c: revision 1.37
sys/compat/linux/common/linux_mtio.c: revision 1.8
sys/compat/freebsd/freebsd_misc.c: revision 1.34
sys/compat/linux/common/linux_olduname.c: revision 1.67
sys/compat/linux/arch/mips/linux_machdep.c: revision 1.44
sys/compat/freebsd/freebsd_sched.c: revision 1.23
sys/compat/ossaudio/ossaudio.c: revision 1.84
sys/compat/sys/time_types.h: revision 1.6
sys/compat/linux/arch/powerpc/linux_machdep.c: revision 1.51
sys/compat/linux/common/linux_file.c: revision 1.119
sys/compat/linux/arch/arm/linux_machdep.c: revision 1.34
sys/compat/netbsd32/netbsd32_wait.c: revision 1.25
sys/compat/linux32/common/linux32_time.c: revision 1.38
sys/compat/linux/arch/powerpc/linux_ptrace.c: revision 1.33
sys/compat/linux/arch/alpha/linux_machdep.c: revision 1.52
sys/compat/linux32/arch/amd64/linux32_machdep.c: revision 1.46
sys/compat/netbsd32/netbsd32_compat_12.c: revision 1.36
sys/compat/ultrix/ultrix_ioctl.c: revision 1.39
sys/compat/linux/common/linux_misc.c: revision 1.252
sys/compat/linux/common/linux_hdio.c: revision 1.19
sys/compat/sunos/sunos_ioctl.c: revision 1.71
sys/compat/linux/common/linux_sched.c: revision 1.79
sys/compat/common/kern_info_43.c: revision 1.40
sys/compat/linux32/common/linux32_exec_elf32.c: revision 1.20
sys/compat/linux/common/linux_socket.c: revision 1.153
sys/compat/linux/arch/amd64/linux_machdep.c: revision 1.60
sys/compat/common/vfs_syscalls_43.c: revision 1.68
sys/compat/linux/arch/powerpc/linux_exec_powerpc.c: revision 1.25
sys/compat/netbsd32/netbsd32_ptrace.c: revision 1.9
sys/compat/common/kern_time_50.c: revision 1.37
sys/compat/netbsd32/netbsd32_compat_20.c: revision 1.42
sys/compat/linux/common/linux_cdrom.c: revision 1.28
sys/compat/linux/arch/m68k/linux_machdep.c: revision 1.43
sys/compat/common/kern_info_09.c: revision 1.22
sys/compat/linux32/common/linux32_resource.c: revision 1.12
sys/compat/linux/common/linux_oldolduname.c: revision 1.67
sys/compat/netbsd32/netbsd32_nfssvc.c: revision 1.8
sys/compat/linux32/common/linux32_signal.c: revision 1.21
sys/compat/common/kern_sig_13.c: revision 1.22
sys/compat/sunos32/sunos32_ioctl.c: revision 1.36
sys/compat/netbsd32/netbsd32_compat_43.c: revision 1.62
sys/compat/linux/arch/arm/linux_ptrace.c: revision 1.23
sys/compat/netbsd32/netbsd32_time.c: revision 1.56
sys/compat/linux/common/linux_signal.c: revision 1.84
sys/compat/netbsd32/netbsd32_signal.c: revision 1.52
sys/compat/sunos32/sunos32_misc.c: revision 1.85
sys/compat/linux/common/linux_time.c: revision 1.40
sys/compat/linux/common/linux_fdio.c: revision 1.14
sys/compat/common/vfs_syscalls_30.c: revision 1.43

sys/compat: Memset zero before copyout.

Just in case of uninitialized padding which would lead to kernel
stack disclosure. If the compiler can prove the memset redundant
then it can optimize it away; otherwise better safe than sorry.
 1.69.2.1 03-Aug-2022  martin Pull up following revision(s), all via patch
(requested by riastradh in ticket #1487):

sys/compat/linux/arch/i386/linux_machdep.c: revision 1.168
sys/compat/sunos/sunos_misc.c: revision 1.177
sys/compat/netbsd32/netbsd32_compat_50.c: revision 1.52
sys/compat/common/kern_resource_43.c: revision 1.23
sys/compat/netbsd32/netbsd32_conv.h: revision 1.46
sys/compat/linux/arch/i386/linux_ptrace.c: revision 1.35
sys/compat/common/vfs_syscalls_12.c: revision 1.38
sys/compat/ultrix/ultrix_misc.c: revision 1.126
sys/compat/common/kern_sig_43.c: revision 1.37
sys/compat/linux/common/linux_mtio.c: revision 1.8
sys/compat/freebsd/freebsd_misc.c: revision 1.34
sys/compat/freebsd/freebsd_machdep.c: revision 1.5
sys/compat/linux/common/linux_olduname.c: revision 1.67
sys/compat/linux/arch/mips/linux_machdep.c: revision 1.44
sys/compat/freebsd/freebsd_sched.c: revision 1.23
sys/compat/ossaudio/ossaudio.c: revision 1.84
sys/compat/sys/time_types.h: revision 1.6
sys/compat/linux/arch/powerpc/linux_machdep.c: revision 1.51
sys/compat/common/ieee80211_20.c: revision 1.7
sys/compat/linux/common/linux_file.c: revision 1.119
sys/compat/linux/arch/arm/linux_machdep.c: revision 1.34
sys/compat/netbsd32/netbsd32_wait.c: revision 1.25
sys/compat/linux32/common/linux32_time.c: revision 1.38
sys/compat/linux/arch/powerpc/linux_ptrace.c: revision 1.33
sys/compat/linux/arch/alpha/linux_machdep.c: revision 1.52
sys/compat/linux32/arch/amd64/linux32_machdep.c: revision 1.46
sys/compat/netbsd32/netbsd32_compat_12.c: revision 1.36
sys/compat/ultrix/ultrix_ioctl.c: revision 1.39
sys/compat/linux/common/linux_misc.c: revision 1.252
sys/compat/linux/common/linux_hdio.c: revision 1.19
sys/compat/sunos/sunos_ioctl.c: revision 1.71
sys/compat/linux/common/linux_sched.c: revision 1.79
sys/compat/common/kern_info_43.c: revision 1.40
sys/compat/linux32/common/linux32_exec_elf32.c: revision 1.20
sys/compat/linux/common/linux_socket.c: revision 1.153
sys/compat/linux/arch/amd64/linux_machdep.c: revision 1.60
sys/compat/common/vfs_syscalls_43.c: revision 1.68
sys/compat/linux/arch/powerpc/linux_exec_powerpc.c: revision 1.25
sys/compat/netbsd32/netbsd32_ptrace.c: revision 1.9
sys/compat/common/kern_time_50.c: revision 1.37
sys/compat/netbsd32/netbsd32_compat_20.c: revision 1.42
sys/compat/linux/common/linux_cdrom.c: revision 1.28
sys/compat/linux/arch/m68k/linux_machdep.c: revision 1.43
sys/compat/common/kern_info_09.c: revision 1.22
sys/compat/linux32/common/linux32_resource.c: revision 1.12
sys/compat/linux/common/linux_oldolduname.c: revision 1.67
sys/compat/common/if_media_80.c: revision 1.4
sys/compat/linux/arch/alpha/linux_osf1.c: revision 1.5
sys/compat/netbsd32/netbsd32_nfssvc.c: revision 1.8
sys/compat/linux32/common/linux32_signal.c: revision 1.21
sys/compat/common/kern_sig_13.c: revision 1.22
sys/compat/sunos32/sunos32_ioctl.c: revision 1.36
sys/compat/netbsd32/netbsd32_compat_43.c: revision 1.62
sys/compat/linux/arch/arm/linux_ptrace.c: revision 1.23
sys/compat/netbsd32/netbsd32_time.c: revision 1.56
sys/compat/linux/common/linux_signal.c: revision 1.84
sys/compat/netbsd32/netbsd32_signal.c: revision 1.52
sys/compat/sunos32/sunos32_misc.c: revision 1.85
sys/compat/linux/common/linux_time.c: revision 1.40
sys/compat/linux/common/linux_fdio.c: revision 1.14
sys/compat/common/vfs_syscalls_30.c: revision 1.43

sys/compat: Memset zero before copyout.

Just in case of uninitialized padding which would lead to kernel
stack disclosure. If the compiler can prove the memset redundant
then it can optimize it away; otherwise better safe than sorry.
 1.177 07-Sep-2021  riastradh sys/compat: Memset zero before copyout.

Just in case of uninitialized padding which would lead to kernel
stack disclosure. If the compiler can prove the memset redundant
then it can optimize it away; otherwise better safe than sorry.
 1.176 26-Oct-2019  christos use strlcpy() for the uts conversion, makes the code simpler and more readable.
 1.175 04-Oct-2019  mrg replace memcpy() with src bounds overflow with single char write.
 1.174 23-Sep-2019  christos make this compile again.
 1.173 03-Jul-2019  dholland branches: 1.173.2;
Stack buffers mustn't escape their scope. PR 54326 from David Binderman
 1.172 03-Sep-2018  riastradh Rename min/max -> uimin/uimax for better honesty.

These functions are defined on unsigned int. The generic name
min/max should not silently truncate to 32 bits on 64-bit systems.
This is purely a name change -- no functional change intended.

HOWEVER! Some subsystems have

#define min(a, b) ((a) < (b) ? (a) : (b))
#define max(a, b) ((a) > (b) ? (a) : (b))

even though our standard name for that is MIN/MAX. Although these
may invite multiple evaluation bugs, these do _not_ cause integer
truncation.

To avoid `fixing' these cases, I first changed the name in libkern,
and then compile-tested every file where min/max occurred in order to
confirm that it failed -- and thus confirm that nothing shadowed
min/max -- before changing it.

I have left a handful of bootloaders that are too annoying to
compile-test, and some dead code:

cobalt ews4800mips hp300 hppa ia64 luna68k vax
acorn32/if_ie.c (not included in any kernels)
macppc/if_gm.c (superseded by gem(4))

It should be easy to fix the fallout once identified -- this way of
doing things fails safe, and the goal here, after all, is to _avoid_
silent integer truncations, not introduce them.

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate. But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all. (Who knows, maybe in some cases integer
truncation is actually intended!)
 1.171 28-Jul-2017  riastradh branches: 1.171.2; 1.171.4;
Fail, don't panic, on bad dirents from file system.

Controllable via puffs from userland.

From Ilja Van Sprundel.
 1.170 23-Oct-2015  maxv branches: 1.170.10;
Change do_sys_mount() so that it only takes as argument the type of the
drive instead of its associated vfsops. Makes it more friendly, and allows
compat binaries to autoload VFS modules if needed.

sent on tech-kern@, ok christos@
 1.169 05-Sep-2014  matt branches: 1.169.2;
Try not to use f_data, use f_{vnode,socket,pipe,mqueue,kqueue,ksem} to get
a correctly typed pointer.
 1.168 24-Jun-2010  hannken branches: 1.168.14; 1.168.18; 1.168.20; 1.168.28; 1.168.34; 1.168.36; 1.168.40;
Clean up vnode lock operations pass 2:

VOP_UNLOCK(vp, flags) -> VOP_UNLOCK(vp): Remove the unneeded flags argument.

Welcome to 5.99.32.

Discussed on tech-kern.
 1.167 03-Mar-2010  pooka branches: 1.167.2;
One more overcomplex ENOSYS bites the dust.
 1.166 03-Mar-2010  he When implementing "read directory", when there are too many empty entries
in a row, and we need to try to read the next block, and have passed a
non-NULL cookie pointer to VOP_READDIR, ensure that we free the cookie
buffer before re-doing VOP_READDIR, so that we don't leak memory.
This fix is similar to nfs_serv.c revisions 1.115 + 1.124.

This should fix the long-standing problem observed by e.g. using Linux-
emulated programs to take backup of servers, which is one of the problems
which were reported in PR#42661.

Thanks to pooka@ for the hints for traversing the VOP* layer.
 1.165 29-Jun-2009  dholland branches: 1.165.2;
Convert 67 namei call sites to use namei_simple, in these functions:

check_console, veriexecclose, veriexec_delete, veriexec_file_add,
emul_find_root, coff_load_shlib (sh3 version), coff_load_shlib,
compat_20_sys_statfs, compat_20_netbsd32_statfs,
ELFNAME2(netbsd32,probe_noteless), darwin_sys_statfs,
ibcs2_sys_statfs, ibcs2_sys_statvfs, linux_sys_uselib,
osf1_sys_statfs, sunos_sys_statfs, sunos32_sys_statfs,
ultrix_sys_statfs, do_sys_mount, fss_create_files (3 of 4),
adosfs_mount, cd9660_mount, coda_ioctl, coda_mount, ext2fs_mount,
ffs_mount, filecore_mount, hfs_mount, lfs_mount, msdosfs_mount,
ntfs_mount, sysvbfs_mount, udf_mount, union_mount, sys_chflags,
sys_lchflags, sys_chmod, sys_lchmod, sys_chown, sys_lchown,
sys___posix_chown, sys___posix_lchown, sys_link, do_sys_pstatvfs,
sys_quotactl, sys_revoke, sys_truncate, do_sys_utimes, sys_extattrctl,
sys_extattr_set_file, sys_extattr_set_link, sys_extattr_get_file,
sys_extattr_get_link, sys_extattr_delete_file,
sys_extattr_delete_link, sys_extattr_list_file, sys_extattr_list_link,
sys_setxattr, sys_lsetxattr, sys_getxattr, sys_lgetxattr,
sys_listxattr, sys_llistxattr, sys_removexattr, sys_lremovexattr

All have been scrutinized (several times, in fact) and compile-tested,
but not all have been explicitly tested in action.

XXX: While I haven't (intentionally) changed the use or nonuse of
XXX: TRYEMULROOT in any of these places, I'm not convinced all the
XXX: uses are correct; an audit might be desirable.
 1.164 11-Jan-2009  tsutsui branches: 1.164.2;
Update for compat_50 stuff. (compile test only)
 1.163 19-Nov-2008  ad Make the emulations, exec formats, coredump, NFS, and the NFS server
into modules. By and large this commit:

- shuffles header files and ifdefs
- splits code out where necessary to be modular
- adds module glue for each of the components
- adds/replaces hooks for things that can be installed at runtime
 1.162 12-Nov-2008  ad Remove LKMs and switch to the module framework, pass 1.

Proposed on tech-kern@.
 1.161 07-Aug-2008  plunky branches: 1.161.2; 1.161.4; 1.161.8;
convert some [left behind] compat code to use new sockopt API
 1.160 24-Jun-2008  ad branches: 1.160.2;
Replace references to getsock/getvnode.
 1.159 21-Mar-2008  ad branches: 1.159.4; 1.159.6; 1.159.8;
Catch up with descriptor handling changes. See kern_descrip.c revision
1.173 for details.
 1.158 27-Dec-2007  martin branches: 1.158.6;
Remove now superflous (and wrong) extern declaration for maxfiles.
 1.157 20-Dec-2007  dsl Convert all the system call entry points from:
int foo(struct lwp *l, void *v, register_t *retval)
to:
int foo(struct lwp *l, const struct foo_args *uap, register_t *retval)
Fixup compat code to not write into 'uap' and (in some cases) to actually
pass a correctly formatted 'uap' structure with the right name to the
next routine.
A few 'compat' routines that just call standard ones have been deleted.
All the 'compat' code compiles (along with the kernels required to test
build it).
98% done by automated scripts.
 1.156 08-Dec-2007  pooka branches: 1.156.4;
Remove cn_lwp from struct componentname. curlwp should be used
from on. The NDINIT() macro no longer takes the lwp parameter and
associates the credentials of the calling thread with the namei
structure.
 1.155 08-Dec-2007  dsl ANSIfy most of the function definitions in sys/compat (but not ndis).
All by the magic of sed ...
 1.154 04-Dec-2007  dsl Remove all the __P
 1.153 27-Nov-2007  dogcow branches: 1.153.2;
more VFS_STATVFS(x,y,z) fallout; change them to VFS_STATVFS(x,y). (hi, pooka!)
 1.152 08-Oct-2007  ad branches: 1.152.4;
Merge file descriptor locking, cwdi locking and cross-call changes
from the vmlocking branch.
 1.151 17-Jul-2007  christos branches: 1.151.6; 1.151.8; 1.151.10;
include <compat/sys/mount.h> for MFSNAMELEN
 1.150 12-Jul-2007  dsl Change compat mount code to pass do_sys_mount() kernel resident buffers.
Possibly the standard nfs code needs teaching how to set the length and
address family in order to support non-netbsd sockaddr.
There are now no active stackgap() calls in the compat tree.
 1.149 12-May-2007  dsl Change interface to settimeofday1() so that it can also be used from
compat code in order to avoid the stackgap.
 1.148 28-Apr-2007  dogcow and unbork some more changes.
 1.147 22-Apr-2007  dsl Change the way that emulations locate files within the emulation root to
avoid having to allocate space in the 'stackgap'
- which is very LWP unfriendly.
The additional code for non-emulation namei() is trivial, the reduction for
the emulations is massive.
The vnode for a processes emulation root is saved in the cwdi structure
during process exec.
If the emulation root the TRYEMULROOT flag are set, namei() will do an initial
search for absolute pathnames in the emulation root, if that fails it will
retry from the normal root.
".." at the emulation root will always go to the real root, even in the middle
of paths and when expanding symlinks.
Absolute symlinks found using absolute paths in the emulation root will be
relative to the emulation root (so /usr/lib/xxx.so -> /lib/xxx.so links
inside the emulation root don't need changing).
If the root of the emulation would be returned (for an emulation lookup), then
the real root is returned instead (matching the behaviour of emul_lookup,
but being a cheap comparison here) so that programs that scan "../.."
looking for the root dircetory don't loop forever.
The target for symbolic links is no longer mangled (it used to get the
CHECK_ALT_xxx() treatment, so could get /emul/xxx prepended).
CHECK_ALT_xxx() are no more. Most of the change is deleting them, and adding
TRYEMULROOT to the flags to NDINIT().
A lot of the emulation system call stubs could now be deleted.
 1.146 04-Mar-2007  tsutsui branches: 1.146.2; 1.146.4;
- don't forget to add * to all params
- use (char *) where pointer arith is required
 1.145 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.144 09-Feb-2007  ad branches: 1.144.2;
Merge newlock2 to head.
 1.143 14-Nov-2006  elad branches: 1.143.2;
Clean some KAUTH_GENERIC_ISSUSER usage in compat code.
 1.142 01-Sep-2006  matt branches: 1.142.2; 1.142.4;
When calling PTRACE from an LKM, use sysent[SYS_ptrace].sy_call in case
the sys_ptrace symbol isn't present.
 1.141 30-Aug-2006  he Update for options PTRACE.
 1.140 23-Jul-2006  ad Use the LWP cached credentials where sane.
 1.139 26-Jun-2006  mrg version the socket(2) syscall. for compat30 socket, we use
EPROTONOSUPPORT instead of EAFNOSUPPORT.

from pavel@ with a little bit of clean up from myself.

XXX: netbsd32 (and perhaps other emulations) should be able
XXX: to call the standard socket calls for this i think, but
XXX: revisit this at another time.
 1.138 15-May-2006  yamt branches: 1.138.4;
- include kauth.h for kauth_authorize_generic.
- wrap a long line.
 1.137 14-May-2006  elad integrate kauth.
 1.136 01-Mar-2006  yamt branches: 1.136.2; 1.136.4; 1.136.6;
merge yamt-uio_vmspace branch.

- use vmspace rather than proc or lwp where appropriate.
the latter is more natural to specify an address space.
(and less likely to be abused for random purposes.)
- fix a swdmover race.
 1.135 24-Dec-2005  perry branches: 1.135.2; 1.135.4; 1.135.6;
__inline__ -> inline
 1.134 11-Dec-2005  christos merge ktrace-lwp.
 1.133 14-Sep-2005  he This now needs <compat/sys/signal.h> to build.
 1.132 19-Apr-2005  christos branches: 1.132.2;
PR/29696: Joel Carnat: NetBSD freezes when accessing smbfs mounted FS with
firefox/linux due to compat getdents() call assumption that all filesystems
support cookies.
 1.131 26-Feb-2005  perry branches: 1.131.2;
nuke trailing whitespace
 1.130 17-Sep-2004  skrll branches: 1.130.4; 1.130.6;
There's no need to pass a proc value when using UIO_SYSSPACE with
vn_rdwr(9) and uiomove(9).

OK'd by Jason Thorpe
 1.129 25-Apr-2004  matt Constify sreq2breq
 1.128 25-Apr-2004  matt Constify a few read-only arrays/variables.
 1.127 22-Apr-2004  hannken Make it compile again after statvfs import.
 1.126 21-Apr-2004  christos Replace the statfs() family of system calls with statvfs().
Retain binary compatibility.
 1.125 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.124 29-Jun-2003  fvdl branches: 1.124.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.123 29-Jun-2003  darrenr More changes for providing lwpid for ktrace (sparc GENERIC built)
 1.122 28-Jun-2003  darrenr Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records. The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V
 1.121 16-May-2003  itojun use strlcpy
[compat/svr4_32 should have bound check for SVR4_32_AUX_ARGSIZ]
 1.120 23-Feb-2003  pk Make updating a file's reference and use count MP-safe.
 1.119 29-Jan-2003  atatat Cull unused variables. Sigh.

PS - Cross compilers are cool.
 1.118 28-Jan-2003  atatat No need to pick a "default address" for mmap in compat code, since we
merely call sys_mmap() at the end anyway, and that will pick the
address for us, if it's needed.

Likewise for checking if /dev/zero is being mapped.
 1.117 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.116 06-Sep-2002  gehenna Merge the gehenna-devsw branch into the trunk.

This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
by using this grammer.

- Added the new naming convention.
The name of the device switch must be <prefix>_[bc]devsw for auto-generation
of device switch tables.

- The backward compatibility of loading block/character device
switch by LKM framework is broken. This is necessary to convert
from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.
 1.115 04-Jul-2002  thorpej Add kernel support for having userland provide the signal trampoline:

* struct sigacts gets a new sigact_sigdesc structure, which has the
sigaction and the trampoline/version. Version 0 means "legacy kernel
provided trampoline". Other versions are coordinated with machine-
dependent code in libc.
* sigaction1() grows two more arguments -- the trampoline pointer and
the trampoline version.
* A new __sigaction_sigtramp() system call is provided to register a
trampoline along with a signal handler.
* The handler is no longer passed to sensig() functions. Instead,
sendsig() looks up the handler by peeking in the sigacts for the
process getting the signal (since it has to look in there for the
trampoline anyway).
* Native sendsig() functions now select the appropriate trampoline and
its arguments based on the trampoline version in the sigacts.

Changes to libc to use the new facility will be checked in later. Kernel
version not bumped; we will ride the 1.6C bump made recently.
 1.114 16-Mar-2002  christos branches: 1.114.4;
make the stackgap_{init,alloc} functions MP friendly (i.e. pass struct proc *
in, instead of using curproc). While there add an optional size argument to
stackgap_init.
 1.113 03-Jan-2002  mrg move the COMPAT_SUNOS SO_BROADCAST hack out of uipc_socket.c into the
compat/sunos code. besides being cleaner this allows the sunos LKM
to properly work without any special kernel hacks.
 1.112 02-Dec-2001  tsutsui Don't define COMPAT_SUNOS here. It is defined in opt_compat_sunos.h
and <sys/ioctl.h> and <sys/tty.h> include it properly.

XXX Is this needed for LKM?
 1.111 13-Nov-2001  lukem add RCSIDs (including regeneration of files as appropriate)
 1.110 14-Jun-2001  thorpej branches: 1.110.2; 1.110.4;
Fix a partial construction problem that can cause race conditions
between creation of a file descriptor and close(2) when using kernel
assisted threads. What we do is stick descriptors in the table, but
mark them as "larval". This causes essentially everything to treat
it as a non-existent descriptor, except for fdalloc(), which sees a
filled slot so that it won't (incorrectly) allocate it again. When
a descriptor is fully constructed, the code that has constructed it
marks it as "mature" (which actually clears the "larval" flag), and
things continue to work as normal.

While here, gather all the code that gets a descriptor from the table
into a fd_getfile() function, and call it, rather than having the
same (sometimes incorrect) code copied all over the place.
 1.109 30-May-2001  mrg use _KERNEL_OPT.
 1.108 12-Feb-2001  fvdl branches: 1.108.2;
Cast 32bit sunos_nfs_arg member to (char *)(long) to avoid warning
after sunos.h change (cast is safe; a SunOS binary will pas a 32 bit
pointer).
 1.107 01-Dec-2000  jdolecek make LKM safe
 1.106 01-Dec-2000  jdolecek add e_path (emulation path) to struct emul, which replaces emulation-specific
*_emul_path variables

change macros CHECK_ALT_{CREAT|EXIST} to use that, 'root' doesn't need
to be passed explicitly any more and *_CHECK_ALT_{CREAT|EXIST} are removed
change explicit emul_find() calls in probe functions to get the emulation
path from the checked exec switch entry's emulation

remove no longer needed header files

add e_flags and e_syscall to struct emul; these are unsed and empty for now
 1.105 28-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.104 30-Mar-2000  augustss Kill register declarations.
 1.103 28-Mar-2000  simonb Centralise the declarations of cpu_model, machine, machine_arch,
osrelease, and ostype and remove "extern char foo[];" (for hostname
and domainname too).

Also delete redunctant decl of boottime in kern_info_43.c.
 1.102 26-Mar-2000  kleink Merge parts of chs-ubc2 into the trunk:
* Remove the casts to vaddr_t from the round_page() and trunc_page() macros to
make them type-generic, which is necessary i.e. to operate on file offsets
without truncating them.
* In due course, cast pointer arguments to these macros to an appropriate
integral type (paddr_t, vaddr_t).

Originally done by Chuck Silvers, updated by myself.
 1.101 05-May-1999  thorpej branches: 1.101.2;
Add "use counting" to file entries. When closing a file, and it's reference
count is 0, wait for use count to drain before finishing the close.

This is necessary in order for multiple processes to safely share file
descriptor tables.
 1.100 22-Mar-1999  sommerfe branches: 1.100.4;
Use regular system fchroot, now that we have it.
 1.99 09-Feb-1999  christos Const poisoning and CHECK_ALT_CREAT fixes
 1.98 21-Dec-1998  drochner g/c SA_USERTRAMP (ok'd by pk)
 1.97 19-Dec-1998  drochner get "opt_compat_xxx.h" includes out of <sys/signal.h>
 1.96 14-Sep-1998  pk Fix copyout() argument switch.
 1.95 13-Sep-1998  pk Signal compat: sunos sigset_t conversions;
new sunos_sigvec() & sunos_sigpending()
 1.94 08-Sep-1998  rvb ufs_readdir no longer checks if vp->v_type != VDIR so
the individual emulated readdirs must check.
Since netbsd and freebsd return EINVAL for the error
and I don't know what the other platforms do, return
EINVAL for them too.
 1.93 29-Aug-1998  mrg move <vm/vm_swap.h> to <sys/swap.h>. <vm/vm_swap.h> still works for now (goes away later)
 1.92 09-Aug-1998  perry bzero->memset, bcopy->memcpy, bcmp->memcmp
 1.91 26-Jun-1998  hannken Include NFSSERVER option header opt_nfsserver.h.
 1.90 04-Mar-1998  fvdl Make this compile again.
 1.89 03-Mar-1998  fvdl Only free cookiebuf when sure that the vop actually allocated it.
 1.88 01-Mar-1998  fvdl Merge with Lite2 + local changes
 1.87 19-Feb-1998  thorpej Include the NFS option header.
 1.86 21-Oct-1997  fvdl branches: 1.86.2;
Update for new msync (== __msync13), use flags
 1.85 19-Oct-1997  christos Simplify use of round_page() like in other emulations.
 1.84 19-Oct-1997  carrel cast to void * not caddr_t
 1.83 10-Oct-1997  fvdl Fix braino in my interpretation of the eof flag to VOP_READDIR.
 1.82 10-Oct-1997  fvdl Signal error when getting a 64 bit offset cookie that can't be stored
in 32 bits. Provide an error message to the user, and return EINVAL.
Also, pay attention to the EOF flag from VOP_READDIR. Correct a
misspell in a panic message.
 1.81 04-Aug-1997  bouyer branches: 1.81.2;
Fix "missing entries" bug when reading large directories: When reading a
directory and running out of space in the dest buffer, off should point to the
current entry (which was not saved) and not to the next.
I discovered this bug using linux and SunOS emulation over NFS, but seems to
affect other emulations as well.
 1.80 13-Jun-1997  thorpej branches: 1.80.4;
Garbage-collect sunos_sys_swapon(); it is not needed.
 1.79 12-Jun-1997  mrg bring mrg-vm-swap2 onto mainline.
 1.78 08-May-1997  mycroft branches: 1.78.2;
Pass the vnode type to vaccess(), and use it when checking VEXEC. Make sure
that the mode bits passed to vaccess() and returned by foo_getattr() contain
only permission bits.
 1.77 08-May-1997  mycroft VEXEC -> VLOOKUP, as appropriate.
 1.76 31-Jan-1997  thorpej NFSCLIENT -> NFS
 1.75 28-Dec-1996  cjs branches: 1.75.2;
This recently stopped compiling due to a warning about const being
dropped. This fix suggested by cgd.
 1.74 13-Oct-1996  christos Remove STACKGAPBASE dependencies.
 1.73 13-Oct-1996  christos catch up with Jason's changes.
 1.72 07-Sep-1996  mycroft Implement poll(2).
 1.71 03-Sep-1996  mycroft Define execv() and execve() consistently across emulations.
Do path name translation.
 1.70 30-Aug-1996  christos add obsolete stime(2)
 1.69 26-Aug-1996  thorpej Implement sunos_sys_execve(). The previous code simply called
sys_execve() without doing an alternate patch check, which was
incorrect. Bug pointed out by Krister Walfridsson <cato@df.lth.se>
on port-sparc@NetBSD.ORG.
 1.68 11-Aug-1996  mrg update sunos_sys_reboot() to actually work again.
 1.67 09-Aug-1996  mrg Change reboot(2) to take two arguments: bootopt like normal and also
a boot string for firmware that can do this, such as the SPARC and
the sun3 models. It is currently silently ignored on all other
hardware now, however. The MD function "boot()" has been changed to
also take a char *.
 1.66 14-Jun-1996  cgd avoid unnecessary checks of m_get/MGET/etc.'s return values. When
they're called with M_WAIT, they are defined to never return NULL.
 1.65 22-Apr-1996  christos branches: 1.65.4;
remove include of <sys/cpu.h>
 1.64 14-Mar-1996  christos Bring prototypes into scope and fix compiler warnings.
 1.63 28-Feb-1996  gwr dir => dirent
 1.62 25-Feb-1996  pk If NFS `rsize' is specified, set `readdirsize' too.
 1.61 18-Feb-1996  pk Adapt compat NFS mount code to NFSv3.
 1.60 05-Jan-1996  pk Implement vhangup(); more or less as suggested in PR#1560 (matthew green).
I'm vrele'ing s_ttyvp here too, so sys_exit() won't have to go over it
again.
 1.59 14-Dec-1995  ghudson Reverse pk's changes from 1.57; the faked cookies are not valid,
and are no longer necessary now that NFS provides cookies.
 1.58 07-Nov-1995  gwr ufs ==> ffs
 1.57 11-Oct-1995  pk Gets NFS-mounted /emul/sunos going again by faking readdir cookies if
not supported by VOP_READDIR().
 1.56 09-Oct-1995  mycroft branches: 1.56.2;
Use cookies for directory offset, mostly from Greg Hudson.
 1.55 07-Oct-1995  mycroft Prefix names of system call implementation functions with `sys_'.
 1.54 19-Sep-1995  thorpej Make system calls conform to a standard prototype and bring those
prototypes into scope.
 1.53 15-Aug-1995  gwr Catch up with renamed SA_DISABLE flag and update
sunos_sigvec to allow the new SA_RESETHAND flag.
 1.52 05-Jul-1995  pk Start using sunos_sigvec().
 1.51 25-Jun-1995  briggs * Don't include sys/exec.h explicitly--it's not protected against multiple
inclusions and compat_util.h now includes it.
* Declare struct emul *e=p->p_emul in a couple of places so we can use
STACKGAPBASE macro (should this macro be modified to take a struct
emul * or struct proc * parameter?).
* Declare extern struct emul emul_sunos for sunos_sigvec's comparison.
 1.50 24-Jun-1995  christos Use compat_util.[ch]
 1.49 18-Jun-1995  cgd don't assume the f_fsnamelen is nul-truncated or longer than MFSNAMELEN
 1.48 11-Jun-1995  pk Go with the flow; use `/emul/sunos' pseudo-root (from Matthew Green).
Note: sunos_stat() and sunos_lstat() were added too.
 1.47 27-Apr-1995  christos Try to make the reboot system call compile under sun3 with RB_STRING
support [not tested]
Add files.sunos
Rename system call switch table file from sunos_init_sysent.c to sunos_sysent.c
like other emulations.
 1.46 26-Apr-1995  gwr Make sunos_reboot(RB_STRING,"...") work for sun3.
Could be made to work for sparc too.
 1.45 23-Apr-1995  briggs Fix compiler error in sunos_reboot().
 1.44 22-Apr-1995  christos Added sunos_reboot().
 1.43 21-Mar-1995  mycroft Update to use timer{add,sub}().
 1.42 09-Mar-1995  mycroft copy*str() should use size_t.
 1.41 17-Dec-1994  mycroft timevaladd -> __timeradd (AGAIN)
 1.40 16-Dec-1994  deraadt correct ansi glitch
 1.39 15-Dec-1994  pk mode/flags confusion in sunos_open().
 1.38 11-Dec-1994  mycroft Use __timeradd(), not timervaladd().
 1.37 30-Nov-1994  pk Convert SunOS IP multicast socket options.
 1.36 23-Nov-1994  deraadt m68k does not have PT_{SET,GET}FPREGS
 1.35 20-Nov-1994  deraadt ptrace from chs+@CS.cmu.edu, poll from christos
 1.34 14-Nov-1994  deraadt fix sunos_mmap
 1.33 25-Oct-1994  deraadt rename, new syscall interface, etc.
 1.32 20-Oct-1994  cgd pay a small amount of lip service to the new syscall args mechanism.
In reality, none of these will compile.
 1.31 28-Sep-1994  deraadt use STACKGAPBASE
 1.30 29-Jun-1994  cgd New RCS ID's, take two. they're more aesthecially pleasant, and use 'NetBSD'
 1.29 22-Jun-1994  pk sun_mount: fill in one more field.
 1.28 15-Jun-1994  deraadt async_daemon only if NFSCLIENT
 1.27 10-Jun-1994  pk Adapt to 4.4-lite.
 1.26 08-Jun-1994  mycroft Minor change.
 1.25 06-Jun-1994  deraadt tricky
 1.24 24-May-1994  deraadt maxfdescs -> maxfiles
 1.23 21-May-1994  deraadt iszerodev
 1.22 19-May-1994  deraadt fix uname after sysctl
 1.21 05-May-1994  deraadt p->p_sig -> p->p_siglist
 1.20 05-May-1994  cgd fix my forgetfulness; from gwr
 1.19 04-May-1994  cgd expand the rlimit struct, kill last vestiges of off_t bogosity.
 1.18 29-Apr-1994  cgd kill syscall name aliases. no user-visible changes
 1.17 26-Apr-1994  pk SunOS's RLIMIT_NOFILE is different: add sun_[gs]rlimit().
 1.16 24-Apr-1994  deraadt make sunos mount(2) work again
 1.15 02-Apr-1994  cgd sickness to get SunOS mmap right
 1.14 27-Mar-1994  cgd expand uid_t/gid_t/off_t
 1.13 03-Mar-1994  deraadt DoH!
 1.12 03-Mar-1994  deraadt first cut at a SUNOS_COMPAT sysconf() system call.
 1.11 20-Feb-1994  chopps place conditional around sun_nfssvc.
 1.10 12-Dec-1993  deraadt m68k/sparc sunos binary compatibility code, pulled down from magnum branch
for consumption by the m68k masses
 1.9 22-Nov-1993  deraadt branches: 1.9.2;
moved from arch/sparc/sunos to compat/sunos
 1.8 20-Nov-1993  deraadt new compat functions: sun_open, sun_auditsys, sun_setpgid, sun_uname
some from Markus.
 1.7 12-Nov-1993  deraadt specdev.h moves
 1.6 10-Nov-1993  deraadt silly typo
 1.5 10-Nov-1993  deraadt support both sun3 & sparc concepts of minor/major #'s for /dev/zero
 1.4 15-Oct-1993  deraadt fix sun_getdents()
fix sun_mmap()
Note: delete the "struct dirent" in here when sys/dirent.h is created.
 1.3 13-Oct-1993  deraadt Add a stub auditsys() system call that does nothing.
SunOS /sbin/fsck calls it..
 1.2 11-Oct-1993  deraadt various changes, suffice to say that 4.4 syscalls do not look like ours
 1.1 02-Oct-1993  deraadt Chris Torek's sparc port. Missing lots of things.
 1.9.2.10 23-Jan-1994  deraadt make sun_misc compile without NFSSERVER. thanks to
Niklas Hallqvist <niklas@appli.se>
 1.9.2.9 01-Dec-1993  pk Introduced sun_mknod() which also deals with FIFOs (ie. `mknod xxx p' on SunOS).
 1.9.2.8 30-Nov-1993  deraadt impliment fstatfs() and statfs() better
 1.9.2.7 27-Nov-1993  deraadt very rudimentary exportfs(2) support, ie. "return 0"
 1.9.2.6 27-Nov-1993  deraadt statfs(2) and fstatfs(2) support. `df' now works.
 1.9.2.5 27-Nov-1993  deraadt add vhangup(2)
generalize m68k support for /dev/zero..
 1.9.2.4 26-Nov-1993  deraadt add real wimpy quotactl(2) emulation
 1.9.2.3 26-Nov-1993  deraadt add basically bogus ustat(2) support.
 1.9.2.2 26-Nov-1993  deraadt nfssvc(2) system call emulation. might work, might not -- have to
wait for exportfs(2) support for mountd..
 1.9.2.1 26-Nov-1993  deraadt added mount(2) nfs support
 1.56.2.2 07-Nov-1995  gwr From Head: ufs ==> ffs
 1.56.2.1 13-Oct-1995  pk Update from trunk: fake cookies
 1.65.4.1 10-Dec-1996  mycroft From trunk:
Do execv() and execve() path name translation consistently across
emulations.
 1.75.2.1 14-Jan-1997  thorpej Snapshot of work-in-progress, committed to private branch.

These changes implement machine-independent root device and file system
selection. Notable features:

- All ports behave in a consistent manner regarding root
device selection.
- No more "options GENERIC"; all kernels have the ability
to boot with RB_ASKNAME to select root device and file system
type.
- Root file system type can be wildcarded; a machine-independent
function will try all possible file systems for the selected
root device until one succeeds.
- If the root file system fails to mount, the operator will
be given the chance to select a new root device and file
system type, rather than having the machine simply panic.
- nfs_mountroot() no longer panics if any part of the NFS
mount process fails; it now returns an error, giving the
operator a chance to recover.
- New, more consistent, config(8) grammar. The constructs:

config netbsd swap generic
config netbsd root on nfs

have been replaced with:

config netbsd root on ? type ?
config netbsd root on ? type nfs

Additionally, the operator may select or wildcard root file
system type in the kernel configuration file:

config netbsd root on cd0a type cd9660

config(8) now requires that a "root" specification be
made. "root" may be wired down or wildcarded. "swap" and
"dump" specifications are optional, and follow previous
semantics.

- config(8) has a new "file-system" keyword, used to configure
file systems into the kernel. Eventually, this will be used
to generate the default vfssw[].

- "options NFSCLIENT" is obsolete, and is replaced by
"file-system NFS". "options NFSSERVER" still exists, since
NFS server support is independent of the NFS file system
client.

- sys/arch/<foo>/<foo>/swapgeneric.c is no longer used, and
will be removed; all information is now generated by config(8).

As of this commit, all ports except arm32 have been updated to use
the new setroot(). Only SPARC, i386, and Alpha ports have been
tested at this time. Port masters should test these changes on their
ports, and report any problems back to me.

More changes are on their way, including RB_ASKNAME support in
nfs_mountroot() (to prompt for server address and path) and, potentially,
the ability to select rarp/bootparam or bootp in nfs_mountroot().
 1.78.2.2 01-Jun-1997  mrg implement sunos_sys_swapon().
 1.78.2.1 08-May-1997  mrg file sunos_misc.c was added on branch mrg-vm-swap2 on 1997-06-01 14:14:12 +0000
 1.80.4.2 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.80.4.1 23-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.81.2.1 08-Sep-1997  thorpej Significantly restructure the way signal state for a process is stored.
Rather than using bitmasks to redundantly store the information kept
in the process's sigacts (because the sigacts was kept in the u-area),
hang sigacts directly off the process, and access it directly.

Simplify signal setup code tremendously by storing information in
the sigacts as an array of struct sigactions, rather than in a different
format, since userspace uses sigactions.

Make sigacts sharable by adding reference counting.
 1.86.2.2 21-Oct-1997  fvdl Update for new msync (== __msync13), use flags
 1.86.2.1 21-Oct-1997  fvdl file sunos_misc.c was added on branch netbsd-1-3 on 1997-10-21 00:58:42 +0000
 1.100.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.101.2.3 12-Mar-2001  bouyer Sync with HEAD.
 1.101.2.2 08-Dec-2000  bouyer Sync with HEAD.
 1.101.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.108.2.12 17-Sep-2002  nathanw Catch up to -current.
 1.108.2.11 01-Aug-2002  nathanw Catch up to -current.
 1.108.2.10 12-Jul-2002  nathanw No longer need to pull in lwp.h; proc.h pulls it in for us.
 1.108.2.9 21-Jun-2002  gmcgarry LWPify socket syscalls.
 1.108.2.8 29-May-2002  nathanw #include <sys/sa.h> before <sys/syscallargs.h>, to provide sa_upcall_t
now that <sys/param.h> doesn't include <sys/sa.h>.

(Behold the Power of Ed)
 1.108.2.7 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.108.2.6 28-Feb-2002  nathanw Catch up to -current.
 1.108.2.5 11-Jan-2002  nathanw More catchup.
 1.108.2.4 08-Jan-2002  nathanw Catch up to -current.
 1.108.2.3 15-Nov-2001  pk LWP system call signature conversion.
 1.108.2.2 14-Nov-2001  nathanw Catch up to -current.
 1.108.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.110.4.1 26-Sep-2001  fvdl * add a VCLONED vnode flag that indicates a vnode representing a cloned
device.
* rename REVOKEALL to REVOKEALIAS, and add a REVOKECLONE flag, to pass
to VOP_REVOKE
* the revoke system call will revoke all aliases, as before, but not the
clones
* vdevgone is called when detaching a device, so make it use REVOKECLONE
to get rid of all clones as well
* clean up all uses of VOP_OPEN wrt. locking.
* add a few VOPS to spec_vnops that need to do something when it's a
clone vnode (access and getattr)
* add a copy of the vnode vattr structure of the original 'master' vnode
to the specinfo of a cloned vnode. could possibly redirect getattr to
the 'master' vnode, but this has issues with revoke
* add a vdev_reassignvp function that disassociates a vnode from its
original device, and reassociates it with the specified dev_t. to be
used by cloning devices only, in case a new minor is allocated.
* change all direct references in drivers to v_devcookie and v_rdev
to vdev_privdata(vp) and vdev_rdev(vp). for diagnostic purposes
when debugging race conditions that still exist wrt. locking and
revoking vnodes.
* make the locking state of a vnode consistent when passed to
d_open and d_close (unlocked). locked would be better, but has
some deadlock issues
 1.110.2.4 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.110.2.3 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.110.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.110.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.114.4.2 15-Jul-2002  gehenna catch up with -current.
 1.114.4.1 16-May-2002  gehenna Get rid of iszerodev. Use the 'zerodev' (dev_t for /dev/zero).
 1.124.2.7 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.124.2.6 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.124.2.5 21-Nov-2004  skrll Adapt to branch.
 1.124.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.124.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.124.2.2 03-Aug-2004  skrll Sync with HEAD
 1.124.2.1 02-Jul-2003  darrenr Apply the aborted ktrace-lwp changes to a specific branch. This is just for
others to review, I'm concerned that patch fuziness may have resulted in some
errant code being generated but I'll look at that later by comparing the diff
from the base to the branch with the file I attempt to apply to it. This will,
at the very least, put the changes in a better context for others to review
them and attempt to tinker with removing passing of 'struct lwp' through
the kernel.
 1.130.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.130.4.1 29-Apr-2005  kent sync with -current
 1.131.2.1 01-Oct-2005  tron Pull up following revision(s) (requested by christos in ticket #838):
sys/compat/svr4/svr4_misc.c: revision 1.112
sys/compat/ibcs2/ibcs2_misc.c: revision 1.74
sys/compat/linux/common/linux_misc.c: revision 1.136
sys/compat/irix/irix_dirent.c: revision 1.14
sys/compat/sunos/sunos_misc.c: revision 1.132
sys/compat/svr4_32/svr4_32_misc.c: revision 1.31
sys/compat/sunos32/sunos32_misc.c: revision 1.30
sys/compat/linux/common/linux_file64.c: revision 1.26
PR/29696: Joel Carnat: NetBSD freezes when accessing smbfs mounted FS with
firefox/linux due to compat getdents() call assumption that all filesystems
support cookies.
 1.132.2.8 24-Mar-2008  yamt sync with head.
 1.132.2.7 21-Jan-2008  yamt sync with head
 1.132.2.6 07-Dec-2007  yamt sync with head
 1.132.2.5 27-Oct-2007  yamt sync with head.
 1.132.2.4 03-Sep-2007  yamt sync with head.
 1.132.2.3 26-Feb-2007  yamt sync with head.
 1.132.2.2 30-Dec-2006  yamt sync with head.
 1.132.2.1 21-Jun-2006  yamt sync with head.
 1.135.6.2 01-Jun-2006  kardel Sync with head.
 1.135.6.1 22-Apr-2006  simonb Sync with head.
 1.135.4.1 09-Sep-2006  rpaulo sync with head
 1.135.2.1 18-Feb-2006  yamt adapt the rest of MI code.
 1.136.6.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.136.4.2 10-Mar-2006  elad generic_authorize() -> kauth_authorize_generic().
 1.136.4.1 08-Mar-2006  elad Adapt to kernel authorization KPI.
 1.136.2.3 03-Sep-2006  yamt sync with head.
 1.136.2.2 11-Aug-2006  yamt sync with head
 1.136.2.1 24-May-2006  yamt sync with head.
 1.138.4.1 13-Jul-2006  gdamore Merge from HEAD.
 1.142.4.1 10-Dec-2006  yamt sync with head.
 1.142.2.3 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.142.2.2 12-Jan-2007  ad sparc MD changes.
 1.142.2.1 18-Nov-2006  ad Sync with head.
 1.143.2.1 12-Jun-2010  riz Pull up following revision(s) (requested by he in ticket #1387):
sys/compat/svr4/svr4_misc.c: revision 1.149
sys/compat/linux/common/linux_misc.c: revision 1.214
sys/compat/common/vfs_syscalls_30.c: revision 1.31
sys/compat/sunos/sunos_misc.c: revision 1.166
sys/compat/linux/common/linux_file64.c: revision 1.50
sys/compat/svr4_32/svr4_32_misc.c: revision 1.68
sys/compat/ibcs2/ibcs2_misc.c: revision 1.110
sys/compat/linux32/common/linux32_dirent.c: revision 1.10
sys/compat/sunos32/sunos32_misc.c: revision 1.69
sys/compat/irix/irix_dirent.c: revision 1.24
sys/compat/osf1/osf1_file.c: revision 1.38
When implementing "read directory", when there are too many empty entries
in a row, and we need to try to read the next block, and have passed a
non-NULL cookie pointer to VOP_READDIR, ensure that we free the cookie
buffer before re-doing VOP_READDIR, so that we don't leak memory.
This fix is similar to nfs_serv.c revisions 1.115 + 1.124.
This should fix the long-standing problem observed by e.g. using Linux-
emulated programs to take backup of servers, which is one of the problems
which were reported in PR#42661.
Thanks to pooka@ for the hints for traversing the VOP* layer.
 1.144.2.3 17-May-2007  yamt sync with head.
 1.144.2.2 07-May-2007  yamt sync with head.
 1.144.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.146.4.1 11-Jul-2007  mjf Sync with head.
 1.146.2.4 09-Oct-2007  ad Sync with head.
 1.146.2.3 20-Aug-2007  ad Sync with HEAD.
 1.146.2.2 15-Jul-2007  ad Sync with head.
 1.146.2.1 27-May-2007  ad Sync with head.
 1.151.10.1 14-Oct-2007  yamt sync with head.
 1.151.8.2 09-Jan-2008  matt sync with HEAD
 1.151.8.1 06-Nov-2007  matt sync with HEAD
 1.151.6.3 09-Dec-2007  jmcneill Sync with HEAD.
 1.151.6.2 27-Nov-2007  joerg Sync with HEAD. amd64 Xen support needs testing.
 1.151.6.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.152.4.3 18-Feb-2008  mjf Sync with HEAD.
 1.152.4.2 27-Dec-2007  mjf Sync with HEAD.
 1.152.4.1 08-Dec-2007  mjf Sync with HEAD.
 1.153.2.2 26-Dec-2007  ad Sync with head.
 1.153.2.1 08-Dec-2007  ad Sync with head.
 1.156.4.1 02-Jan-2008  bouyer Sync with HEAD
 1.158.6.4 17-Jan-2009  mjf Sync with HEAD.
 1.158.6.3 28-Sep-2008  mjf Sync with HEAD.
 1.158.6.2 29-Jun-2008  mjf Sync with HEAD.
 1.158.6.1 03-Apr-2008  mjf Sync with HEAD.
 1.159.8.1 27-Jun-2008  simonb Sync with head.
 1.159.6.3 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.159.6.2 14-May-2008  wrstuden Per discussion with ad, remove most of the #include <sys/sa.h> lines
as they were including sa.h just for the type(s) needed for syscallargs.h.

Instead, create a new file, sys/satypes.h, which contains just the
types needed for syscallargs.h. Yes, there's only one now, but that
may change and it's probably more likely to change if it'd be difficult
to handle. :-)

Per discussion with matt at n dot o, add an include of satypes.h to
sigtypes.h. Upcall handlers are kinda signal handlers, and signalling
is the header file that's already included for syscallargs.h that
closest matches SA.

This shaves about 3000 lines off of the diff of the branch relative
to the base. That also represents about 18% of the total before this
checkin.

I think this reduction is very good thing.
 1.159.6.1 10-May-2008  wrstuden Initial checkin of re-adding SA. Everything except kern_sa.c
compiles in GENERIC for i386. This is still a work-in-progress, but
this checkin covers most of the mechanical work (changing signalling
to be able to accomidate SA's process-wide signalling and re-adding
includes of sys/sa.h and savar.h). Subsequent changes will be much
more interesting.

Also, kern_sa.c has received partial cleanup. There's still more
to do, though.
 1.159.4.4 11-Aug-2010  yamt sync with head.
 1.159.4.3 11-Mar-2010  yamt sync with head
 1.159.4.2 18-Jul-2009  yamt sync with head.
 1.159.4.1 04-May-2009  yamt sync with head.
 1.160.2.2 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.160.2.1 19-Oct-2008  haad Sync with HEAD.
 1.161.8.1 21-Apr-2010  matt sync to netbsd-5
 1.161.4.1 17-Mar-2010  snj Pull up following revision(s) (requested by he in ticket #1323):
sys/compat/common/vfs_syscalls_30.c: revision 1.31
sys/compat/ibcs2/ibcs2_misc.c: revision 1.110
sys/compat/irix/irix_dirent.c: revision 1.24
sys/compat/linux/common/linux_file64.c: revision 1.50
sys/compat/linux/common/linux_misc.c: revision 1.214
sys/compat/linux32/common/linux32_dirent.c: revision 1.10
sys/compat/sunos/sunos_misc.c: revision 1.166
sys/compat/sunos32/sunos32_misc.c: revision 1.69
sys/compat/svr4/svr4_misc.c: revision 1.149
sys/compat/svr4_32/svr4_32_misc.c: revision 1.68
When implementing "read directory", when there are too many empty entries
in a row, and we need to try to read the next block, and have passed a
non-NULL cookie pointer to VOP_READDIR, ensure that we free the cookie
buffer before re-doing VOP_READDIR, so that we don't leak memory.
This fix is similar to nfs_serv.c revisions 1.115 + 1.124.
This should fix the long-standing problem observed by e.g. using Linux-
emulated programs to take backup of servers, which is one of the problems
which were reported in PR#42661.
Thanks to pooka@ for the hints for traversing the VOP* layer.
 1.161.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.164.2.1 23-Jul-2009  jym Sync with HEAD.
 1.165.2.2 17-Aug-2010  uebayasi Sync with HEAD.
 1.165.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.167.2.1 03-Jul-2010  rmind sync with head
 1.168.40.1 12-Aug-2017  snj Pull up following revision(s) (requested by mrg in ticket #1479):
sys/compat/common/vfs_syscalls_12.c: revision 1.34
sys/rump/kern/lib/libsys_sunos/rump_sunos_compat.c: revision 1.2
sys/compat/svr4_32/svr4_32_misc.c: revision 1.78
sys/compat/sunos32/sunos32_misc.c: revision 1.78
sys/compat/linux/common/linux_misc.c: revision 1.239
sys/compat/osf1/osf1_file.c: revision 1.44
sys/compat/common/vfs_syscalls_43.c: revision 1.60
sys/compat/svr4/svr4_misc.c: revision 1.158
sys/compat/ibcs2/ibcs2_misc.c: revision 1.114
sys/compat/linux/common/linux_file64.c: revision 1.59
sys/compat/linux32/common/linux32_dirent.c: revision 1.18
sys/compat/sunos/sunos_misc.c: revision 1.171
Fail, don't panic, on bad dirents from file system.
Controllable via puffs from userland.
From Ilja Van Sprundel.
 1.168.36.1 12-Aug-2017  snj Pull up following revision(s) (requested by mrg in ticket #1479):
sys/compat/common/vfs_syscalls_12.c: revision 1.34
sys/rump/kern/lib/libsys_sunos/rump_sunos_compat.c: revision 1.2
sys/compat/svr4_32/svr4_32_misc.c: revision 1.78
sys/compat/sunos32/sunos32_misc.c: revision 1.78
sys/compat/linux/common/linux_misc.c: revision 1.239
sys/compat/osf1/osf1_file.c: revision 1.44
sys/compat/common/vfs_syscalls_43.c: revision 1.60
sys/compat/svr4/svr4_misc.c: revision 1.158
sys/compat/ibcs2/ibcs2_misc.c: revision 1.114
sys/compat/linux/common/linux_file64.c: revision 1.59
sys/compat/linux32/common/linux32_dirent.c: revision 1.18
sys/compat/sunos/sunos_misc.c: revision 1.171
Fail, don't panic, on bad dirents from file system.
Controllable via puffs from userland.
From Ilja Van Sprundel.
 1.168.34.1 12-Aug-2017  snj Pull up following revision(s) (requested by mrg in ticket #1479):
sys/compat/common/vfs_syscalls_12.c: revision 1.34
sys/rump/kern/lib/libsys_sunos/rump_sunos_compat.c: revision 1.2
sys/compat/svr4_32/svr4_32_misc.c: revision 1.78
sys/compat/sunos32/sunos32_misc.c: revision 1.78
sys/compat/linux/common/linux_misc.c: revision 1.239
sys/compat/osf1/osf1_file.c: revision 1.44
sys/compat/common/vfs_syscalls_43.c: revision 1.60
sys/compat/svr4/svr4_misc.c: revision 1.158
sys/compat/ibcs2/ibcs2_misc.c: revision 1.114
sys/compat/linux/common/linux_file64.c: revision 1.59
sys/compat/linux32/common/linux32_dirent.c: revision 1.18
sys/compat/sunos/sunos_misc.c: revision 1.171
Fail, don't panic, on bad dirents from file system.
Controllable via puffs from userland.
From Ilja Van Sprundel.
 1.168.28.1 19-Aug-2017  snj Pull up following revision(s) (requested by mrg in ticket #1483):
sys/compat/common/vfs_syscalls_12.c: revision 1.34
sys/compat/svr4_32/svr4_32_misc.c: revision 1.78
sys/compat/sunos32/sunos32_misc.c: revision 1.78
sys/compat/linux/common/linux_misc.c: revision 1.239
sys/compat/osf1/osf1_file.c: revision 1.44
sys/compat/common/vfs_syscalls_43.c: revision 1.60
sys/compat/svr4/svr4_misc.c: revision 1.158
sys/compat/ibcs2/ibcs2_misc.c: revision 1.114
sys/compat/linux/common/linux_file64.c: revision 1.59
sys/compat/linux32/common/linux32_dirent.c: revision 1.18
sys/compat/sunos/sunos_misc.c: revision 1.171
Fail, don't panic, on bad dirents from file system.
Controllable via puffs from userland.
From Ilja Van Sprundel.
 1.168.20.1 19-Aug-2017  snj Pull up following revision(s) (requested by mrg in ticket #1483):
sys/compat/common/vfs_syscalls_12.c: revision 1.34
sys/compat/svr4_32/svr4_32_misc.c: revision 1.78
sys/compat/sunos32/sunos32_misc.c: revision 1.78
sys/compat/linux/common/linux_misc.c: revision 1.239
sys/compat/osf1/osf1_file.c: revision 1.44
sys/compat/common/vfs_syscalls_43.c: revision 1.60
sys/compat/svr4/svr4_misc.c: revision 1.158
sys/compat/ibcs2/ibcs2_misc.c: revision 1.114
sys/compat/linux/common/linux_file64.c: revision 1.59
sys/compat/linux32/common/linux32_dirent.c: revision 1.18
sys/compat/sunos/sunos_misc.c: revision 1.171
Fail, don't panic, on bad dirents from file system.
Controllable via puffs from userland.
From Ilja Van Sprundel.
 1.168.18.1 03-Dec-2017  jdolecek update from HEAD
 1.168.14.1 19-Aug-2017  snj Pull up following revision(s) (requested by mrg in ticket #1483):
sys/compat/common/vfs_syscalls_12.c: revision 1.34
sys/compat/svr4_32/svr4_32_misc.c: revision 1.78
sys/compat/sunos32/sunos32_misc.c: revision 1.78
sys/compat/linux/common/linux_misc.c: revision 1.239
sys/compat/osf1/osf1_file.c: revision 1.44
sys/compat/common/vfs_syscalls_43.c: revision 1.60
sys/compat/svr4/svr4_misc.c: revision 1.158
sys/compat/ibcs2/ibcs2_misc.c: revision 1.114
sys/compat/linux/common/linux_file64.c: revision 1.59
sys/compat/linux32/common/linux32_dirent.c: revision 1.18
sys/compat/sunos/sunos_misc.c: revision 1.171
Fail, don't panic, on bad dirents from file system.
Controllable via puffs from userland.
From Ilja Van Sprundel.
 1.169.2.2 28-Aug-2017  skrll Sync with HEAD
 1.169.2.1 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.170.10.2 21-Jun-2023  martin Pull up following revision(s) (requested by riastradh in ticket #1836):

sys/compat/linux/arch/i386/linux_machdep.c: revision 1.168
sys/compat/sunos/sunos_misc.c: revision 1.177
sys/compat/netbsd32/netbsd32_compat_50.c: revision 1.52
sys/compat/common/kern_resource_43.c: revision 1.23
sys/compat/netbsd32/netbsd32_conv.h: revision 1.46
sys/compat/linux/arch/i386/linux_ptrace.c: revision 1.35
sys/compat/common/vfs_syscalls_12.c: revision 1.38
sys/compat/ultrix/ultrix_misc.c: revision 1.126
sys/compat/common/kern_sig_43.c: revision 1.37
sys/compat/linux/common/linux_mtio.c: revision 1.8
sys/compat/freebsd/freebsd_misc.c: revision 1.34
sys/compat/linux/common/linux_olduname.c: revision 1.67
sys/compat/linux/arch/mips/linux_machdep.c: revision 1.44
sys/compat/freebsd/freebsd_sched.c: revision 1.23
sys/compat/ossaudio/ossaudio.c: revision 1.84
sys/compat/sys/time_types.h: revision 1.6
sys/compat/linux/arch/powerpc/linux_machdep.c: revision 1.51
sys/compat/linux/common/linux_file.c: revision 1.119
sys/compat/linux/arch/arm/linux_machdep.c: revision 1.34
sys/compat/netbsd32/netbsd32_wait.c: revision 1.25
sys/compat/linux32/common/linux32_time.c: revision 1.38
sys/compat/linux/arch/powerpc/linux_ptrace.c: revision 1.33
sys/compat/linux/arch/alpha/linux_machdep.c: revision 1.52
sys/compat/linux32/arch/amd64/linux32_machdep.c: revision 1.46
sys/compat/netbsd32/netbsd32_compat_12.c: revision 1.36
sys/compat/ultrix/ultrix_ioctl.c: revision 1.39
sys/compat/linux/common/linux_misc.c: revision 1.252
sys/compat/linux/common/linux_hdio.c: revision 1.19
sys/compat/sunos/sunos_ioctl.c: revision 1.71
sys/compat/linux/common/linux_sched.c: revision 1.79
sys/compat/common/kern_info_43.c: revision 1.40
sys/compat/linux32/common/linux32_exec_elf32.c: revision 1.20
sys/compat/linux/common/linux_socket.c: revision 1.153
sys/compat/linux/arch/amd64/linux_machdep.c: revision 1.60
sys/compat/common/vfs_syscalls_43.c: revision 1.68
sys/compat/linux/arch/powerpc/linux_exec_powerpc.c: revision 1.25
sys/compat/netbsd32/netbsd32_ptrace.c: revision 1.9
sys/compat/common/kern_time_50.c: revision 1.37
sys/compat/netbsd32/netbsd32_compat_20.c: revision 1.42
sys/compat/linux/common/linux_cdrom.c: revision 1.28
sys/compat/linux/arch/m68k/linux_machdep.c: revision 1.43
sys/compat/common/kern_info_09.c: revision 1.22
sys/compat/linux32/common/linux32_resource.c: revision 1.12
sys/compat/linux/common/linux_oldolduname.c: revision 1.67
sys/compat/netbsd32/netbsd32_nfssvc.c: revision 1.8
sys/compat/linux32/common/linux32_signal.c: revision 1.21
sys/compat/common/kern_sig_13.c: revision 1.22
sys/compat/sunos32/sunos32_ioctl.c: revision 1.36
sys/compat/netbsd32/netbsd32_compat_43.c: revision 1.62
sys/compat/linux/arch/arm/linux_ptrace.c: revision 1.23
sys/compat/netbsd32/netbsd32_time.c: revision 1.56
sys/compat/linux/common/linux_signal.c: revision 1.84
sys/compat/netbsd32/netbsd32_signal.c: revision 1.52
sys/compat/sunos32/sunos32_misc.c: revision 1.85
sys/compat/linux/common/linux_time.c: revision 1.40
sys/compat/linux/common/linux_fdio.c: revision 1.14
sys/compat/common/vfs_syscalls_30.c: revision 1.43

sys/compat: Memset zero before copyout.

Just in case of uninitialized padding which would lead to kernel
stack disclosure. If the compiler can prove the memset redundant
then it can optimize it away; otherwise better safe than sorry.
 1.170.10.1 09-Aug-2017  snj Pull up following revision(s) (requested by spz in ticket #193):
sys/compat/common/vfs_syscalls_12.c: revision 1.34
sys/rump/kern/lib/libsys_sunos/rump_sunos_compat.c: revision 1.2
sys/compat/svr4_32/svr4_32_misc.c: revision 1.78
sys/compat/sunos32/sunos32_misc.c: revision 1.78
sys/compat/linux/common/linux_misc.c: revision 1.239
sys/compat/osf1/osf1_file.c: revision 1.44
sys/compat/common/vfs_syscalls_43.c: revision 1.60
sys/compat/svr4/svr4_misc.c: revision 1.158
sys/compat/ibcs2/ibcs2_misc.c: revision 1.114
sys/compat/linux/common/linux_file64.c: revision 1.59
sys/compat/linux32/common/linux32_dirent.c: revision 1.18
sys/compat/sunos/sunos_misc.c: revision 1.171
Fail, don't panic, on bad dirents from file system.
Controllable via puffs from userland.
From Ilja Van Sprundel.
 1.171.4.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.171.4.1 10-Jun-2019  christos Sync with HEAD
 1.171.2.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.173.2.1 03-Aug-2022  martin Pull up following revision(s), all via patch
(requested by riastradh in ticket #1487):

sys/compat/linux/arch/i386/linux_machdep.c: revision 1.168
sys/compat/sunos/sunos_misc.c: revision 1.177
sys/compat/netbsd32/netbsd32_compat_50.c: revision 1.52
sys/compat/common/kern_resource_43.c: revision 1.23
sys/compat/netbsd32/netbsd32_conv.h: revision 1.46
sys/compat/linux/arch/i386/linux_ptrace.c: revision 1.35
sys/compat/common/vfs_syscalls_12.c: revision 1.38
sys/compat/ultrix/ultrix_misc.c: revision 1.126
sys/compat/common/kern_sig_43.c: revision 1.37
sys/compat/linux/common/linux_mtio.c: revision 1.8
sys/compat/freebsd/freebsd_misc.c: revision 1.34
sys/compat/freebsd/freebsd_machdep.c: revision 1.5
sys/compat/linux/common/linux_olduname.c: revision 1.67
sys/compat/linux/arch/mips/linux_machdep.c: revision 1.44
sys/compat/freebsd/freebsd_sched.c: revision 1.23
sys/compat/ossaudio/ossaudio.c: revision 1.84
sys/compat/sys/time_types.h: revision 1.6
sys/compat/linux/arch/powerpc/linux_machdep.c: revision 1.51
sys/compat/common/ieee80211_20.c: revision 1.7
sys/compat/linux/common/linux_file.c: revision 1.119
sys/compat/linux/arch/arm/linux_machdep.c: revision 1.34
sys/compat/netbsd32/netbsd32_wait.c: revision 1.25
sys/compat/linux32/common/linux32_time.c: revision 1.38
sys/compat/linux/arch/powerpc/linux_ptrace.c: revision 1.33
sys/compat/linux/arch/alpha/linux_machdep.c: revision 1.52
sys/compat/linux32/arch/amd64/linux32_machdep.c: revision 1.46
sys/compat/netbsd32/netbsd32_compat_12.c: revision 1.36
sys/compat/ultrix/ultrix_ioctl.c: revision 1.39
sys/compat/linux/common/linux_misc.c: revision 1.252
sys/compat/linux/common/linux_hdio.c: revision 1.19
sys/compat/sunos/sunos_ioctl.c: revision 1.71
sys/compat/linux/common/linux_sched.c: revision 1.79
sys/compat/common/kern_info_43.c: revision 1.40
sys/compat/linux32/common/linux32_exec_elf32.c: revision 1.20
sys/compat/linux/common/linux_socket.c: revision 1.153
sys/compat/linux/arch/amd64/linux_machdep.c: revision 1.60
sys/compat/common/vfs_syscalls_43.c: revision 1.68
sys/compat/linux/arch/powerpc/linux_exec_powerpc.c: revision 1.25
sys/compat/netbsd32/netbsd32_ptrace.c: revision 1.9
sys/compat/common/kern_time_50.c: revision 1.37
sys/compat/netbsd32/netbsd32_compat_20.c: revision 1.42
sys/compat/linux/common/linux_cdrom.c: revision 1.28
sys/compat/linux/arch/m68k/linux_machdep.c: revision 1.43
sys/compat/common/kern_info_09.c: revision 1.22
sys/compat/linux32/common/linux32_resource.c: revision 1.12
sys/compat/linux/common/linux_oldolduname.c: revision 1.67
sys/compat/common/if_media_80.c: revision 1.4
sys/compat/linux/arch/alpha/linux_osf1.c: revision 1.5
sys/compat/netbsd32/netbsd32_nfssvc.c: revision 1.8
sys/compat/linux32/common/linux32_signal.c: revision 1.21
sys/compat/common/kern_sig_13.c: revision 1.22
sys/compat/sunos32/sunos32_ioctl.c: revision 1.36
sys/compat/netbsd32/netbsd32_compat_43.c: revision 1.62
sys/compat/linux/arch/arm/linux_ptrace.c: revision 1.23
sys/compat/netbsd32/netbsd32_time.c: revision 1.56
sys/compat/linux/common/linux_signal.c: revision 1.84
sys/compat/netbsd32/netbsd32_signal.c: revision 1.52
sys/compat/sunos32/sunos32_misc.c: revision 1.85
sys/compat/linux/common/linux_time.c: revision 1.40
sys/compat/linux/common/linux_fdio.c: revision 1.14
sys/compat/common/vfs_syscalls_30.c: revision 1.43

sys/compat: Memset zero before copyout.

Just in case of uninitialized padding which would lead to kernel
stack disclosure. If the compiler can prove the memset redundant
then it can optimize it away; otherwise better safe than sorry.
 1.7 12-Dec-2019  pgoyette Rather than keeping a separate mutex, condvar, and pserialize for each
module hook, we can share a common set of synchronization structures.
This cuts the amount of cacheline_aligned data for these structures by
50%.

Note that we still have a per-hook localcount, since we need to count
individual references.

As discussed with riastradh@

Welcome to 9.99.22 !
 1.6 01-Mar-2019  pgoyette Rename the MODULE_*_HOOK() macros to MODULE_HOOK_*() as briefly
discussed on irc.

NFCI intended.

Ride the earlier kernel bump - it;s getting crowded.
 1.5 05-Feb-2019  pgoyette The sunos and sunos32 modules require compat_09, not compat (the
latter no longer exists).

Should fix "missing prerequisite" errors seen during qemu boot
of sparc64's MODULAR kernel.
 1.4 27-Jan-2019  pgoyette Merge the [pgoyette-compat] branch
 1.3 07-Mar-2014  christos branches: 1.3.28; 1.3.30;
c99 initializers for struct execsw
 1.2 19-Sep-2013  christos exec modules need to be of the exec kind
 1.1 19-Nov-2008  ad branches: 1.1.4; 1.1.6; 1.1.8; 1.1.12; 1.1.24; 1.1.34; 1.1.38;
Make the emulations, exec formats, coredump, NFS, and the NFS server
into modules. By and large this commit:

- shuffles header files and ifdefs
- splits code out where necessary to be modular
- adds module glue for each of the components
- adds/replaces hooks for things that can be installed at runtime
 1.1.38.1 18-May-2014  rmind sync with head
 1.1.34.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.24.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.1.12.2 04-May-2009  yamt sync with head.
 1.1.12.1 19-Nov-2008  yamt file sunos_mod.c was added on branch yamt-nfs-mp on 2009-05-04 08:12:27 +0000
 1.1.8.2 19-Jan-2009  skrll Sync with HEAD.
 1.1.8.1 19-Nov-2008  skrll file sunos_mod.c was added on branch nick-hppapmap on 2009-01-19 13:17:40 +0000
 1.1.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.1.6.1 19-Nov-2008  mjf file sunos_mod.c was added on branch mjf-devfs2 on 2009-01-17 13:28:48 +0000
 1.1.4.2 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.1.4.1 19-Nov-2008  haad file sunos_mod.c was added on branch haad-dm on 2008-12-13 01:14:04 +0000
 1.3.30.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.3.30.1 10-Jun-2019  christos Sync with HEAD
 1.3.28.3 23-Jan-2019  pgoyette Convert the macros for setting and unsetting a hook to generate
in-line code rather than using an intermediary hook##set routine.
Hooks are set and unset only in one place, so the intermediary
routine provides no benefit. IMHO using the macro at the point-
of-call is more readable than using it elsewhere in the code and
then calling the generated intermediary routine (for which you
won't even find its declaration or definition unless you remember
to search for the HOOK_SET macro instead).

NFC intended, will verify with a bulk build and an atf test run.
 1.3.28.2 18-Oct-2018  pgoyette Add a few more references to the (currently always but not forever)
built-in compat_util module
 1.3.28.1 02-Oct-2018  pgoyette Use a hook callback to allow sparc fpu code to determine if a process
is running under sunos emulation (in which case, fpu cleanup uses a
different set of fpu_codes[]).
 1.99 11-Jun-2020  dholland Regen after -r1.82 of compat_sunos syscalls.master last September.

(Apparently forgotten.)

"Treat valsize as unsigned"
 1.98 27-Jan-2019  pgoyette Merge the [pgoyette-compat] branch
 1.97 10-Aug-2018  pgoyette Regen
 1.96 06-Jan-2018  kamil branches: 1.96.2; 1.96.4;
Revert vadvise(2) removal

This system call was used in legacy Lisp code, that was inherited to modern
age and still compiled against supported compat layers (e.g. in clisp,
oaklisp, Franz Lisp).

It used to instruct the kernel about paging policy (G/C aware, flush etc).

Newly compiled code (assuming that it will detect vadvise()) will use the
libc stub for vadvise(). The headers for this interface are gone.

vadvise(2) could be marked as COMPAT_80, but as long as we support ultrix,
sunos or aout68k ABI, don't bother with this.

Requested by <mrg>
 1.95 19-Dec-2017  kamil compat/sunos: Drop SYS_vadvise

The (o)vadvise syscall is dummy since the beginning of NetBSD.

Sponsored by <The NetBSD Foundation>
 1.94 19-Dec-2017  kamil compat/sunos: Drop SYS_sbrk

sbrk - change data segment size

This syscall is dummy since the inception of the project.

Sponsored by <The NetBSD Foundation>
 1.93 19-Dec-2017  kamil compat sunos: Drop the sstk(2) syscall

sstk(2) has never been implemented by the NetBSD kernel.

Sponsored by <The NetBSD Foundation>
 1.92 10-May-2017  riastradh regen
 1.91 16-Jan-2017  christos branches: 1.91.4;
regen
 1.90 13-Jan-2017  christos branches: 1.90.2;
regen
 1.89 24-Sep-2015  christos branches: 1.89.2;
regen
 1.88 07-Mar-2015  christos regen
 1.87 07-Nov-2013  njoly branches: 1.87.6;
Regen for dup/dup2/dup3 argument types fix.
 1.86 03-Mar-2010  pooka branches: 1.86.10; 1.86.20; 1.86.24;
regen: ENOSYS nfssvc honestly
 1.85 14-Dec-2009  matt branches: 1.85.2;
Regen (new makesyscalls.sh)
 1.84 13-Jan-2009  pooka Regen to prove I didn't screw up the conversion: purely RCSID changes.
 1.83 13-Jan-2009  pooka regen: unimpl police
 1.82 11-Jan-2009  tsutsui Regen from syscalls.master rev 1.72:
> Update for compat_50 stuff. (compile test only)
 1.81 19-Nov-2008  ad Regen.
 1.80 21-Jun-2008  tsutsui branches: 1.80.2; 1.80.4;
Regen from syscalls.master rev 1.69:
> Include <sys/sched.h> before <sys/syscallargs.h> for cpuset_t.
 1.79 27-Dec-2007  martin branches: 1.79.6; 1.79.10; 1.79.12; 1.79.14;
Remove now superflous (and wrong) extern declaration for maxfiles.
 1.78 20-Dec-2007  dsl regen
 1.77 04-Mar-2007  christos branches: 1.77.16; 1.77.22; 1.77.24; 1.77.28;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.76 01-Sep-2006  matt branches: 1.76.8;
Regen.
 1.75 30-Aug-2006  he Regen (for PTRACE).
 1.74 13-Jul-2006  pavel regen
 1.73 11-Dec-2005  christos branches: 1.73.4; 1.73.8;
merge ktrace-lwp.
 1.72 26-Feb-2005  perry branches: 1.72.4;
regen
 1.71 26-Feb-2005  perry regen
 1.70 18-Jan-2003  thorpej branches: 1.70.2; 1.70.10; 1.70.12;
Regen for correct RCS ID.
 1.69 18-Jan-2003  thorpej Regen: Merge the nathanw_sa branch.
 1.68 01-Nov-2002  jdolecek set nsysent to 256
 1.67 03-Jan-2002  mrg move the COMPAT_SUNOS SO_BROADCAST hack out of uipc_socket.c into the
compat/sunos code. besides being cleaner this allows the sunos LKM
to properly work without any special kernel hacks.
 1.66 13-Nov-2001  lukem add RCSIDs (including regeneration of files as appropriate)
 1.65 30-May-2001  mrg branches: 1.65.2;
use _KERNEL_OPT.
 1.64 27-Jan-2001  thorpej branches: 1.64.2;
Regen; add sy_flags.
 1.63 09-Dec-2000  mycroft Regen.
 1.62 09-Dec-2000  mycroft Regen.
 1.61 18-Aug-2000  cgd update for changed makesyscalls.master
 1.60 09-Apr-2000  mrg regen
 1.59 12-Jul-1999  kleink branches: 1.59.2;
Regen.
 1.58 22-Mar-1999  sommerfe branches: 1.58.4;
Use regular system fchroot, now that we have it.
 1.57 09-Feb-1999  christos Regen
 1.56 18-Dec-1998  drochner regen
 1.55 10-Dec-1998  christos Regen
 1.54 19-Oct-1998  tron Regen.
 1.53 13-Sep-1998  pk regen.
 1.52 25-Jun-1998  thorpej Regen: defopt NFSSERVER
 1.51 19-Feb-1998  thorpej Regen: makesyscalls.sh changed.
 1.50 19-Feb-1998  thorpej regen; syscalls.master and makesyscalls.sh changed.
 1.49 09-Jan-1998  thorpej Regen.
 1.48 08-Jan-1998  thorpej Regen: back out RCD ID related changes.
 1.47 05-Jan-1998  perry regened with RCSIDs in place
 1.46 19-Oct-1997  christos Regen.
 1.45 17-Oct-1997  christos Regen
 1.44 10-Oct-1997  fvdl Regen.
 1.43 13-Jun-1997  thorpej branches: 1.43.4;
Regen: Use compat_12_sys_swapon().
 1.42 12-Jun-1997  mrg bring mrg-vm-swap2 onto mainline.
 1.41 31-Jan-1997  thorpej branches: 1.41.6;
Syscalls.master chagned, regen. (NFSCLIENT -> NFS)
 1.40 13-Jan-1997  thorpej branches: 1.40.2;
Regen; makesyscalls.sh emits comments now.
 1.39 07-Sep-1996  mycroft Regen.
 1.38 07-Sep-1996  mycroft Regen.
 1.37 30-Aug-1996  christos regen syscall tables
 1.36 26-Aug-1996  thorpej Regen; syscalls.master changed.
 1.35 23-Jun-1996  mycroft Regen.
 1.34 05-May-1996  veego branches: 1.34.4;
Added a missing Makefile and run it
Moved the prototyp for sunos_sendsig in an #ifndef sparc
 1.33 07-Oct-1995  mycroft Reran makesyscalls.sh.
 1.32 19-Sep-1995  thorpej makesyscalls.sh changed.
 1.31 05-Jul-1995  pk Start using sunos_sigvec().
 1.30 25-Jun-1995  briggs Oops... NOARGS for compat_43_sigvec.
 1.29 25-Jun-1995  briggs syscalls.master changed.
 1.28 24-Jun-1995  christos Syscalls.master was changed
 1.27 11-Jun-1995  pk Go with the flow; use `/emul/sunos' pseudo-root (from Matthew Green).
Note: sunos_stat() and sunos_lstat() were added too.
 1.26 22-Apr-1995  christos syscalls.master was changed
 1.25 22-Apr-1995  christos - added struct emul to all emulations.
- removed all setup functions.
- added copyargs() functions where needed.
 1.24 06-Dec-1994  deraadt update
 1.23 26-Nov-1994  deraadt update
 1.22 20-Nov-1994  deraadt new syscalls
 1.21 14-Nov-1994  deraadt syscalls.master changed
 1.20 26-Oct-1994  deraadt update
 1.19 25-Oct-1994  deraadt and we update these
 1.18 25-Oct-1994  deraadt rename, new syscall interface, etc.
 1.17 30-Jun-1994  cgd fix a botch, and gen syscall files
 1.16 14-Jun-1994  chopps update to match recent getdtablesize() change
 1.15 07-May-1994  deraadt follow
 1.14 01-May-1994  cgd sun syscalls.master update
 1.13 26-Apr-1994  pk SunOS's RLIMIT_NOFILE is different: add sun_[gs]rlimit().
 1.12 04-Apr-1994  deraadt nice unique SUN_SYS_ names..
 1.11 27-Mar-1994  cgd expand uid_t/gid_t/off_t
 1.10 03-Mar-1994  deraadt update to syscall.master (for sysconf)
 1.9 12-Dec-1993  deraadt update to latest syscalls.master
 1.8 22-Nov-1993  deraadt branches: 1.8.2;
moved from arch/sparc/sunos to compat/sunos
 1.7 20-Nov-1993  deraadt update to new syscalls.master
 1.6 14-Nov-1993  deraadt update to latest syscalls.master
 1.5 10-Nov-1993  deraadt update from new syscalls.master
 1.4 15-Oct-1993  deraadt rebuilt from syscall.master: {get,set}domainname change
 1.3 13-Oct-1993  deraadt rebuild files from syscalls.master
 1.2 11-Oct-1993  deraadt various changes, suffice to say that 4.4 syscalls do not look like ours
 1.1 02-Oct-1993  deraadt Chris Torek's sparc port. Missing lots of things.
 1.8.2.5 01-Dec-1993  deraadt update with new sun_mknod
 1.8.2.4 27-Nov-1993  deraadt update (as always)
 1.8.2.3 27-Nov-1993  deraadt update
 1.8.2.2 27-Nov-1993  deraadt update..
 1.8.2.1 26-Nov-1993  deraadt update to syscalls.master
 1.34.4.1 10-Dec-1996  mycroft Regen.
 1.40.2.1 14-Jan-1997  thorpej syscalls.master changed; regen.
 1.41.6.1 01-Jun-1997  mrg regen.
 1.43.4.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.58.4.1 02-Aug-1999  thorpej Regen.
 1.59.2.2 13-Dec-2000  bouyer Sync with HEAD (for UBC fixes).
 1.59.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.64.2.6 11-Nov-2002  nathanw Catch up to -current
 1.64.2.5 29-May-2002  nathanw Regen.
 1.64.2.4 28-Feb-2002  nathanw Catch up to -current.
 1.64.2.3 15-Nov-2001  pk Regenerate.
 1.64.2.2 14-Nov-2001  nathanw Catch up to -current.
 1.64.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.65.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.70.12.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.70.10.1 29-Apr-2005  kent sync with -current
 1.70.2.1 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.72.4.3 21-Jan-2008  yamt sync with head
 1.72.4.2 03-Sep-2007  yamt sync with head.
 1.72.4.1 30-Dec-2006  yamt sync with head.
 1.73.8.2 03-Sep-2006  yamt sync with head.
 1.73.8.1 11-Aug-2006  yamt sync with head
 1.73.4.1 09-Sep-2006  rpaulo sync with head
 1.76.8.1 12-Mar-2007  rmind Sync with HEAD.
 1.77.28.1 02-Jan-2008  bouyer Sync with HEAD
 1.77.24.1 26-Dec-2007  ad Sync with head.
 1.77.22.1 18-Feb-2008  mjf Sync with HEAD.
 1.77.16.1 09-Jan-2008  matt sync with HEAD
 1.79.14.1 27-Jun-2008  simonb Sync with head.
 1.79.12.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.79.10.2 11-Mar-2010  yamt sync with head
 1.79.10.1 04-May-2009  yamt sync with head.
 1.79.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.79.6.1 29-Jun-2008  mjf Sync with HEAD.
 1.80.4.1 19-Jan-2009  skrll Sync with HEAD.
 1.80.2.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.85.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.86.24.1 18-May-2014  rmind sync with head
 1.86.20.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.86.10.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.87.6.1 06-Apr-2015  skrll Sync with HEAD
 1.89.2.1 20-Mar-2017  pgoyette Sync with HEAD
 1.90.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.91.4.1 11-May-2017  pgoyette Sync with HEAD
 1.96.4.1 10-Jun-2019  christos Sync with HEAD
 1.96.2.3 29-Sep-2018  pgoyette Regen
 1.96.2.2 29-Sep-2018  pgoyette Regen
 1.96.2.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.83 11-Jun-2020  dholland Regen after -r1.82 of compat_sunos syscalls.master last September.

(Apparently forgotten.)

"Treat valsize as unsigned"
 1.82 27-Jan-2019  pgoyette Merge the [pgoyette-compat] branch
 1.81 10-Aug-2018  pgoyette Regen
 1.80 06-Jan-2018  kamil branches: 1.80.2; 1.80.4;
Revert vadvise(2) removal

This system call was used in legacy Lisp code, that was inherited to modern
age and still compiled against supported compat layers (e.g. in clisp,
oaklisp, Franz Lisp).

It used to instruct the kernel about paging policy (G/C aware, flush etc).

Newly compiled code (assuming that it will detect vadvise()) will use the
libc stub for vadvise(). The headers for this interface are gone.

vadvise(2) could be marked as COMPAT_80, but as long as we support ultrix,
sunos or aout68k ABI, don't bother with this.

Requested by <mrg>
 1.79 19-Dec-2017  kamil compat/sunos: Drop SYS_vadvise

The (o)vadvise syscall is dummy since the beginning of NetBSD.

Sponsored by <The NetBSD Foundation>
 1.78 19-Dec-2017  kamil compat/sunos: Drop SYS_sbrk

sbrk - change data segment size

This syscall is dummy since the inception of the project.

Sponsored by <The NetBSD Foundation>
 1.77 19-Dec-2017  kamil compat sunos: Drop the sstk(2) syscall

sstk(2) has never been implemented by the NetBSD kernel.

Sponsored by <The NetBSD Foundation>
 1.76 10-May-2017  riastradh regen
 1.75 16-Jan-2017  christos branches: 1.75.4;
regen
 1.74 13-Jan-2017  christos branches: 1.74.2;
regen
 1.73 24-Sep-2015  christos branches: 1.73.2;
regen
 1.72 07-Mar-2015  christos regen
 1.71 07-Nov-2013  njoly branches: 1.71.6;
Regen for dup/dup2/dup3 argument types fix.
 1.70 03-Mar-2010  pooka branches: 1.70.10; 1.70.20; 1.70.24;
regen: ENOSYS nfssvc honestly
 1.69 14-Dec-2009  matt branches: 1.69.2;
Regen (new makesyscalls.sh)
 1.68 13-Jan-2009  pooka Regen to prove I didn't screw up the conversion: purely RCSID changes.
 1.67 13-Jan-2009  pooka regen: unimpl police
 1.66 11-Jan-2009  tsutsui Regen from syscalls.master rev 1.72:
> Update for compat_50 stuff. (compile test only)
 1.65 19-Nov-2008  ad Regen.
 1.64 21-Jun-2008  tsutsui branches: 1.64.2; 1.64.4;
Regen from syscalls.master rev 1.69:
> Include <sys/sched.h> before <sys/syscallargs.h> for cpuset_t.
 1.63 27-Dec-2007  martin branches: 1.63.6; 1.63.10; 1.63.12; 1.63.14;
Remove now superflous (and wrong) extern declaration for maxfiles.
 1.62 20-Dec-2007  dsl regen
 1.61 04-Mar-2007  christos branches: 1.61.16; 1.61.22; 1.61.24; 1.61.28;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.60 01-Sep-2006  matt branches: 1.60.8;
Regen.
 1.59 30-Aug-2006  he Regen (for PTRACE).
 1.58 13-Jul-2006  pavel regen
 1.57 11-Dec-2005  christos branches: 1.57.4; 1.57.8;
merge ktrace-lwp.
 1.56 26-Feb-2005  perry branches: 1.56.4;
regen
 1.55 26-Feb-2005  perry regen
 1.54 18-Jan-2003  thorpej branches: 1.54.2; 1.54.10; 1.54.12;
Regen for correct RCS ID.
 1.53 18-Jan-2003  thorpej Regen: Merge the nathanw_sa branch.
 1.52 03-Jan-2002  mrg move the COMPAT_SUNOS SO_BROADCAST hack out of uipc_socket.c into the
compat/sunos code. besides being cleaner this allows the sunos LKM
to properly work without any special kernel hacks.
 1.51 13-Nov-2001  lukem add RCSIDs (including regeneration of files as appropriate)
 1.50 30-May-2001  mrg branches: 1.50.2;
use _KERNEL_OPT.
 1.49 27-Jan-2001  thorpej branches: 1.49.2;
Regen; add sy_flags.
 1.48 09-Dec-2000  mycroft Regen.
 1.47 09-Dec-2000  mycroft Regen.
 1.46 18-Aug-2000  cgd update for changed makesyscalls.master
 1.45 18-Aug-2000  cgd update for changed makesyscalls.sh
 1.44 09-Apr-2000  mrg regen
 1.43 12-Jul-1999  kleink branches: 1.43.2;
Regen.
 1.42 22-Mar-1999  sommerfe branches: 1.42.4;
Use regular system fchroot, now that we have it.
 1.41 09-Feb-1999  christos Regen
 1.40 18-Dec-1998  drochner regen
 1.39 10-Dec-1998  christos Regen
 1.38 19-Oct-1998  tron Regen.
 1.37 03-Oct-1998  eeh Fixup big-endian syscall args.
 1.36 13-Sep-1998  pk regen.
 1.35 25-Jun-1998  thorpej Regen: defopt NFSSERVER
 1.34 19-Feb-1998  thorpej Regen: makesyscalls.sh changed.
 1.33 19-Feb-1998  thorpej regen; syscalls.master and makesyscalls.sh changed.
 1.32 09-Jan-1998  thorpej Regen.
 1.31 08-Jan-1998  thorpej Regen: back out RCD ID related changes.
 1.30 05-Jan-1998  perry regened with RCSIDs in place
 1.29 19-Oct-1997  christos Regen.
 1.28 17-Oct-1997  christos Regen
 1.27 10-Oct-1997  fvdl Regen.
 1.26 13-Jun-1997  thorpej branches: 1.26.4;
Regen: Use compat_12_sys_swapon().
 1.25 12-Jun-1997  mrg bring mrg-vm-swap2 onto mainline.
 1.24 31-Jan-1997  thorpej branches: 1.24.2; 1.24.6;
Syscalls.master chagned, regen. (NFSCLIENT -> NFS)
 1.23 07-Sep-1996  mycroft branches: 1.23.2;
Regen.
 1.22 07-Sep-1996  mycroft Regen.
 1.21 30-Aug-1996  christos regen syscall tables
 1.20 26-Aug-1996  thorpej Regen; syscalls.master changed.
 1.19 23-Jun-1996  mycroft Regen.
 1.18 05-May-1996  veego branches: 1.18.4;
Added a missing Makefile and run it
Moved the prototyp for sunos_sendsig in an #ifndef sparc
 1.17 28-Feb-1996  pk syscalls.master changed.
 1.16 07-Oct-1995  mycroft Reran makesyscalls.sh.
 1.15 19-Sep-1995  thorpej makesyscalls.sh changed.
 1.14 05-Jul-1995  pk Start using sunos_sigvec().
 1.13 25-Jun-1995  briggs Oops... NOARGS for compat_43_sigvec.
 1.12 25-Jun-1995  briggs syscalls.master changed.
 1.11 24-Jun-1995  christos Syscalls.master was changed
 1.10 11-Jun-1995  pk Go with the flow; use `/emul/sunos' pseudo-root (from Matthew Green).
Note: sunos_stat() and sunos_lstat() were added too.
 1.9 22-Apr-1995  christos syscalls.master was changed
 1.8 22-Apr-1995  christos - added struct emul to all emulations.
- removed all setup functions.
- added copyargs() functions where needed.
 1.7 06-Dec-1994  deraadt update
 1.6 26-Nov-1994  deraadt update
 1.5 20-Nov-1994  deraadt new syscalls
 1.4 14-Nov-1994  deraadt syscalls.master changed
 1.3 26-Oct-1994  deraadt update
 1.2 25-Oct-1994  deraadt and we update these
 1.1 25-Oct-1994  deraadt and these
 1.18.4.1 10-Dec-1996  mycroft Regen.
 1.23.2.1 14-Jan-1997  thorpej syscalls.master changed; regen.
 1.24.6.1 01-Jun-1997  mrg regen.
 1.24.2.1 14-Feb-1997  mrg regen.
 1.26.4.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.42.4.1 02-Aug-1999  thorpej Regen.
 1.43.2.2 13-Dec-2000  bouyer Sync with HEAD (for UBC fixes).
 1.43.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.49.2.6 29-May-2002  nathanw Regen.
 1.49.2.5 28-Feb-2002  nathanw Catch up to -current.
 1.49.2.4 11-Jan-2002  nathanw More catchup.
 1.49.2.3 15-Nov-2001  pk Regenerate.
 1.49.2.2 14-Nov-2001  nathanw Catch up to -current.
 1.49.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.50.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.54.12.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.54.10.1 29-Apr-2005  kent sync with -current
 1.54.2.1 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.56.4.3 21-Jan-2008  yamt sync with head
 1.56.4.2 03-Sep-2007  yamt sync with head.
 1.56.4.1 30-Dec-2006  yamt sync with head.
 1.57.8.2 03-Sep-2006  yamt sync with head.
 1.57.8.1 11-Aug-2006  yamt sync with head
 1.57.4.1 09-Sep-2006  rpaulo sync with head
 1.60.8.1 12-Mar-2007  rmind Sync with HEAD.
 1.61.28.1 02-Jan-2008  bouyer Sync with HEAD
 1.61.24.1 26-Dec-2007  ad Sync with head.
 1.61.22.1 18-Feb-2008  mjf Sync with HEAD.
 1.61.16.1 09-Jan-2008  matt sync with HEAD
 1.63.14.1 27-Jun-2008  simonb Sync with head.
 1.63.12.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.63.10.2 11-Mar-2010  yamt sync with head
 1.63.10.1 04-May-2009  yamt sync with head.
 1.63.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.63.6.1 29-Jun-2008  mjf Sync with HEAD.
 1.64.4.1 19-Jan-2009  skrll Sync with HEAD.
 1.64.2.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.69.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.70.24.1 18-May-2014  rmind sync with head
 1.70.20.2 03-Dec-2017  jdolecek update from HEAD
 1.70.20.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.70.10.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.71.6.2 28-Aug-2017  skrll Sync with HEAD
 1.71.6.1 06-Apr-2015  skrll Sync with HEAD
 1.73.2.1 20-Mar-2017  pgoyette Sync with HEAD
 1.74.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.75.4.1 11-May-2017  pgoyette Sync with HEAD
 1.80.4.1 10-Jun-2019  christos Sync with HEAD
 1.80.2.3 29-Sep-2018  pgoyette Regen
 1.80.2.2 29-Sep-2018  pgoyette Regen
 1.80.2.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.98 11-Jun-2020  dholland Regen after -r1.82 of compat_sunos syscalls.master last September.

(Apparently forgotten.)

"Treat valsize as unsigned"
 1.97 27-Jan-2019  pgoyette Merge the [pgoyette-compat] branch
 1.96 10-Aug-2018  pgoyette Regen
 1.95 06-Jan-2018  kamil branches: 1.95.2; 1.95.4;
Revert vadvise(2) removal

This system call was used in legacy Lisp code, that was inherited to modern
age and still compiled against supported compat layers (e.g. in clisp,
oaklisp, Franz Lisp).

It used to instruct the kernel about paging policy (G/C aware, flush etc).

Newly compiled code (assuming that it will detect vadvise()) will use the
libc stub for vadvise(). The headers for this interface are gone.

vadvise(2) could be marked as COMPAT_80, but as long as we support ultrix,
sunos or aout68k ABI, don't bother with this.

Requested by <mrg>
 1.94 19-Dec-2017  kamil compat/sunos: Drop SYS_vadvise

The (o)vadvise syscall is dummy since the beginning of NetBSD.

Sponsored by <The NetBSD Foundation>
 1.93 19-Dec-2017  kamil compat/sunos: Drop SYS_sbrk

sbrk - change data segment size

This syscall is dummy since the inception of the project.

Sponsored by <The NetBSD Foundation>
 1.92 19-Dec-2017  kamil compat sunos: Drop the sstk(2) syscall

sstk(2) has never been implemented by the NetBSD kernel.

Sponsored by <The NetBSD Foundation>
 1.91 10-May-2017  riastradh regen
 1.90 16-Jan-2017  christos branches: 1.90.4;
regen
 1.89 13-Jan-2017  christos branches: 1.89.2;
regen
 1.88 24-Sep-2015  christos branches: 1.88.2;
regen
 1.87 07-Mar-2015  christos regen
 1.86 07-Nov-2013  njoly branches: 1.86.6;
Regen for dup/dup2/dup3 argument types fix.
 1.85 03-Mar-2010  pooka branches: 1.85.10; 1.85.20; 1.85.24;
regen: ENOSYS nfssvc honestly
 1.84 14-Dec-2009  matt branches: 1.84.2;
Regen (new makesyscalls.sh)
 1.83 13-Jan-2009  pooka Regen to prove I didn't screw up the conversion: purely RCSID changes.
 1.82 13-Jan-2009  pooka regen: unimpl police
 1.81 11-Jan-2009  tsutsui Regen from syscalls.master rev 1.72:
> Update for compat_50 stuff. (compile test only)
 1.80 19-Nov-2008  ad Regen.
 1.79 21-Jun-2008  tsutsui branches: 1.79.2; 1.79.4;
Regen from syscalls.master rev 1.69:
> Include <sys/sched.h> before <sys/syscallargs.h> for cpuset_t.
 1.78 27-Dec-2007  martin branches: 1.78.6; 1.78.10; 1.78.12; 1.78.14;
Remove now superflous (and wrong) extern declaration for maxfiles.
 1.77 20-Dec-2007  dsl regen
 1.76 09-Feb-2007  ad branches: 1.76.20; 1.76.26; 1.76.28; 1.76.32;
Merge newlock2 to head.
 1.75 01-Sep-2006  matt branches: 1.75.2;
Regen.
 1.74 30-Aug-2006  he Regen (for PTRACE).
 1.73 13-Jul-2006  pavel regen
 1.72 11-Dec-2005  christos branches: 1.72.4; 1.72.8;
merge ktrace-lwp.
 1.71 26-Feb-2005  perry branches: 1.71.4;
regen
 1.70 26-Feb-2005  perry regen
 1.69 18-Jan-2003  thorpej branches: 1.69.2; 1.69.10; 1.69.12;
Regen for correct RCS ID.
 1.68 18-Jan-2003  thorpej Regen: Merge the nathanw_sa branch.
 1.67 03-Jan-2002  mrg move the COMPAT_SUNOS SO_BROADCAST hack out of uipc_socket.c into the
compat/sunos code. besides being cleaner this allows the sunos LKM
to properly work without any special kernel hacks.
 1.66 13-Nov-2001  lukem add RCSIDs (including regeneration of files as appropriate)
 1.65 30-May-2001  mrg branches: 1.65.2;
use _KERNEL_OPT.
 1.64 27-Jan-2001  thorpej branches: 1.64.2;
Regen; add sy_flags.
 1.63 09-Dec-2000  mycroft Regen.
 1.62 09-Dec-2000  mycroft Regen.
 1.61 13-Nov-2000  jdolecek change the type of *syscallnames[] array to 'const char * const foo[]'
 1.60 18-Aug-2000  cgd update for changed makesyscalls.master
 1.59 09-Apr-2000  mrg regen
 1.58 12-Jul-1999  kleink branches: 1.58.2;
Regen.
 1.57 22-Mar-1999  sommerfe branches: 1.57.4;
Use regular system fchroot, now that we have it.
 1.56 09-Feb-1999  christos Regen
 1.55 18-Dec-1998  drochner regen
 1.54 10-Dec-1998  christos Regen
 1.53 19-Oct-1998  tron Regen.
 1.52 13-Sep-1998  pk regen.
 1.51 25-Jun-1998  thorpej Regen: defopt NFSSERVER
 1.50 19-Feb-1998  thorpej Regen: makesyscalls.sh changed.
 1.49 19-Feb-1998  thorpej regen; syscalls.master and makesyscalls.sh changed.
 1.48 09-Jan-1998  thorpej Regen.
 1.47 08-Jan-1998  thorpej Regen: back out RCD ID related changes.
 1.46 05-Jan-1998  perry regened with RCSIDs in place
 1.45 19-Oct-1997  christos Regen.
 1.44 17-Oct-1997  christos Regen
 1.43 10-Oct-1997  fvdl Regen.
 1.42 13-Jun-1997  thorpej branches: 1.42.4;
Regen: Use compat_12_sys_swapon().
 1.41 12-Jun-1997  mrg bring mrg-vm-swap2 onto mainline.
 1.40 31-Jan-1997  thorpej branches: 1.40.6;
Syscalls.master chagned, regen. (NFSCLIENT -> NFS)
 1.39 07-Sep-1996  mycroft branches: 1.39.2;
Regen.
 1.38 07-Sep-1996  mycroft Regen.
 1.37 30-Aug-1996  christos regen syscall tables
 1.36 26-Aug-1996  thorpej Regen; syscalls.master changed.
 1.35 23-Jun-1996  mycroft Regen.
 1.34 05-May-1996  veego branches: 1.34.4;
Added a missing Makefile and run it
Moved the prototyp for sunos_sendsig in an #ifndef sparc
 1.33 07-Oct-1995  mycroft Reran makesyscalls.sh.
 1.32 19-Sep-1995  thorpej makesyscalls.sh changed.
 1.31 05-Jul-1995  pk Start using sunos_sigvec().
 1.30 25-Jun-1995  briggs Oops... NOARGS for compat_43_sigvec.
 1.29 25-Jun-1995  briggs syscalls.master changed.
 1.28 24-Jun-1995  christos Syscalls.master was changed
 1.27 11-Jun-1995  pk Go with the flow; use `/emul/sunos' pseudo-root (from Matthew Green).
Note: sunos_stat() and sunos_lstat() were added too.
 1.26 22-Apr-1995  christos syscalls.master was changed
 1.25 22-Apr-1995  christos - added struct emul to all emulations.
- removed all setup functions.
- added copyargs() functions where needed.
 1.24 06-Dec-1994  deraadt update
 1.23 26-Nov-1994  deraadt update
 1.22 20-Nov-1994  deraadt new syscalls
 1.21 14-Nov-1994  deraadt syscalls.master changed
 1.20 26-Oct-1994  deraadt update
 1.19 25-Oct-1994  deraadt and we update these
 1.18 25-Oct-1994  deraadt rename, new syscall interface, etc.
 1.17 30-Jun-1994  cgd fix a botch, and gen syscall files
 1.16 14-Jun-1994  chopps update to match recent getdtablesize() change
 1.15 07-May-1994  deraadt follow
 1.14 01-May-1994  cgd sun syscalls.master update
 1.13 26-Apr-1994  pk SunOS's RLIMIT_NOFILE is different: add sun_[gs]rlimit().
 1.12 04-Apr-1994  deraadt nice unique SUN_SYS_ names..
 1.11 27-Mar-1994  cgd expand uid_t/gid_t/off_t
 1.10 03-Mar-1994  deraadt update to syscall.master (for sysconf)
 1.9 12-Dec-1993  deraadt update to latest syscalls.master
 1.8 22-Nov-1993  deraadt branches: 1.8.2;
moved from arch/sparc/sunos to compat/sunos
 1.7 20-Nov-1993  deraadt update to new syscalls.master
 1.6 14-Nov-1993  deraadt update to latest syscalls.master
 1.5 10-Nov-1993  deraadt update from new syscalls.master
 1.4 15-Oct-1993  deraadt rebuilt from syscall.master: {get,set}domainname change
 1.3 13-Oct-1993  deraadt rebuild files from syscalls.master
 1.2 11-Oct-1993  deraadt various changes, suffice to say that 4.4 syscalls do not look like ours
 1.1 02-Oct-1993  deraadt Chris Torek's sparc port. Missing lots of things.
 1.8.2.5 01-Dec-1993  deraadt update with new sun_mknod
 1.8.2.4 27-Nov-1993  deraadt update (as always)
 1.8.2.3 27-Nov-1993  deraadt update
 1.8.2.2 27-Nov-1993  deraadt update..
 1.8.2.1 26-Nov-1993  deraadt update to syscalls.master
 1.34.4.1 10-Dec-1996  mycroft Regen.
 1.39.2.1 14-Jan-1997  thorpej syscalls.master changed; regen.
 1.40.6.1 01-Jun-1997  mrg regen.
 1.42.4.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.57.4.1 02-Aug-1999  thorpej Regen.
 1.58.2.3 13-Dec-2000  bouyer Sync with HEAD (for UBC fixes).
 1.58.2.2 22-Nov-2000  bouyer Sync with HEAD.
 1.58.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.64.2.6 29-May-2002  nathanw Regen.
 1.64.2.5 28-Feb-2002  nathanw Catch up to -current.
 1.64.2.4 11-Jan-2002  nathanw More catchup.
 1.64.2.3 15-Nov-2001  pk Regenerate.
 1.64.2.2 14-Nov-2001  nathanw Catch up to -current.
 1.64.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.65.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.69.12.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.69.10.1 29-Apr-2005  kent sync with -current
 1.69.2.1 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.71.4.3 21-Jan-2008  yamt sync with head
 1.71.4.2 26-Feb-2007  yamt sync with head.
 1.71.4.1 30-Dec-2006  yamt sync with head.
 1.72.8.2 03-Sep-2006  yamt sync with head.
 1.72.8.1 11-Aug-2006  yamt sync with head
 1.72.4.1 09-Sep-2006  rpaulo sync with head
 1.75.2.1 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.76.32.1 02-Jan-2008  bouyer Sync with HEAD
 1.76.28.1 26-Dec-2007  ad Sync with head.
 1.76.26.1 18-Feb-2008  mjf Sync with HEAD.
 1.76.20.1 09-Jan-2008  matt sync with HEAD
 1.78.14.1 27-Jun-2008  simonb Sync with head.
 1.78.12.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.78.10.2 11-Mar-2010  yamt sync with head
 1.78.10.1 04-May-2009  yamt sync with head.
 1.78.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.78.6.1 29-Jun-2008  mjf Sync with HEAD.
 1.79.4.1 19-Jan-2009  skrll Sync with HEAD.
 1.79.2.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.84.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.85.24.1 18-May-2014  rmind sync with head
 1.85.20.2 03-Dec-2017  jdolecek update from HEAD
 1.85.20.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.85.10.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.86.6.2 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.86.6.1 06-Apr-2015  skrll Sync with HEAD
 1.88.2.1 20-Mar-2017  pgoyette Sync with HEAD
 1.89.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.90.4.1 11-May-2017  pgoyette Sync with HEAD
 1.95.4.1 10-Jun-2019  christos Sync with HEAD
 1.95.2.3 29-Sep-2018  pgoyette Regen
 1.95.2.2 29-Sep-2018  pgoyette Regen
 1.95.2.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.94 11-Jun-2020  dholland Regen after -r1.82 of compat_sunos syscalls.master last September.

(Apparently forgotten.)

"Treat valsize as unsigned"
 1.93 27-Jan-2019  pgoyette Merge the [pgoyette-compat] branch
 1.92 10-Aug-2018  pgoyette Regen
 1.91 06-Jan-2018  kamil branches: 1.91.2; 1.91.4;
Revert vadvise(2) removal

This system call was used in legacy Lisp code, that was inherited to modern
age and still compiled against supported compat layers (e.g. in clisp,
oaklisp, Franz Lisp).

It used to instruct the kernel about paging policy (G/C aware, flush etc).

Newly compiled code (assuming that it will detect vadvise()) will use the
libc stub for vadvise(). The headers for this interface are gone.

vadvise(2) could be marked as COMPAT_80, but as long as we support ultrix,
sunos or aout68k ABI, don't bother with this.

Requested by <mrg>
 1.90 19-Dec-2017  kamil compat/sunos: Drop SYS_vadvise

The (o)vadvise syscall is dummy since the beginning of NetBSD.

Sponsored by <The NetBSD Foundation>
 1.89 19-Dec-2017  kamil compat/sunos: Drop SYS_sbrk

sbrk - change data segment size

This syscall is dummy since the inception of the project.

Sponsored by <The NetBSD Foundation>
 1.88 19-Dec-2017  kamil compat sunos: Drop the sstk(2) syscall

sstk(2) has never been implemented by the NetBSD kernel.

Sponsored by <The NetBSD Foundation>
 1.87 10-May-2017  riastradh regen
 1.86 16-Jan-2017  christos branches: 1.86.4;
regen
 1.85 13-Jan-2017  christos branches: 1.85.2;
regen
 1.84 24-Sep-2015  christos branches: 1.84.2;
regen
 1.83 07-Mar-2015  christos regen
 1.82 07-Nov-2013  njoly branches: 1.82.6;
Regen for dup/dup2/dup3 argument types fix.
 1.81 03-Mar-2010  pooka branches: 1.81.10; 1.81.20; 1.81.24;
regen: ENOSYS nfssvc honestly
 1.80 14-Dec-2009  matt branches: 1.80.2;
Regen (new makesyscalls.sh)
 1.79 13-Jan-2009  pooka Regen to prove I didn't screw up the conversion: purely RCSID changes.
 1.78 13-Jan-2009  pooka regen: unimpl police
 1.77 11-Jan-2009  tsutsui Regen from syscalls.master rev 1.72:
> Update for compat_50 stuff. (compile test only)
 1.76 19-Nov-2008  ad Regen.
 1.75 21-Jun-2008  tsutsui branches: 1.75.2; 1.75.4;
Regen from syscalls.master rev 1.69:
> Include <sys/sched.h> before <sys/syscallargs.h> for cpuset_t.
 1.74 17-Jun-2008  tsutsui Include <sys/sched.h> before <sys/syscallargs.h> for cpuset_t.
 1.73 27-Dec-2007  martin branches: 1.73.6; 1.73.10; 1.73.12; 1.73.14;
Remove now superflous (and wrong) extern declaration for maxfiles.
 1.72 20-Dec-2007  dsl regen
 1.71 09-Feb-2007  ad branches: 1.71.20; 1.71.26; 1.71.28; 1.71.32;
Merge newlock2 to head.
 1.70 01-Sep-2006  matt branches: 1.70.2;
Regen.
 1.69 30-Aug-2006  he Regen (for PTRACE).
 1.68 13-Jul-2006  pavel regen
 1.67 13-Jul-2006  martin COMPAT_SUNOS* uses COMPAT_30 getfh too
 1.66 11-Dec-2005  christos branches: 1.66.4; 1.66.8;
merge ktrace-lwp.
 1.65 26-Feb-2005  perry branches: 1.65.4;
regen
 1.64 26-Feb-2005  perry regen
 1.63 18-Jan-2003  thorpej branches: 1.63.2; 1.63.10; 1.63.12;
Regen for correct RCS ID.
 1.62 18-Jan-2003  thorpej Regen: Merge the nathanw_sa branch.
 1.61 01-Nov-2002  jdolecek set nsysent to 256
 1.60 03-Jan-2002  mrg move the COMPAT_SUNOS SO_BROADCAST hack out of uipc_socket.c into the
compat/sunos code. besides being cleaner this allows the sunos LKM
to properly work without any special kernel hacks.
 1.59 13-Nov-2001  lukem add RCSIDs (including regeneration of files as appropriate)
 1.58 30-May-2001  mrg branches: 1.58.2;
use _KERNEL_OPT.
 1.57 27-Jan-2001  thorpej branches: 1.57.2;
Regen; add sy_flags.
 1.56 09-Dec-2000  mycroft Regen.
 1.55 09-Dec-2000  mycroft Regen.
 1.54 30-Nov-2000  jdolecek LKMify
 1.53 18-Aug-2000  cgd update for changed makesyscalls.master
 1.52 09-Apr-2000  mrg regen
 1.51 12-Jul-1999  kleink branches: 1.51.2;
Regen.
 1.50 22-Mar-1999  sommerfe branches: 1.50.4;
Use regular system fchroot, now that we have it.
 1.49 09-Feb-1999  christos Regen
 1.48 18-Dec-1998  drochner regen
 1.47 10-Dec-1998  christos Regen
 1.46 19-Oct-1998  tron Regen.
 1.45 13-Sep-1998  pk regen.
 1.44 25-Jun-1998  thorpej Regen: defopt NFSSERVER
 1.43 19-Feb-1998  thorpej Regen: makesyscalls.sh changed.
 1.42 19-Feb-1998  thorpej regen; syscalls.master and makesyscalls.sh changed.
 1.41 09-Jan-1998  thorpej Regen.
 1.40 08-Jan-1998  thorpej Regen: back out RCD ID related changes.
 1.39 05-Jan-1998  perry regened with RCSIDs in place
 1.38 19-Oct-1997  christos Regen.
 1.37 17-Oct-1997  christos Regen
 1.36 10-Oct-1997  fvdl Regen.
 1.35 13-Jun-1997  thorpej branches: 1.35.4;
Regen: Use compat_12_sys_swapon().
 1.34 12-Jun-1997  mrg bring mrg-vm-swap2 onto mainline.
 1.33 31-Jan-1997  thorpej branches: 1.33.2; 1.33.6;
Syscalls.master chagned, regen. (NFSCLIENT -> NFS)
 1.32 07-Sep-1996  mycroft branches: 1.32.2;
Regen.
 1.31 07-Sep-1996  mycroft Regen.
 1.30 30-Aug-1996  christos regen syscall tables
 1.29 26-Aug-1996  thorpej Regen; syscalls.master changed.
 1.28 23-Jun-1996  mycroft Regen.
 1.27 05-May-1996  veego branches: 1.27.4;
Added a missing Makefile and run it
Moved the prototyp for sunos_sendsig in an #ifndef sparc
 1.26 28-Feb-1996  pk syscalls.master changed.
 1.25 07-Oct-1995  mycroft Reran makesyscalls.sh.
 1.24 19-Sep-1995  thorpej makesyscalls.sh changed.
 1.23 05-Jul-1995  pk Start using sunos_sigvec().
 1.22 25-Jun-1995  briggs Oops... NOARGS for compat_43_sigvec.
 1.21 25-Jun-1995  briggs syscalls.master changed.
 1.20 24-Jun-1995  christos Syscalls.master was changed
 1.19 11-Jun-1995  pk Go with the flow; use `/emul/sunos' pseudo-root (from Matthew Green).
Note: sunos_stat() and sunos_lstat() were added too.
 1.18 27-Apr-1995  christos Try to make the reboot system call compile under sun3 with RB_STRING
support [not tested]
Add files.sunos
Rename system call switch table file from sunos_init_sysent.c to sunos_sysent.c
like other emulations.
 1.17 30-Jun-1994  cgd fix a botch, and gen syscall files
 1.16 14-Jun-1994  chopps update to match recent getdtablesize() change
 1.15 07-May-1994  deraadt follow
 1.14 01-May-1994  cgd sun syscalls.master update
 1.13 26-Apr-1994  pk SunOS's RLIMIT_NOFILE is different: add sun_[gs]rlimit().
 1.12 04-Apr-1994  deraadt nice unique SUN_SYS_ names..
 1.11 27-Mar-1994  cgd expand uid_t/gid_t/off_t
 1.10 03-Mar-1994  deraadt update to syscall.master (for sysconf)
 1.9 12-Dec-1993  deraadt update to latest syscalls.master
 1.8 22-Nov-1993  deraadt branches: 1.8.2;
moved from arch/sparc/sunos to compat/sunos
 1.7 20-Nov-1993  deraadt update to new syscalls.master
 1.6 14-Nov-1993  deraadt update to latest syscalls.master
 1.5 10-Nov-1993  deraadt update from new syscalls.master
 1.4 15-Oct-1993  deraadt rebuilt from syscall.master: {get,set}domainname change
 1.3 13-Oct-1993  deraadt rebuild files from syscalls.master
 1.2 11-Oct-1993  deraadt various changes, suffice to say that 4.4 syscalls do not look like ours
 1.1 02-Oct-1993  deraadt Chris Torek's sparc port. Missing lots of things.
 1.8.2.5 01-Dec-1993  deraadt update with new sun_mknod
 1.8.2.4 27-Nov-1993  deraadt update (as always)
 1.8.2.3 27-Nov-1993  deraadt update
 1.8.2.2 27-Nov-1993  deraadt update..
 1.8.2.1 26-Nov-1993  deraadt update to syscalls.master
 1.27.4.1 10-Dec-1996  mycroft Regen.
 1.32.2.1 14-Jan-1997  thorpej syscalls.master changed; regen.
 1.33.6.1 01-Jun-1997  mrg regen.
 1.33.2.1 14-Feb-1997  mrg regen.
 1.35.4.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.50.4.1 02-Aug-1999  thorpej Regen.
 1.51.2.4 11-Feb-2001  bouyer Sync with HEAD.
 1.51.2.3 13-Dec-2000  bouyer Sync with HEAD (for UBC fixes).
 1.51.2.2 08-Dec-2000  bouyer Sync with HEAD.
 1.51.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.57.2.7 11-Nov-2002  nathanw Catch up to -current
 1.57.2.6 29-May-2002  nathanw Regen.
 1.57.2.5 28-Feb-2002  nathanw Catch up to -current.
 1.57.2.4 11-Jan-2002  nathanw More catchup.
 1.57.2.3 15-Nov-2001  pk Regenerate.
 1.57.2.2 14-Nov-2001  nathanw Catch up to -current.
 1.57.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.58.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.63.12.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.63.10.1 29-Apr-2005  kent sync with -current
 1.63.2.1 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.65.4.3 21-Jan-2008  yamt sync with head
 1.65.4.2 26-Feb-2007  yamt sync with head.
 1.65.4.1 30-Dec-2006  yamt sync with head.
 1.66.8.2 03-Sep-2006  yamt sync with head.
 1.66.8.1 11-Aug-2006  yamt sync with head
 1.66.4.1 09-Sep-2006  rpaulo sync with head
 1.70.2.1 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.71.32.1 02-Jan-2008  bouyer Sync with HEAD
 1.71.28.1 26-Dec-2007  ad Sync with head.
 1.71.26.1 18-Feb-2008  mjf Sync with HEAD.
 1.71.20.1 09-Jan-2008  matt sync with HEAD
 1.73.14.2 27-Jun-2008  simonb Sync with head.
 1.73.14.1 18-Jun-2008  simonb Sync with head.
 1.73.12.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.73.10.2 11-Mar-2010  yamt sync with head
 1.73.10.1 04-May-2009  yamt sync with head.
 1.73.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.73.6.1 29-Jun-2008  mjf Sync with HEAD.
 1.75.4.1 19-Jan-2009  skrll Sync with HEAD.
 1.75.2.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.80.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.81.24.1 18-May-2014  rmind sync with head
 1.81.20.2 03-Dec-2017  jdolecek update from HEAD
 1.81.20.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.81.10.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.82.6.2 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.82.6.1 06-Apr-2015  skrll Sync with HEAD
 1.84.2.1 20-Mar-2017  pgoyette Sync with HEAD
 1.85.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.86.4.1 11-May-2017  pgoyette Sync with HEAD
 1.91.4.1 10-Jun-2019  christos Sync with HEAD
 1.91.2.3 29-Sep-2018  pgoyette Regen
 1.91.2.2 29-Sep-2018  pgoyette Regen
 1.91.2.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.2 24-Jun-1995  christos Use compat_util.[ch]
 1.1 11-Jun-1995  pk Go with the flow; use `/emul/sunos' pseudo-root (from Matthew Green).
Note: sunos_stat() and sunos_lstat() were added too.
 1.7 01-Dec-2000  jdolecek add e_path (emulation path) to struct emul, which replaces emulation-specific
*_emul_path variables

change macros CHECK_ALT_{CREAT|EXIST} to use that, 'root' doesn't need
to be passed explicitly any more and *_CHECK_ALT_{CREAT|EXIST} are removed
change explicit emul_find() calls in probe functions to get the emulation
path from the checked exec switch entry's emulation

remove no longer needed header files

add e_flags and e_syscall to struct emul; these are unsed and empty for now
 1.6 09-Feb-1999  christos branches: 1.6.8;
Const poisoning and CHECK_ALT_CREAT fixes
 1.5 05-Sep-1998  christos Assign copyright to TNF.
 1.4 10-Oct-1997  mrg remove advertising clause from all my licenses.
 1.3 05-Oct-1996  mrg branches: 1.3.10;
minor copyright update.
 1.2 24-Jun-1995  christos Use compat_util.[ch]
 1.1 11-Jun-1995  pk Go with the flow; use `/emul/sunos' pseudo-root (from Matthew Green).
Note: sunos_stat() and sunos_lstat() were added too.
 1.3.10.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.6.8.1 08-Dec-2000  bouyer Sync with HEAD.
 1.5 01-Nov-2002  jdolecek set nsysent to 256
 1.4 18-Dec-1998  drochner branches: 1.4.20;
remove compat_xxx dependencies where they don't belong
 1.3 27-Apr-1995  christos Try to make the reboot system call compile under sun3 with RB_STRING
support [not tested]
Add files.sunos
Rename system call switch table file from sunos_init_sysent.c to sunos_sysent.c
like other emulations.
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 25-Oct-1994  deraadt and these
 1.4.20.1 11-Nov-2002  nathanw Catch up to -current
 1.82 23-Sep-2019  christos Treat valsize as unsigned
 1.81 27-Jan-2019  pgoyette Merge the [pgoyette-compat] branch
 1.80 06-Jan-2018  kamil branches: 1.80.2; 1.80.4;
Revert vadvise(2) removal

This system call was used in legacy Lisp code, that was inherited to modern
age and still compiled against supported compat layers (e.g. in clisp,
oaklisp, Franz Lisp).

It used to instruct the kernel about paging policy (G/C aware, flush etc).

Newly compiled code (assuming that it will detect vadvise()) will use the
libc stub for vadvise(). The headers for this interface are gone.

vadvise(2) could be marked as COMPAT_80, but as long as we support ultrix,
sunos or aout68k ABI, don't bother with this.

Requested by <mrg>
 1.79 19-Dec-2017  kamil compat/sunos: Drop SYS_vadvise

The (o)vadvise syscall is dummy since the beginning of NetBSD.

Sponsored by <The NetBSD Foundation>
 1.78 19-Dec-2017  kamil compat/sunos: Drop SYS_sbrk

sbrk - change data segment size

This syscall is dummy since the inception of the project.

Sponsored by <The NetBSD Foundation>
 1.77 19-Dec-2017  kamil compat sunos: Drop the sstk(2) syscall

sstk(2) has never been implemented by the NetBSD kernel.

Sponsored by <The NetBSD Foundation>
 1.76 07-Nov-2013  njoly Fix dup/dup2/dup3 argument types (u_int -> int).
 1.75 03-Mar-2010  pooka branches: 1.75.10; 1.75.20; 1.75.24;
One more overcomplex ENOSYS bites the dust.
 1.74 13-Jan-2009  pooka branches: 1.74.4;
Convert the syscalls.master to a format from which it is easier
to parse and generate the compat name and basename (e.g. __stat50
and stat). Use this to autogenerate __RENAME()'s to the rump_syscalls
header so that they can be called e.g. rump_sys_socket() instead
of rump_sys___socket30().
 1.73 13-Jan-2009  pooka UNIMPL police
 1.72 11-Jan-2009  tsutsui Update for compat_50 stuff. (compile test only)
 1.71 11-Jan-2009  christos merge christos-time_t
 1.70 19-Nov-2008  ad Make the emulations, exec formats, coredump, NFS, and the NFS server
into modules. By and large this commit:

- shuffles header files and ifdefs
- splits code out where necessary to be modular
- adds module glue for each of the components
- adds/replaces hooks for things that can be installed at runtime
 1.69 21-Jun-2008  tsutsui branches: 1.69.2; 1.69.4;
Include <sys/sched.h> before <sys/syscallargs.h> for cpuset_t.
 1.68 20-Dec-2007  dsl branches: 1.68.6; 1.68.8; 1.68.12; 1.68.14; 1.68.16;
Convert all the system call entry points from:
int foo(struct lwp *l, void *v, register_t *retval)
to:
int foo(struct lwp *l, const struct foo_args *uap, register_t *retval)
Fixup compat code to not write into 'uap' and (in some cases) to actually
pass a correctly formatted 'uap' structure with the right name to the
next routine.
A few 'compat' routines that just call standard ones have been deleted.
All the 'compat' code compiles (along with the kernels required to test
build it).
98% done by automated scripts.
 1.67 04-Mar-2007  christos branches: 1.67.16; 1.67.24; 1.67.28;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.66 09-Feb-2007  ad branches: 1.66.2;
Merge newlock2 to head.
 1.65 01-Sep-2006  matt branches: 1.65.2;
Don't conditionalize *sys_ptrace. The lack of sys_ptrace will be dealt
with differently.
 1.64 30-Aug-2006  he Update for options PTRACE.
 1.63 13-Jul-2006  pavel request the COMPAT_30 getfh in the master files. (Changes to the generated
ones would be lost.)
 1.62 11-Dec-2005  christos branches: 1.62.4; 1.62.8;
merge ktrace-lwp.
 1.61 26-Feb-2005  perry branches: 1.61.4;
nuke trailing whitespace
 1.60 18-Jan-2003  thorpej branches: 1.60.2; 1.60.10; 1.60.12;
Merge the nathanw_sa branch.
 1.59 03-Jan-2002  mrg move the COMPAT_SUNOS SO_BROADCAST hack out of uipc_socket.c into the
compat/sunos code. besides being cleaner this allows the sunos LKM
to properly work without any special kernel hacks.
 1.58 30-May-2001  mrg branches: 1.58.2;
use _KERNEL_OPT.
 1.57 09-Dec-2000  mycroft branches: 1.57.2;
Get rid of the damn EMUL_GET* flags.
 1.56 09-Dec-2000  mycroft Add the %% separators.
 1.55 30-Nov-2000  jdolecek LKMify
 1.54 09-Apr-2000  mrg rename some unimplimented (because they are OLD in sunos) syscalls to avoid confusion.
 1.53 12-Jul-1999  kleink branches: 1.53.2;
XSH5: change function signature to `void *sbrk(intptr_t)'.
 1.52 22-Mar-1999  sommerfe branches: 1.52.4;
Use standard system fchroot instead of emulation-specific copy.
 1.51 09-Feb-1999  christos Const poisoning and CHECK_ALT_CREAT fixes
 1.50 18-Dec-1998  drochner remove compat_xxx dependencies where they don't belong
 1.49 10-Dec-1998  christos Defopt COMPAT_43
 1.48 19-Oct-1998  tron Defopt SYSVMSG, SYSVSEM and SYSVSHM.
 1.47 13-Sep-1998  pk Signal compat: sunos sigset_t conversions;
new sunos_sigvec() & sunos_sigpending()
 1.46 25-Jun-1998  thorpej defopt NFSSERVER
 1.45 19-Feb-1998  thorpej Include the NFS option header.
 1.44 19-Oct-1997  christos Make mman(2) functions args consistent (caddr_t -> void *)
 1.43 16-Oct-1997  christos ostat -> stat43
 1.42 10-Oct-1997  fvdl sys_getdirentries -> compat_12_sys_getdirentries from Juergen Hannken-Illjes.
 1.41 13-Jun-1997  thorpej branches: 1.41.4;
Use compat_12_sys_swapon().
 1.40 12-Jun-1997  mrg now need sunos_sys_swapon() as ours is different.
 1.39 31-Jan-1997  thorpej branches: 1.39.2; 1.39.6;
NFSCLIENT -> NFS
 1.38 07-Sep-1996  mycroft branches: 1.38.2;
Modify poll(2) prototype.
 1.37 07-Sep-1996  mycroft Implement poll(2).
 1.36 30-Aug-1996  christos add obsolete stime(2)
 1.35 26-Aug-1996  thorpej Implement sunos_sys_execve(). The previous code simply called
sys_execve() without doing an alternate patch check, which was
incorrect. Bug pointed out by Krister Walfridsson <cato@df.lth.se>
on port-sparc@NetBSD.ORG.
 1.34 23-Jun-1996  mycroft Catch up with setre[ug]id() changes.
 1.33 28-Feb-1996  pk branches: 1.33.4;
Insert sunos_sys_fcntl().
 1.32 07-Oct-1995  mycroft Prefix names of system call implementation functions with `sys_'.
 1.31 05-Jul-1995  pk Start using sunos_sigvec().
 1.30 25-Jun-1995  briggs Oops... NOARGS for compat_43_sigvec.
 1.29 25-Jun-1995  briggs sigvec -> compat_43_sigvec.
 1.28 24-Jun-1995  christos Use compat_util.[ch]
 1.27 11-Jun-1995  pk Go with the flow; use `/emul/sunos' pseudo-root (from Matthew Green).
Note: sunos_stat() and sunos_lstat() were added too.
 1.26 22-Apr-1995  christos Added sunos_reboot().
 1.25 22-Apr-1995  christos - added struct emul to all emulations.
- removed all setup functions.
- added copyargs() functions where needed.
 1.24 06-Dec-1994  deraadt repair SYSV_* system calls
 1.23 25-Nov-1994  deraadt a few other things which work
 1.22 20-Nov-1994  deraadt sunos ptrace & poll emulation
 1.21 14-Nov-1994  deraadt fix sunos_mmap
 1.20 26-Oct-1994  cgd new RCS ID format.
 1.19 26-Oct-1994  deraadt whoops
 1.18 25-Oct-1994  deraadt rename, new syscall interface, etc.
 1.17 29-Jun-1994  cgd New RCS ID's, take two. they're more aesthecially pleasant, and use 'NetBSD'
 1.16 14-Jun-1994  chopps update to match recent getdtablesize() change
 1.15 07-May-1994  deraadt backwards compat for a few things.
 1.14 01-May-1994  cgd three changes i forgot, from Gordon Ross (gwr@lamp)
 1.13 26-Apr-1994  pk SunOS's RLIMIT_NOFILE is different: add sun_[gs]rlimit().
 1.12 27-Mar-1994  cgd fix botch
 1.11 27-Mar-1994  cgd do the syscall shuffle
 1.10 03-Mar-1994  deraadt first cut at a SUNOS_COMPAT sysconf() system call.
 1.9 12-Dec-1993  deraadt m68k/sparc sunos binary compatibility code, pulled down from magnum branch
for consumption by the m68k masses
 1.8 22-Nov-1993  deraadt branches: 1.8.2;
moved from arch/sparc/sunos to compat/sunos
 1.7 20-Nov-1993  deraadt new compat functions: sun_open, sun_auditsys, sun_setpgid, sun_uname
some from Markus.
 1.6 14-Nov-1993  deraadt update to kern/syscalls.master, for SYSVSEM & SYSVMSG
 1.5 10-Nov-1993  deraadt update to 4.4 way of doing syscall#0
 1.4 15-Oct-1993  deraadt use the standard {get,set}domainname stuff
 1.3 13-Oct-1993  deraadt Add a stub auditsys() system call that does nothing.
SunOS /sbin/fsck calls it..
 1.2 11-Oct-1993  deraadt various changes, suffice to say that 4.4 syscalls do not look like ours
 1.1 02-Oct-1993  deraadt Chris Torek's sparc port. Missing lots of things.
 1.8.2.8 01-Dec-1993  pk Introduced sun_mknod() which also deals with FIFOs (ie. `mknod xxx p' on SunOS).
 1.8.2.7 27-Nov-1993  deraadt very rudimentary exportfs(2) support, ie. "return 0"
 1.8.2.6 27-Nov-1993  deraadt statfs(2) is different..
 1.8.2.5 27-Nov-1993  deraadt support sunos vhangup(2) call (getty needs it)
 1.8.2.4 26-Nov-1993  deraadt support quotactl(2)
 1.8.2.3 26-Nov-1993  deraadt add ustat(2) system call. bleah.
 1.8.2.2 26-Nov-1993  deraadt support nfssvc, getfh, and async_daemon system calls.
 1.8.2.1 22-Nov-1993  deraadt file syscalls.master was added on branch magnum on 1993-11-26 13:25:49 +0000
 1.33.4.2 10-Dec-1996  mycroft From trunk:
Do execv() and execve() path name translation consistently across
emulations.
 1.33.4.1 10-Dec-1996  mycroft From trunk:
Implement setre[ug]id() for real.
 1.38.2.1 14-Jan-1997  thorpej Snapshot of work-in-progress, committed to private branch.

These changes implement machine-independent root device and file system
selection. Notable features:

- All ports behave in a consistent manner regarding root
device selection.
- No more "options GENERIC"; all kernels have the ability
to boot with RB_ASKNAME to select root device and file system
type.
- Root file system type can be wildcarded; a machine-independent
function will try all possible file systems for the selected
root device until one succeeds.
- If the root file system fails to mount, the operator will
be given the chance to select a new root device and file
system type, rather than having the machine simply panic.
- nfs_mountroot() no longer panics if any part of the NFS
mount process fails; it now returns an error, giving the
operator a chance to recover.
- New, more consistent, config(8) grammar. The constructs:

config netbsd swap generic
config netbsd root on nfs

have been replaced with:

config netbsd root on ? type ?
config netbsd root on ? type nfs

Additionally, the operator may select or wildcard root file
system type in the kernel configuration file:

config netbsd root on cd0a type cd9660

config(8) now requires that a "root" specification be
made. "root" may be wired down or wildcarded. "swap" and
"dump" specifications are optional, and follow previous
semantics.

- config(8) has a new "file-system" keyword, used to configure
file systems into the kernel. Eventually, this will be used
to generate the default vfssw[].

- "options NFSCLIENT" is obsolete, and is replaced by
"file-system NFS". "options NFSSERVER" still exists, since
NFS server support is independent of the NFS file system
client.

- sys/arch/<foo>/<foo>/swapgeneric.c is no longer used, and
will be removed; all information is now generated by config(8).

As of this commit, all ports except arm32 have been updated to use
the new setroot(). Only SPARC, i386, and Alpha ports have been
tested at this time. Port masters should test these changes on their
ports, and report any problems back to me.

More changes are on their way, including RB_ASKNAME support in
nfs_mountroot() (to prompt for server address and path) and, potentially,
the ability to select rarp/bootparam or bootp in nfs_mountroot().
 1.39.6.1 01-Jun-1997  mrg we now need sunos_sys_swapon().
 1.39.2.1 12-Feb-1997  mrg initial work for dynamic swap additions.
 1.41.4.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.52.4.1 02-Aug-1999  thorpej Update from trunk.
 1.53.2.3 13-Dec-2000  bouyer Sync with HEAD (for UBC fixes).
 1.53.2.2 08-Dec-2000  bouyer Sync with HEAD.
 1.53.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.57.2.4 29-May-2002  nathanw #include <sys/sa.h> before <sys/syscallargs.h>, to provide sa_upcall_t
now that <sys/param.h> doesn't include <sys/sa.h>.

(Behold the Power of Ed)
 1.57.2.3 28-Feb-2002  nathanw Catch up to -current.
 1.57.2.2 11-Jan-2002  nathanw More catchup.
 1.57.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.58.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.60.12.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.60.10.1 29-Apr-2005  kent sync with -current
 1.60.2.1 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.61.4.4 21-Jan-2008  yamt sync with head
 1.61.4.3 03-Sep-2007  yamt sync with head.
 1.61.4.2 26-Feb-2007  yamt sync with head.
 1.61.4.1 30-Dec-2006  yamt sync with head.
 1.62.8.1 11-Aug-2006  yamt sync with head
 1.62.4.1 09-Sep-2006  rpaulo sync with head
 1.65.2.1 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.66.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.67.28.1 02-Jan-2008  bouyer Sync with HEAD
 1.67.24.1 26-Dec-2007  ad Sync with head.
 1.67.16.1 09-Jan-2008  matt sync with HEAD
 1.68.16.1 27-Jun-2008  simonb Sync with head.
 1.68.14.3 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.68.14.2 14-May-2008  wrstuden Per discussion with ad, remove most of the #include <sys/sa.h> lines
as they were including sa.h just for the type(s) needed for syscallargs.h.

Instead, create a new file, sys/satypes.h, which contains just the
types needed for syscallargs.h. Yes, there's only one now, but that
may change and it's probably more likely to change if it'd be difficult
to handle. :-)

Per discussion with matt at n dot o, add an include of satypes.h to
sigtypes.h. Upcall handlers are kinda signal handlers, and signalling
is the header file that's already included for syscallargs.h that
closest matches SA.

This shaves about 3000 lines off of the diff of the branch relative
to the base. That also represents about 18% of the total before this
checkin.

I think this reduction is very good thing.
 1.68.14.1 10-May-2008  wrstuden Initial checkin of re-adding SA. Everything except kern_sa.c
compiles in GENERIC for i386. This is still a work-in-progress, but
this checkin covers most of the mechanical work (changing signalling
to be able to accomidate SA's process-wide signalling and re-adding
includes of sys/sa.h and savar.h). Subsequent changes will be much
more interesting.

Also, kern_sa.c has received partial cleanup. There's still more
to do, though.
 1.68.12.2 11-Mar-2010  yamt sync with head
 1.68.12.1 04-May-2009  yamt sync with head.
 1.68.8.3 20-Nov-2008  christos merge with head.
 1.68.8.2 01-Nov-2008  christos Sync with head.
 1.68.8.1 29-Mar-2008  christos Welcome to the time_t=long long dev_t=uint64_t branch.
 1.68.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.68.6.1 29-Jun-2008  mjf Sync with HEAD.
 1.69.4.1 19-Jan-2009  skrll Sync with HEAD.
 1.69.2.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.74.4.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.75.24.1 18-May-2014  rmind sync with head
 1.75.20.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.75.10.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.80.4.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.80.4.1 10-Jun-2019  christos Sync with HEAD
 1.80.2.2 29-Sep-2018  pgoyette Conditionalize the compat_10 sysv ipc syscalls on both the COMPAT_10
and SYSVxxx attributes
 1.80.2.1 29-Sep-2018  pgoyette Conditionalize compat_09 syscalls

RSS XML Feed