Home | History | Annotate | only in /src/sys/compat/ultrix
History log of /src/sys/compat/ultrix
RevisionDateAuthorComments
 1.6 14-Jan-2014  christos 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 03-Sep-1996  mycroft branches: 1.1.2; 1.1.64;
Give every emulation its own Makefile for the syscall table.
 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.1.2.2 10-Dec-1996  mycroft From trunk:
Give all the emulations a consistent Makefile.
 1.1.2.1 03-Sep-1996  mycroft file Makefile was added on branch netbsd-1-2 on 1996-12-10 08:38:25 +0000
 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.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.7 27-Jan-2019  pgoyette Merge the [pgoyette-compat] branch
 1.6 17-Nov-2014  uebayasi branches: 1.6.18; 1.6.20;
Define compat modules (but without dependencies yet).
 1.5 19-Nov-2008  ad branches: 1.5.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.4 09-Dec-2000  jdolecek branches: 1.4.122; 1.4.126; 1.4.132; 1.4.136;
split ecoff specific code to separate file ultrix_exec_ecoff.c
 1.3 07-Jan-1996  jonathan branches: 1.3.30;
Add '/emul/ultrix' pathname processing to Ultrix emulation, and move
Ultrix syscalls that require that processing out of ultrix_misc.c
to ultrix_pathname.c.
 1.2 26-Dec-1995  jonathan Add emulation of Ultrix select: before calling native sys_select(),
limit the number of FDs to select on to the maximum supported by NetBSD --
which is as many FDs as the emul_ultrix process can have open, anyway.

Add emulation of Ultrix getmnt(2) in ultrix_fs.c

Add partial emulation of Ultrix tty ioctl()s in ultrix_ioctl.c, derived
from compat/sunos/sunos_ioctl.c. Ultrix libc's ``isatty()'' now works
in compat_emul processes.
 1.1 20-Sep-1995  thorpej Add common file lists, similar to what the other emulation modules use.
 1.3.30.1 13-Dec-2000  bouyer Sync with HEAD (for UBC fixes).
 1.4.136.1 19-Jan-2009  skrll Sync with HEAD.
 1.4.132.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.4.126.1 04-May-2009  yamt sync with head.
 1.4.122.1 17-Jan-2009  mjf Sync with HEAD.
 1.5.26.1 03-Dec-2017  jdolecek update from HEAD
 1.6.20.1 10-Jun-2019  christos Sync with HEAD
 1.6.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.7 19-Sep-1995  thorpej Obsolete; use the one in /sys/kern
 1.6 02-Dec-1994  dean new sysent version.
 1.5 30-Jun-1994  cgd fix a botch, and gen syscall files
 1.4 30-Jun-1994  cgd fix up for new ID format, and consistency
 1.3 29-Jun-1994  cgd New RCS ID's, take two. they're more aesthecially pleasant, and use 'NetBSD'
 1.2 15-Jun-1994  glass much works but untested w/new fs. expect more tomorrow
 1.1 02-Jun-1994  glass first swipe at ultrix compat. expect many bug fixes. very related to compat/sunos
 1.4 01-Nov-2002  jdolecek set nsysent to 512 (oh well, just three syscalls too many for 256)
 1.3 18-Dec-1998  drochner branches: 1.3.20;
remove compat_xxx dependencies where they don't belong
 1.2 22-Jan-1998  mycroft This doesn't actually use COMPAT_10.
 1.1 23-Nov-1994  dean changes for new sysent structure (from J. Stone)
 1.3.20.1 11-Nov-2002  nathanw Catch up to -current
 1.58 03-Mar-2019  pgoyette The compat_09_{get,set}domainname() syscalls should not be defined
based on existence of COMPAT_09. Make them modular instead, and
reference the compat_09 module.
 1.57 27-Jan-2019  pgoyette Merge the [pgoyette-compat] branch
 1.56 06-Jan-2018  kamil branches: 1.56.2; 1.56.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.55 19-Dec-2017  kamil compat/ultrix: Drop SYS_vadvise

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

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

sbrk - change data segment size

This syscall is dummy since the inception of the project.

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

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

Sponsored by <The NetBSD Foundation>
 1.52 07-Nov-2013  njoly Fix dup/dup2/dup3 argument types (u_int -> int).
 1.51 02-Mar-2010  pooka branches: 1.51.10; 1.51.20; 1.51.24;
Kill fs_nfs.h and #ifdef NFS by making getfh() support unconditional
and nfssvc unsupport unconditional. nfs server was just a fancy
NOP anyway for all except Ultrix. I know I'm boring but I couldn't
imagine why someone would want to run an Ultrix nfs server (and I
also doubt that it would work anymore with all the changes to fs
exporting etc).
 1.50 17-Jan-2009  he branches: 1.50.4;
Adapt to the state after the recent time_t change.
Type changes:
timeval -> timeval50
itimerval -> itimerval50
rusage -> rusage50
and use of the compat_50 calls where appropriate.
Untested, but at least it builds.

Discussed with christos@
 1.49 13-Jan-2009  pooka 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.48 13-Jan-2009  pooka UNIMPL police (two mount syscalls with the same signature?!?)
 1.47 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.46 19-Jun-2008  hans branches: 1.46.2; 1.46.4;
include <sys/sched.h> for cpuset_t
 1.45 23-Apr-2008  ad branches: 1.45.2; 1.45.4; 1.45.6;
-SYCALL_MPSAFE
 1.44 04-Mar-2007  christos branches: 1.44.36; 1.44.38;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.43 09-Feb-2007  ad branches: 1.43.2;
Merge newlock2 to head.
 1.42 13-Jul-2006  pavel branches: 1.42.4;
use the COMPAT_30 getfh.
 1.41 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.40 11-Dec-2005  christos branches: 1.40.4; 1.40.8; 1.40.16;
merge ktrace-lwp.
 1.39 26-Feb-2005  perry branches: 1.39.4;
nuke trailing whitespace
 1.38 18-Jan-2003  thorpej branches: 1.38.2; 1.38.10; 1.38.12;
Merge the nathanw_sa branch.
 1.37 30-May-2001  mrg use _KERNEL_OPT.
 1.36 27-Jan-2001  thorpej branches: 1.36.2;
getpid(2) is MP-safe.
 1.35 09-Dec-2000  mycroft Add the %% separators.
 1.34 09-Dec-2000  mycroft Add the %% separators.
 1.33 30-Nov-2000  jdolecek LKMify
 1.32 30-Jul-1999  drochner branches: 1.32.2;
emulate fcntl(F_SETLK) & Co.
(seti@home works now:-)
 1.31 12-Jul-1999  kleink XSH5: change function signature to `void *sbrk(intptr_t)'.
 1.30 09-Feb-1999  christos branches: 1.30.2; 1.30.4;
const poisoning and CHECK_ALT_CREAT fixes.
 1.29 18-Dec-1998  drochner remove compat_xxx dependencies where they don't belong
 1.28 10-Dec-1998  christos Defopt COMPAT_43
 1.27 03-Oct-1998  drochner Use a private implementation of sys_sigvec(). Ultrix uses an sv_flags bit
unknown to NetBSD and sigaction1() does (now?) complain about it.
 1.26 26-Sep-1998  drochner Make Ultrix emulation private functions for sigreturn and sigsuspend
because the NetBSD implementation differs now.
 1.25 25-Jun-1998  thorpej defopt NFSSERVER
 1.24 19-Feb-1998  thorpej Include the NFS option header.
 1.23 14-Feb-1998  kleink Use sys___posix_{chown,fchown}() instead of sys_{chown,fchown}().
 1.22 16-Oct-1997  christos ostat -> stat43
 1.21 13-Jun-1997  thorpej Use compat_12_sys_swapon().
 1.20 09-Jun-1997  jonathan Emulate RISC Ultrix cacheflush() and cachectl() syscalls on mips.
 1.19 09-Jun-1997  jonathan Declare ultrix_sys_symshs(). Ultrix uses the standard (BRL?) hack to
implement sysV shm using one system call.
 1.18 31-Jan-1997  thorpej branches: 1.18.2;
NFSCLIENT -> NFS
 1.17 03-Sep-1996  mycroft branches: 1.17.2;
Define execv() and execve() consistently across emulations.
Do path name translation.
 1.16 23-Jun-1996  mycroft Catch up with setre[ug]id() changes.
 1.15 07-Jan-1996  jonathan branches: 1.15.4;
Add '/emul/ultrix' pathname processing to Ultrix emulation, and move
Ultrix syscalls that require that processing out of ultrix_misc.c
to ultrix_pathname.c.
 1.14 26-Dec-1995  jonathan Add emulation of ultrix mount(2). Sufficient to NFS-mount filesystems
using a NetBSD kernel in an ultrix root filesystem.

Move wait emulation to the old (v7) wait syscall number, as that's
what the Ultrix ufs_mount binary uses.
 1.13 26-Dec-1995  jonathan Fix ultrix_sys_select() entry.
 1.12 26-Dec-1995  jonathan Add emulation of Ultrix select: before calling native sys_select(),
limit the number of FDs to select on to the maximum supported by NetBSD --
which is as many FDs as the emul_ultrix process can have open, anyway.

Add emulation of Ultrix getmnt(2) in ultrix_fs.c

Add partial emulation of Ultrix tty ioctl()s in ultrix_ioctl.c, derived
from compat/sunos/sunos_ioctl.c. Ultrix libc's ``isatty()'' now works
in compat_emul processes.
 1.11 07-Oct-1995  mycroft Prefix names of system call implementation functions with `sys_'.
 1.10 01-Jun-1995  mellon Clear up name conflict between Ultrix syscall 103 and 139.
 1.9 01-Feb-1995  mellon Fix up some incompatibilities and some indentation botches
 1.8 02-Dec-1994  dean fixed typo
 1.7 01-Dec-1994  dean added sigreturn
 1.6 23-Nov-1994  dean changes for new sysent structure (from J. Stone)
 1.5 01-Aug-1994  glass ultrix_{get,set}info from Arne H Juul <arnej@dsl.unit.no>
 1.4 29-Jun-1994  cgd branches: 1.4.2;
New RCS ID's, take two. they're more aesthecially pleasant, and use 'NetBSD'
 1.3 22-Jun-1994  glass update for getdtablesize change, and track compat_sunos
 1.2 15-Jun-1994  glass much works but untested w/new fs. expect more tomorrow
 1.1 02-Jun-1994  glass first swipe at ultrix compat. expect many bug fixes. very related to compat/sunos
 1.4.2.1 01-Aug-1994  cgd From trunk.
 1.15.4.2 10-Dec-1996  mycroft From trunk:
Do execv() and execve() path name translation consistently across
emulations.
 1.15.4.1 10-Dec-1996  mycroft From trunk:
Implement setre[ug]id() for real.
 1.17.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.18.2.1 12-Feb-1997  mrg initial work for dynamic swap additions.
 1.30.4.1 02-Aug-1999  thorpej Update from trunk.
 1.30.2.1 31-Jan-2000  he Pull up revision 1.32 (requested by mhitch):
Emulate Ultrix fcntl(F_SETLK) & Co. so the Ultrix seti@home client
works.
 1.32.2.3 11-Feb-2001  bouyer Sync with HEAD.
 1.32.2.2 13-Dec-2000  bouyer Sync with HEAD (for UBC fixes).
 1.32.2.1 08-Dec-2000  bouyer Sync with HEAD.
 1.36.2.2 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.36.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.38.12.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.38.10.1 29-Apr-2005  kent sync with -current
 1.38.2.1 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.39.4.3 03-Sep-2007  yamt sync with head.
 1.39.4.2 26-Feb-2007  yamt sync with head.
 1.39.4.1 30-Dec-2006  yamt sync with head.
 1.40.16.1 13-Jul-2006  gdamore Merge from HEAD.
 1.40.8.1 11-Aug-2006  yamt sync with head
 1.40.4.1 09-Sep-2006  rpaulo sync with head
 1.42.4.1 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.43.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.44.38.1 18-May-2008  yamt sync with head.
 1.44.36.3 17-Jan-2009  mjf Sync with HEAD.
 1.44.36.2 29-Jun-2008  mjf Sync with HEAD.
 1.44.36.1 02-Jun-2008  mjf Sync with HEAD.
 1.45.6.1 27-Jun-2008  simonb Sync with head.
 1.45.4.3 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.45.4.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.45.4.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.45.2.2 11-Mar-2010  yamt sync with head
 1.45.2.1 04-May-2009  yamt sync with head.
 1.46.4.1 19-Jan-2009  skrll Sync with HEAD.
 1.46.2.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.50.4.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.51.24.1 18-May-2014  rmind sync with head
 1.51.20.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.51.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.56.4.1 10-Jun-2019  christos Sync with HEAD
 1.56.2.1 29-Sep-2018  pgoyette Conditionalize compat_09_sys_{get,set}domainname syscalls appropriately.
 1.7 15-Dec-2019  tsutsui Remove clause 3 and 4 leftovers from TNF licenses in more sources.

Confirmed by martin@ in PR/54760.
 1.6 19-Nov-2008  ad branches: 1.6.68; 1.6.72;
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.5 11-Dec-2005  christos branches: 1.5.70; 1.5.74; 1.5.80; 1.5.84;
merge ktrace-lwp.
 1.4 21-Apr-2004  simonb branches: 1.4.12;
ANSIfy, some KNF.
 1.3 29-Jun-2003  fvdl branches: 1.3.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.2 29-Jun-2003  simonb Fix 'struct lwp *' lossage.
 1.1 21-Nov-2000  jdolecek branches: 1.1.2;
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.1.2.2 22-Nov-2000  bouyer Sync with HEAD.
 1.1.2.1 21-Nov-2000  bouyer file ultrix_exec.h was added on branch thorpej_scsipi on 2000-11-22 16:03:00 +0000
 1.3.2.4 28-Nov-2004  skrll Adapt to branch
 1.3.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.3.2.1 03-Aug-2004  skrll Sync with HEAD
 1.4.12.1 21-Jun-2006  yamt sync with head.
 1.5.84.1 19-Jan-2009  skrll Sync with HEAD.
 1.5.80.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.5.74.1 04-May-2009  yamt sync with head.
 1.5.70.1 17-Jan-2009  mjf Sync with HEAD.
 1.6.72.1 18-Dec-2019  martin Pull up following revision(s) (requested by tsutsui in ticket #570):

sys/compat/netbsd32/netbsd32_compat_50_sysv.c: revision 1.3
sys/dev/raidframe/rf_compat50.h: revision 1.6
sys/arch/emips/emips/bus_space.c: revision 1.3
sys/compat/net/if.h: revision 1.5
sys/arch/emips/stand/common/bootinfo.c: revision 1.2
sys/compat/common/sysv_msg_50.c: revision 1.5
sys/compat/common/kern_time_30.c: revision 1.8
sys/arch/emips/stand/common/bootinfo.h: revision 1.2
sys/arch/ia64/include/bus.h: revision 1.4
sys/arch/ia64/ia64/bus_space.c: revision 1.2
sys/compat/common/sysv_shm_50.c: revision 1.5
sys/dev/ic/adw.h: revision 1.15
sys/compat/common/uipc_syscalls_50.c: revision 1.10
sys/arch/emips/ebus/flash_ebus.c: revision 1.22
sys/dev/ic/adv.h: revision 1.15
sys/dev/ic/adwmcode.c: revision 1.18
sys/dev/ic/advlib.c: revision 1.29
sys/arch/hpcarm/include/kloader.h: revision 1.3
sys/dev/usb/uberry.c: revision 1.16
sys/compat/common/sysv_sem_50.c: revision 1.5
sys/compat/netbsd32/netbsd32_compat_50.c: revision 1.43
sys/dev/ic/advlib.h: revision 1.21
sys/dev/ic/adv.c: revision 1.50
sys/compat/netinet6/in6_var.h: revision 1.5
sys/arch/hpc/stand/hpcboot/arm/arm_sa1100_asm.asm: revision 1.2
sys/arch/emips/include/loadfile_machdep.h: revision 1.3
sys/arch/emips/stand/common/prom_iface.c: revision 1.7
sys/dev/ic/adw.c: revision 1.56
sys/dev/ic/adwmcode.h: revision 1.12
sys/dev/ic/advmcode.c: revision 1.10
sys/arch/emips/ebus/ace_ebus.c: revision 1.22
sys/compat/netbsd32/netbsd32_compat_60.c: revision 1.5
sys/dev/raidframe/rf_compat50.c: revision 1.13
sys/arch/x68k/dev/intiovar.h: revision 1.15
sys/dev/usb/uipad.c: revision 1.8
sys/arch/zaurus/include/kloader.h: revision 1.3
sys/arch/emips/stand/common/bootxx.c: revision 1.2
sys/dev/ic/adwlib.h: revision 1.23
sys/dev/ic/adwlib.c: revision 1.44
sys/compat/netbsd32/netbsd32_compat_16.c: revision 1.3
sys/arch/amigappc/include/intr.h: revision 1.27
sys/arch/x68k/dev/mfp.c: revision 1.27
sys/arch/arm/at91/at91dbgu.c: revision 1.17
sys/dev/ic/advmcode.h: revision 1.7
sys/compat/ultrix/ultrix_exec.h: revision 1.7
sys/compat/common/vfs_syscalls_50.c: revision 1.24
sys/arch/mips/cavium/octeon_dma.c: revision 1.3
sys/arch/hpc/stand/hpcboot/arm/arm_pxa2x0_asm.asm: revision 1.2

Remove clause 3 and 4 from TNF licenses.
Ok'ed by martin@ in PR/54760.

Remove clause 3 and 4 leftovers from TNF licenses in more sources.
Confirmed by martin@ in PR/54760.
 1.6.68.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.9 11-Dec-2005  christos merge ktrace-lwp.
 1.8 26-Feb-2005  perry branches: 1.8.4;
nuke trailing whitespace
 1.7 21-Apr-2004  simonb branches: 1.7.4; 1.7.6;
ANSIfy, some KNF.
 1.6 13-Feb-2004  wiz Uppercase CPU, plural is CPUs.
 1.5 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.4 29-Jun-2003  fvdl branches: 1.4.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.3 29-Jun-2003  simonb Fix 'struct lwp *' lossage.
 1.2 13-Nov-2001  lukem add RCSIDs (including regeneration of files as appropriate)
 1.1 09-Dec-2000  jdolecek branches: 1.1.2; 1.1.4; 1.1.6;
split ecoff specific code to separate file ultrix_exec_ecoff.c
 1.1.6.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.4.1 14-Nov-2001  nathanw Catch up to -current.
 1.1.2.2 13-Dec-2000  bouyer Sync with HEAD (for UBC fixes).
 1.1.2.1 09-Dec-2000  bouyer file ultrix_exec_ecoff.c was added on branch thorpej_scsipi on 2000-12-13 15:49:57 +0000
 1.4.2.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.4.2.4 28-Nov-2004  skrll Adapt to branch
 1.4.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.4.2.1 03-Aug-2004  skrll Sync with HEAD
 1.7.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.7.4.1 29-Apr-2005  kent sync with -current
 1.8.4.1 21-Jun-2006  yamt sync with head.
 1.2 14-Dec-2009  matt Merge from matt-nb5-mips64
 1.1 30-Jul-1999  drochner branches: 1.1.2; 1.1.12; 1.1.142; 1.1.162;
emulate fcntl(F_SETLK) & Co.
(seti@home works now:-)
 1.1.162.1 09-Sep-2009  matt Change to use fixed sized types.
 1.1.142.1 11-Mar-2010  yamt sync with head
 1.1.12.2 31-Jan-2000  he Pull up revision 1.1 (new, requested by mhitch):
Emulate Ultrix fcntl(F_SETLK) & Co. so the Ultrix seti@home client
works.
 1.1.12.1 30-Jul-1999  he file ultrix_flock.h was added on branch netbsd-1-4 on 2000-01-31 20:40:56 +0000
 1.1.2.2 02-Aug-1999  thorpej Update from trunk.
 1.1.2.1 30-Jul-1999  thorpej file ultrix_flock.h was added on branch chs-ubc2 on 1999-08-02 21:55:14 +0000
 1.60 05-Jul-2022  andvar s/retrys/retries/ in comments.
 1.59 29-Sep-2020  msaitoh s/parition/partition/
 1.58 03-Dec-2017  maxv Fix uninitialized pointer, found by Mootja. Not a surprise in untested
code.
 1.57 13-Apr-2017  hannken branches: 1.57.4;
Switch ultrix_sys_getmnt() to mountlist iterator.
Really skip "start" items instead of a useless loop.
Compile tested only.
 1.56 23-Oct-2015  maxv branches: 1.56.2; 1.56.4;
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.55 24-Jul-2015  maxv Unused inits (harmless).

Found by Brainy.
 1.54 27-Nov-2013  christos branches: 1.54.6;
Change the queue.3 *_END(&head) macros to NULL. Since we don't have CIRCLEQ
anymore, all the macros expand to NULL anyway, so this improves readability.
Requested by rmind@
 1.53 23-Nov-2013  christos fix previous, list ends in NULL, and don't open-code
 1.52 23-Nov-2013  riz Since mountlist is now a TAILQ, convert some missed usages
so things build again.
 1.51 14-Dec-2009  matt branches: 1.51.12; 1.51.22; 1.51.26;
Merge from matt-nb5-mips64
 1.50 17-Dec-2008  cegger kill MALLOC and FREE macros.
 1.49 06-May-2008  ad branches: 1.49.2; 1.49.8; 1.49.16;
PR kern/38141 lookup/vfs_busy acquire rwlock recursively

Simplify the mount locking. Remove all the crud to deal with recursion on
the mount lock, and crud to deal with unmount as another weirdo lock.

Hopefully this will once and for all fix the deadlocks with this. With this
commit there are two locks on each mount:

- krwlock_t mnt_unmounting. This is used to prevent unmount across critical
sections like getnewvnode(). It's only ever read locked with rw_tryenter(),
and is only ever write locked in dounmount(). A write hold can't be taken
on this lock if the current LWP could hold a vnode lock.

- kmutex_t mnt_updating. This is taken by threads updating the mount, for
example when going r/o -> r/w, and is only present to serialize updates.
In order to take this lock, a read hold must first be taken on
mnt_unmounting, and the two need to be held across the operation.

One effect of this change: previously if an unmount failed, we would make a
half hearted attempt to back out of it gracefully, but that was unlikely to
work in a lot of cases. Now while an unmount that will be aborted is in
progress, new file operations within the mount will fail instead of being
delayed. That is unlikely to be a problem though, because if the admin
requests unmount of a file system then s(he) has made a decision to deny
access to the resource.
 1.48 30-Apr-2008  ad PR kern/38135 vfs_busy/vfs_trybusy confusion

The previous fix worked, but it opened a window where mounts could have
disappeared from mountlist while the caller was traversing it using
vfs_trybusy(). Fix that.
 1.47 30-Apr-2008  jmmv Fix build of these files after the vfs_trybusy change. Apply the same
modification done in compat/common/vfs_syscalls_20.c:1.27.
 1.46 30-Jan-2008  ad branches: 1.46.6; 1.46.8; 1.46.10;
PR kern/37706 (forced unmount of file systems is unsafe):

- Do reference counting for 'struct mount'. Each vnode associated with a
mount takes a reference, and in turn the mount takes a reference to the
vfsops.
- Now that mounts are reference counted, replace the overcomplicated mount
locking inherited from 4.4BSD with a recursable rwlock.
 1.45 27-Dec-2007  christos make this compile again.
 1.44 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.43 27-Nov-2007  dogcow branches: 1.43.2; 1.43.6;
more VFS_STATVFS(x,y,z) fallout; change them to VFS_STATVFS(x,y). (hi, pooka!)
 1.42 23-Oct-2007  pooka branches: 1.42.2;
vfs_getopsbyname("ngs") -> vfs_getopsbyname("nfs"). 'nuff said
 1.41 10-Oct-2007  ad branches: 1.41.2;
Merge from vmlocking:

- Split vnode::v_flag into three fields, depending on field locking.
- simple_lock -> kmutex in a few places.
- Fix some simple locking problems.
 1.40 17-Jul-2007  christos branches: 1.40.6; 1.40.8; 1.40.10;
include <compat/sys/mount.h> for MFSNAMELEN
 1.39 14-Jul-2007  ad <dsl> I suspect my set of test build kernels is longer than ad's :-)

tsk!
 1.38 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.37 05-Mar-2007  he branches: 1.37.2;
Need a char* for doing pointer arithmetic.
 1.36 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.35 09-Feb-2007  ad branches: 1.35.2;
Merge newlock2 to head.
 1.34 11-Dec-2005  christos branches: 1.34.20;
merge ktrace-lwp.
 1.33 24-Sep-2005  jmmv Instead of trying to clear ufs_args' export member, zero the whole
structure so that we don't rely on that (renamed) field. Should fix
the build. Found by he@.
 1.32 31-Aug-2005  he Now that <ufs/ufsmount.h> includes <ufs/extattr.h>, we also need
<sys/vnode.h> and <sys/vnode_if.h> to bring the definition of struct
vop_getextattr_args into scope. Fixes build problem for arc.
 1.31 01-Jun-2005  drochner branches: 1.31.2;
fix const'ification fallout
 1.30 26-Feb-2005  perry nuke trailing whitespace
 1.29 21-Apr-2004  simonb branches: 1.29.4; 1.29.6;
ANSIfy, some KNF.
 1.28 21-Apr-2004  simonb Fix some statfs->statvfs fallout. Compile tested only...
 1.27 29-Jun-2003  fvdl branches: 1.27.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.26 29-Jun-2003  simonb Fix 'struct lwp *' lossage.
 1.25 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.24 06-Jan-2003  wiz compatibility, not compatiblity.
 1.23 02-Nov-2002  jdolecek retval is 'register_t *', not 'int *'
 1.22 16-Mar-2002  christos 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.21 13-Nov-2001  lukem add RCSIDs (including regeneration of files as appropriate)
 1.20 03-May-2001  matt branches: 1.20.2;
Use NULL instead of an explicit cast.
 1.19 28-Jun-2000  mrg branches: 1.19.2;
remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.18 30-Mar-2000  augustss Kill register declarations.
 1.17 25-Apr-1999  simonb branches: 1.17.2;
Shut 'gcc -Wuninitialized' up.
 1.16 09-Aug-1998  perry branches: 1.16.8;
bzero->memset, bcopy->memcpy, bcmp->memcmp
 1.15 05-Mar-1998  thorpej Make this compile again in light of Lite2.
 1.14 05-Mar-1998  thorpej Arrgh, I said "abort", dammit...
 1.13 05-Mar-1998  thorpej *** empty log message ***
 1.12 25-May-1997  jonathan Update copyright.
 1.11 25-May-1997  jonathan lint: add prototype for static function make_ultrix_mntent().
 1.10 24-May-1997  jonathan lint: gc unused variables in ultrix_sys_mount().
 1.9 06-Apr-1997  jonathan Add changes to make vic-2.8 Ultrix binaries work on NetBSD with COMPAT_ULTRIX:
* Add IPmulticast setsockopt emulation.
* Add Ultrix shmsys emulation (untested).
* tidy up use of stackgap.
 1.8 15-Jan-1997  jonathan Fix const-pointer lint in copyout of consed-up native fstype string,
from consed-up native mount args.
 1.7 19-Oct-1996  jonathan branches: 1.7.2;
Update copyright.
 1.6 13-Oct-1996  christos Backout previous kprintf change.
 1.5 10-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.4 07-Apr-1996  jonathan Remove gcc -Wall lint from ultrix emulation.-
Mostly adding explicit != comparison to "if (error = copyin/out( ... ))".
Fix comment glitch in ultrix_fs.c
 1.3 19-Feb-1996  pk Adapt to NFSv3.
 1.2 26-Dec-1995  jonathan Add emulation of ultrix mount(2). Sufficient to NFS-mount filesystems
using a NetBSD kernel in an ultrix root filesystem.

Move wait emulation to the old (v7) wait syscall number, as that's
what the Ultrix ufs_mount binary uses.
 1.1 26-Dec-1995  jonathan Add emulation of Ultrix select: before calling native sys_select(),
limit the number of FDs to select on to the maximum supported by NetBSD --
which is as many FDs as the emul_ultrix process can have open, anyway.

Add emulation of Ultrix getmnt(2) in ultrix_fs.c

Add partial emulation of Ultrix tty ioctl()s in ultrix_ioctl.c, derived
from compat/sunos/sunos_ioctl.c. Ultrix libc's ``isatty()'' now works
in compat_emul processes.
 1.7.2.1 18-Jan-1997  thorpej Update from trunk.
 1.16.8.1 21-Jun-1999  thorpej Sync w/ -current.
 1.17.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.19.2.8 07-Jan-2003  thorpej Sync with HEAD.
 1.19.2.7 11-Nov-2002  nathanw Catch up to -current
 1.19.2.6 12-Jul-2002  nathanw No longer need to pull in lwp.h; proc.h pulls it in for us.
 1.19.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.19.2.4 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.19.2.3 06-Dec-2001  wdk struct proc -> struct lwp changes for COMPAT_ULTRIX support
 1.19.2.2 14-Nov-2001  nathanw Catch up to -current.
 1.19.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.20.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.20.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.27.2.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.27.2.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.27.2.4 28-Nov-2004  skrll Adapt to branch
 1.27.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.27.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.27.2.1 03-Aug-2004  skrll Sync with HEAD
 1.29.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.29.4.1 29-Apr-2005  kent sync with -current
 1.31.2.7 04-Feb-2008  yamt sync with head.
 1.31.2.6 21-Jan-2008  yamt sync with head
 1.31.2.5 07-Dec-2007  yamt sync with head
 1.31.2.4 27-Oct-2007  yamt sync with head.
 1.31.2.3 03-Sep-2007  yamt sync with head.
 1.31.2.2 26-Feb-2007  yamt sync with head.
 1.31.2.1 21-Jun-2006  yamt sync with head.
 1.34.20.1 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.35.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.37.2.3 20-Aug-2007  ad Sync with HEAD.
 1.37.2.2 15-Jul-2007  ad Sync with head.
 1.37.2.1 13-Mar-2007  ad Pull in the initial set of changes for the vmlocking branch.
 1.40.10.1 14-Oct-2007  yamt sync with head.
 1.40.8.3 23-Mar-2008  matt sync with HEAD
 1.40.8.2 09-Jan-2008  matt sync with HEAD
 1.40.8.1 06-Nov-2007  matt sync with HEAD
 1.40.6.2 27-Nov-2007  joerg Sync with HEAD. amd64 Xen support needs testing.
 1.40.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.41.2.1 13-Nov-2007  bouyer Sync with HEAD
 1.42.2.3 18-Feb-2008  mjf Sync with HEAD.
 1.42.2.2 27-Dec-2007  mjf Sync with HEAD.
 1.42.2.1 08-Dec-2007  mjf Sync with HEAD.
 1.43.6.1 02-Jan-2008  bouyer Sync with HEAD
 1.43.2.3 26-Dec-2007  ad Sync with head.
 1.43.2.2 08-Dec-2007  ad Fix typo.
 1.43.2.1 04-Dec-2007  ad Pull the vmlocking changes into a new branch.
 1.46.10.3 11-Mar-2010  yamt sync with head
 1.46.10.2 04-May-2009  yamt sync with head.
 1.46.10.1 16-May-2008  yamt sync with head.
 1.46.8.1 18-May-2008  yamt sync with head.
 1.46.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.46.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.49.16.1 09-Sep-2009  matt Change to use fixed sized types.
 1.49.8.1 19-Jan-2009  skrll Sync with HEAD.
 1.49.2.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.49.2.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.51.26.1 18-May-2014  rmind sync with head
 1.51.22.2 03-Dec-2017  jdolecek update from HEAD
 1.51.22.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.51.12.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.54.6.3 28-Aug-2017  skrll Sync with HEAD
 1.54.6.2 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.54.6.1 22-Sep-2015  skrll Sync with HEAD
 1.56.4.1 21-Apr-2017  bouyer Sync with HEAD
 1.56.2.1 26-Apr-2017  pgoyette Sync with HEAD
 1.57.4.1 21-Dec-2017  snj Pull up following revision(s) (requested by maxv in ticket #434):
sys/compat/ultrix/ultrix_fs.c: revision 1.58
Fix uninitialized pointer, found by Mootja. Not a surprise in untested
code.
 1.40 09-Feb-2022  andvar fix various typos in comments.
 1.39 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.38 23-Apr-2019  msaitoh branches: 1.38.2;
KNF. No functional change.
 1.37 08-Oct-2016  maxv branches: 1.37.8; 1.37.16;
Uninitialized var, found by mootja; not tested, but obvious enough
 1.36 14-Dec-2009  matt branches: 1.36.22; 1.36.40; 1.36.44;
Merge from matt-nb5-mips64
 1.35 21-Mar-2008  ad branches: 1.35.4; 1.35.6; 1.35.22;
Catch up with descriptor handling changes. See kern_descrip.c revision
1.173 for details.
 1.34 05-Jan-2008  dsl branches: 1.34.6;
Use FILE_LOCK() and FILE_UNLOCK().
Attempt to fix all the code paths so that the 'fp' returned by fd_getfile()
isn't left locked, and is always unlocked (and ref-counted) before
doing anything that might sleep.
 1.33 27-Dec-2007  christos make this compile again.
 1.32 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.31 01-Jun-2007  he branches: 1.31.8; 1.31.14; 1.31.16; 1.31.20;
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.30 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.29 09-Feb-2007  ad branches: 1.29.6; 1.29.8;
Merge newlock2 to head.
 1.28 11-Dec-2005  christos branches: 1.28.20;
merge ktrace-lwp.
 1.27 01-Jun-2005  drochner branches: 1.27.2;
avoid shadow warnings
 1.26 26-Feb-2005  perry nuke trailing whitespace
 1.25 25-Apr-2004  matt branches: 1.25.4; 1.25.6;
Constify the speedtab arrays
 1.24 21-Apr-2004  simonb ANSIfy, some KNF.
 1.23 29-Jun-2003  fvdl branches: 1.23.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.22 29-Jun-2003  simonb Fix 'struct lwp *' lossage.
 1.21 07-May-2003  christos sort the ioctl's so we can see what we've implemented and what we have not.
 1.20 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.19 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.18 13-Nov-2001  lukem add RCSIDs (including regeneration of files as appropriate)
 1.17 14-Jun-2001  thorpej branches: 1.17.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.16 30-May-2001  mrg use _KERNEL_OPT.
 1.15 29-Nov-2000  jdolecek branches: 1.15.2;
LKMify
 1.14 30-Mar-2000  augustss Kill register declarations.
 1.13 09-Aug-1998  perry branches: 1.13.12;
bzero->memset, bcopy->memcpy, bcmp->memcmp
 1.12 25-Jun-1998  thorpej defopt COMPAT_SUNOS
 1.11 25-Jun-1998  thorpej defopt COMPAT_ULTRIX
 1.10 25-May-1997  jonathan lint: add prototypes for termio/termios emul conversions and ioctl handlers.
 1.9 05-May-1997  jonathan NetBSD doesn't have VSWTCH, so we can't emulate it; clarify. (see PR#2793).
 1.8 06-Apr-1997  jonathan * Fix typo in SIOGIFCONF handling.
* Change explicit SunOS-compat ioctl codes to Ultrix-compat codes.
 1.7 13-Oct-1996  christos Backout previous kprintf change.
 1.6 10-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.5 09-Oct-1996  thorpej Merge the netbsd-1-2 branch back into the mainline.
 1.4 13-Jun-1996  jonathan Fix typos in SUSP and DSUSP mapping when setting Ultrix posixmode tty
attributes (was 112 and 113, should be 12 and 13).
 1.3 07-Apr-1996  jonathan branches: 1.3.4;
Remove gcc -Wall lint from ultrix emulation.-
Mostly adding explicit != comparison to "if (error = copyin/out( ... ))".
Fix comment glitch in ultrix_fs.c
 1.2 04-Jan-1996  jonathan Rewrite (a copy of) the emul-sunos termio/termios emulation code to
emulate Ultrix termio/termios instead. Ultrix termio c_cc has separate
VMIM/VTIME attributes, and the Ultrix termios c_cc is a strict
superset of Ultrix termio c_cc. The termios-only c_cc indices are
all changed, relative to SunOS.
 1.1 26-Dec-1995  jonathan Add emulation of Ultrix select: before calling native sys_select(),
limit the number of FDs to select on to the maximum supported by NetBSD --
which is as many FDs as the emul_ultrix process can have open, anyway.

Add emulation of Ultrix getmnt(2) in ultrix_fs.c

Add partial emulation of Ultrix tty ioctl()s in ultrix_ioctl.c, derived
from compat/sunos/sunos_ioctl.c. Ultrix libc's ``isatty()'' now works
in compat_emul processes.
 1.3.4.3 10-Sep-1996  thorpej Back out previos change (typo fix) by request from Jonathan Stone; the
change fixed a typo in an #ifdef, but the code within the #ifdef is broken
and doesn't compile. For more details, "grep XXX ultrix_ioctl.c".
 1.3.4.2 08-Sep-1996  jonathan Fix typo (CMOPAT_ULTRIX -> COMPAT_ULTRIX) around code that uses the Ultrix
termios VSWITCH to set the native VSWITCH. (#ifdef'ed to support a future
merge with other 4.3BSD compat tty code, e.g., SunOS.)
 1.3.4.1 13-Jun-1996  jonathan pull up fix for SUSP and DSUSP from main branch
 1.13.12.2 08-Dec-2000  bouyer Sync with HEAD.
 1.13.12.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.15.2.5 12-Jul-2002  nathanw No longer need to pull in lwp.h; proc.h pulls it in for us.
 1.15.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.15.2.3 06-Dec-2001  wdk struct proc -> struct lwp changes for COMPAT_ULTRIX support
 1.15.2.2 14-Nov-2001  nathanw Catch up to -current.
 1.15.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.17.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.23.2.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.23.2.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.23.2.4 28-Nov-2004  skrll Adapt to branch
 1.23.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.23.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.23.2.1 03-Aug-2004  skrll Sync with HEAD
 1.25.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.25.4.1 29-Apr-2005  kent sync with -current
 1.27.2.5 24-Mar-2008  yamt sync with head.
 1.27.2.4 21-Jan-2008  yamt sync with head
 1.27.2.3 03-Sep-2007  yamt sync with head.
 1.27.2.2 26-Feb-2007  yamt sync with head.
 1.27.2.1 21-Jun-2006  yamt sync with head.
 1.28.20.1 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.29.8.1 11-Jul-2007  mjf Sync with head.
 1.29.6.1 09-Jun-2007  ad Sync with head.
 1.31.20.2 08-Jan-2008  bouyer Sync with HEAD
 1.31.20.1 02-Jan-2008  bouyer Sync with HEAD
 1.31.16.1 26-Dec-2007  ad Sync with head.
 1.31.14.1 18-Feb-2008  mjf Sync with HEAD.
 1.31.8.1 09-Jan-2008  matt sync with HEAD
 1.34.6.1 03-Apr-2008  mjf Sync with HEAD.
 1.35.22.1 09-Sep-2009  matt Change to use fixed sized types.
 1.35.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.35.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.35.4.1 11-Mar-2010  yamt sync with head
 1.36.44.1 04-Nov-2016  pgoyette Sync with HEAD
 1.36.40.1 05-Dec-2016  skrll Sync with HEAD
 1.36.22.1 03-Dec-2017  jdolecek update from HEAD
 1.37.16.1 10-Jun-2019  christos Sync with HEAD
 1.37.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.38.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.127 03-Aug-2023  mrg avoid uninitialised accesses

found by GCC 12.
 1.126 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.125 10-Aug-2018  pgoyette branches: 1.125.4;
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.124 06-May-2018  kamil branches: 1.124.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.123 09-Jan-2018  maya branches: 1.123.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.122 19-Feb-2012  rmind branches: 1.122.32;
Remove COMPAT_SA / KERN_SA. Welcome to 6.99.3!
Approved by core@.
 1.121 07-Jul-2010  chs branches: 1.121.8; 1.121.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.120 03-Mar-2010  pooka branches: 1.120.2;
Remove nfssvc non-emulations I missed yesterday.
 1.119 02-Mar-2010  pooka remove nfssvc emulation (or non-emulation)
 1.118 17-Jan-2009  he branches: 1.118.4;
Adapt to the state after the recent time_t change.
Type changes:
timeval -> timeval50
itimerval -> itimerval50
rusage -> rusage50
and use of the compat_50 calls where appropriate.
Untested, but at least it builds.

Discussed with christos@
 1.117 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.116 15-Oct-2008  wrstuden branches: 1.116.2;
Merge wrstuden-revivesa into HEAD.
 1.115 08-Aug-2008  bjs 'if (error = 0)' -> 'if (error == 0)'
 1.114 07-Aug-2008  plunky convert some [left behind] compat code to use new sockopt API
 1.113 24-Jun-2008  ad branches: 1.113.2;
Replace references to getsock/getvnode.
 1.112 23-Apr-2008  christos branches: 1.112.2; 1.112.4; 1.112.6;
Make this compile again, from Jan-Benedict Glaw jbglaw at lug-owl dot de
 1.111 21-Mar-2008  ad branches: 1.111.2;
Catch up with descriptor handling changes. See kern_descrip.c revision
1.173 for details.
 1.110 27-Dec-2007  christos branches: 1.110.6;
make this compile again.
 1.109 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.108 13-May-2007  dsl branches: 1.108.8; 1.108.14; 1.108.16; 1.108.20;
Delete fom stackgap lines that seem to have got left in.
 1.107 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.106 04-Mar-2007  christos branches: 1.106.2; 1.106.4;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.105 09-Feb-2007  ad branches: 1.105.2;
Merge newlock2 to head.
 1.104 11-Dec-2005  christos branches: 1.104.20;
merge ktrace-lwp.
 1.103 16-Sep-2005  christos add <compat/sys/signal*.h>
 1.102 19-Aug-2005  christos 64 bit inode changes.
 1.101 10-Jul-2005  christos define syscall again.
 1.100 10-Jul-2005  christos No point in declaring syscall_intern and syscall in a zillion places.
 1.99 26-Mar-2005  fvdl branches: 1.99.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.98 26-Feb-2005  perry branches: 1.98.2;
nuke trailing whitespace
 1.97 25-Jan-2005  drochner Hmm - vax is different. sendsig_sigcontext() is for __mips only.
Should fix build error found by Havard Eidnes.
 1.96 24-Jan-2005  drochner branches: 1.96.2;
use sendsig_sigcontext() directly instead of the generic sendsig()
 1.95 27-Oct-2004  david branches: 1.95.4;
Bounds check syscall arguments where appropriate
 1.94 25-Apr-2004  matt Constify a few read-only arrays/variables.
 1.93 21-Apr-2004  simonb ANSIfy, some KNF.
 1.92 20-Dec-2003  fvdl branches: 1.92.2;
Put back Emmanuel's sigfilter hooks, as decided by Core.
 1.91 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.90 05-Dec-2003  jdolecek back the sigfilter emulation hook change off
 1.89 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.88 27-Oct-2003  simonb Fix bogus uninitialised warnings.
 1.87 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.86 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.85 29-Jun-2003  fvdl branches: 1.85.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.84 29-Jun-2003  simonb Fix 'struct lwp *' lossage.
 1.83 29-Jan-2003  atatat Cull unused variables. Sigh.

PS - Cross compilers are cool.
 1.82 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.81 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.80 01-Nov-2002  jdolecek set struct emul's nsysent to compat SYS_NSYSENT, not SYS_MAXSYSCALL
 1.79 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.78 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.77 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.76 16-Mar-2002  christos branches: 1.76.4; 1.76.6;
get rid of STACKGAP* shit.
 1.75 16-Mar-2002  christos 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.74 13-Nov-2001  lukem add RCSIDs (including regeneration of files as appropriate)
 1.73 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.72 17-Sep-2001  jdolecek g/c dead code
 1.71 18-Jun-2001  christos branches: 1.71.2; 1.71.4;
Add an e_trapsignal member to struct emul, so that emulated processes can
send the appropriate signal depending on the trap type.
 1.70 14-Jun-2001  thorpej 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.69 30-May-2001  mrg use _KERNEL_OPT.
 1.68 15-Jan-2001  thorpej branches: 1.68.2;
Grok __HAVE_MINIMAL_EMUL and __HAVE_SYSCALL_INTERN.
 1.67 07-Jan-2001  simonb Move prototypes for mips_user_cachectl() and mips_user_cacheflush()
to <mips/cachectl.h>.
 1.66 16-Dec-2000  jdolecek adapt to recent struct emul changes
 1.65 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.64 09-Dec-2000  jdolecek split ecoff specific code to separate file ultrix_exec_ecoff.c
 1.63 01-Dec-2000  jdolecek make LKM safe
 1.62 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.61 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.60 19-Nov-2000  simonb Update extern declarations of {hpux,ultrix}_syscallnames for change
to e_syscallnames in struct emul. Untested on HP, but should be ok.
 1.59 20-Jul-2000  nisimura version[] string was const'ifed. Pointed out by Izumi Tsutsui.
 1.58 28-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.57 28-Apr-2000  simonb branches: 1.57.4;
The size of the members of struct ultrix_utsname were nothing like
reality - adjust and fill in "version" the same way that some other
compat routines do. An Ultrix "uname -a" returns something meaninful
now instead of just "NetBSD ".
 1.56 30-Mar-2000  augustss Kill register declarations.
 1.55 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.54 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.53 25-Aug-1999  thorpej branches: 1.53.2;
Update for new msgctl()/semctl()/shmctl() calls.
 1.52 30-Jul-1999  drochner emulate fcntl(F_SETLK) & Co.
(seti@home works now:-)
 1.51 05-May-1999  thorpej 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.50 09-Feb-1999  christos branches: 1.50.2; 1.50.4;
Regen
 1.49 26-Oct-1998  sommerfe s/SunOS/Ultrix/ in comment
 1.48 20-Oct-1998  matt vax -> __vax__ (and mips to __mips__ in ultrix_misc.c)
 1.47 19-Oct-1998  tron Defopt SYSVMSG, SYSVSEM and SYSVSHM.
 1.46 03-Oct-1998  drochner Use a private implementation of sys_sigvec(). Ultrix uses an sv_flags bit
unknown to NetBSD and sigaction1() does (now?) complain about it.
 1.45 02-Oct-1998  drochner repair signal handling:
-use own sigcode since the native one uses a sigreturn syscall not present
in Ultrix
-route sigreturn to compat_13_sigreturn
 1.44 26-Sep-1998  drochner Make Ultrix emulation private functions for sigreturn and sigsuspend
because the NetBSD implementation differs now.
 1.43 26-Sep-1998  drochner Update for sigmask changes.
 1.42 13-Aug-1998  eeh Merge paddr_t changes into the main branch.
 1.41 09-Aug-1998  perry bzero->memset, bcopy->memcpy, bcmp->memcmp
 1.40 03-Jul-1998  mhitch branches: 1.40.2;
Add missing include of "opt_nfsserver.h".
 1.39 19-Feb-1998  thorpej Include the NFS option header.
 1.38 19-Oct-1997  jonathan Use void* not caddr_t for 'addr' argument to native mmap().
 1.37 10-Oct-1997  jonathan Correct name of author in license clause 3, as per email with mrg.
 1.36 24-Sep-1997  mhitch Fix a missed *setregs() change.
 1.35 09-Jun-1997  jonathan branches: 1.35.4;
Emulate RISC Ultrix cacheflush() and cachectl() syscalls on mips.
 1.34 25-May-1997  jonathan GC old ultrix-emul syscall stub used to debug ultrix signals.
 1.33 24-May-1997  jonathan Add prototype for cpu_exec_ecoff_setregs() to mips/inuclde/ecoff_machdep.h.
Use it in compat/ultrix/ultrix_misc.c (setting emul type on mips).
 1.32 24-May-1997  jonathan lint: add explicit return type to ultrix_sys_shmsys().
 1.31 26-Apr-1997  jonathan Correct shm ifdefs for when SVSHM is defined. Fix from Ted Lemon in PR 3542.
 1.30 06-Apr-1997  jonathan Add changes to make vic-2.8 Ultrix binaries work on NetBSD with COMPAT_ULTRIX:
* Add IPmulticast setsockopt emulation.
* Add Ultrix shmsys emulation (untested).
* tidy up use of stackgap.
 1.29 31-Jan-1997  thorpej NFSCLIENT -> NFS
 1.28 19-Oct-1996  jonathan branches: 1.28.2;
Update copyright.
 1.27 13-Oct-1996  christos Backout previous kprintf change.
 1.26 10-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.25 10-Aug-1996  mycroft sys/dir.h -> sys/dirent.h
 1.24 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.23 07-Apr-1996  jonathan branches: 1.23.4;
Remove gcc -Wall lint from ultrix emulation.-
Mostly adding explicit != comparison to "if (error = copyin/out( ... ))".
Fix comment glitch in ultrix_fs.c
 1.22 07-Apr-1996  jonathan Add vax setregs() support for exec'ing vax ultrix a.out binaries.
 1.21 19-Feb-1996  pk Adapt to NFSv3.
 1.20 07-Jan-1996  jonathan Add '/emul/ultrix' pathname processing to Ultrix emulation, and move
Ultrix syscalls that require that processing out of ultrix_misc.c
to ultrix_pathname.c.
 1.19 03-Jan-1996  jonathan Add sigcode and esigcode to emul_ultrix, so that signal trampoline
code is set up for emul_ultrix processes.
 1.18 26-Dec-1995  jonathan Add emulation of Ultrix select: before calling native sys_select(),
limit the number of FDs to select on to the maximum supported by NetBSD --
which is as many FDs as the emul_ultrix process can have open, anyway.

Add emulation of Ultrix getmnt(2) in ultrix_fs.c

Add partial emulation of Ultrix tty ioctl()s in ultrix_ioctl.c, derived
from compat/sunos/sunos_ioctl.c. Ultrix libc's ``isatty()'' now works
in compat_emul processes.
 1.17 30-Nov-1995  jtc merge in changes from 1.1 release branch
 1.16 07-Oct-1995  mycroft branches: 1.16.2;
Prefix names of system call implementation functions with `sys_'.
 1.15 19-Sep-1995  thorpej Make system calls conform to a standard prototype and bring those
prototypes into scope.
 1.14 18-Jun-1995  cgd don't assume the f_fsnamelen is nul-truncated or longer than MFSNAMELEN
 1.13 01-Jun-1995  mellon Clear up name conflict between Ultrix syscall 103 and 139.
 1.12 25-Apr-1995  mellon sigcode and esigcode aren't defined for ultrix emulation
 1.11 22-Apr-1995  christos - added struct emul to all emulations.
- removed all setup functions.
- added copyargs() functions where needed.
 1.10 09-Mar-1995  mycroft copy*str() should use size_t.
 1.9 18-Jan-1995  mellon Fix up non-ANSI code (which was a no-op anyway)
 1.8 23-Nov-1994  dean {get,set}rlimit functions (From Jonathan Stone)
 1.7 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.6 01-Aug-1994  glass ultrix_{get,set}info from Arne H Juul <arnej@dsl.unit.no>
 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 25-Jun-1994  glass oops
 1.3 22-Jun-1994  glass update for getdtablesize change, and track compat_sunos
 1.2 15-Jun-1994  glass much works but untested w/new fs. expect more tomorrow
 1.1 02-Jun-1994  glass first swipe at ultrix compat. expect many bug fixes. very related to compat/sunos
 1.5.2.1 01-Aug-1994  cgd From trunk.
 1.16.2.1 18-Oct-1995  jonathan Fix arg mismatch in ultrix-compat open(), which broke groff. (there is no
version of gcc that both compiles for NetBSD/mips and also compiles groff,
so I use an groff binary compiled on Ultrix.)
 1.23.4.1 10-Dec-1996  mycroft From trunk:
sys/dir.h -> sys/dirent.h
 1.28.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.35.4.2 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.35.4.1 29-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.40.2.1 30-Jul-1998  eeh Split vm_offset_t and vm_size_t into paddr_t, psize_t, vaddr_t, and vsize_t.
 1.50.4.2 02-Aug-1999  thorpej Update from trunk.
 1.50.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.50.2.1 31-Jan-2000  he Pull up revision 1.52 (requested by mhitch):
Emulate Ultrix fcntl(F_SETLK) & Co. so the Ultrix seti@home client
works.
 1.53.2.6 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.53.2.5 05-Jan-2001  bouyer Sync with HEAD
 1.53.2.4 13-Dec-2000  bouyer Sync with HEAD (for UBC fixes).
 1.53.2.3 08-Dec-2000  bouyer Sync with HEAD.
 1.53.2.2 22-Nov-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.4.1 21-Jul-2000  nisimura Pull up 1.59 with approval notice from thorpej.

version[] string was const'ifed.
 1.68.2.11 11-Nov-2002  nathanw Catch up to -current
 1.68.2.10 18-Oct-2002  nathanw Catch up to -current.
 1.68.2.9 17-Sep-2002  nathanw Catch up to -current.
 1.68.2.8 01-Aug-2002  nathanw Catch up to -current.
 1.68.2.7 12-Jul-2002  nathanw No longer need to pull in lwp.h; proc.h pulls it in for us.
 1.68.2.6 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.68.2.5 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.68.2.4 06-Dec-2001  wdk struct proc -> struct lwp changes for COMPAT_ULTRIX support
 1.68.2.3 14-Nov-2001  nathanw Catch up to -current.
 1.68.2.2 21-Sep-2001  nathanw Catch up to -current.
 1.68.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.71.4.1 01-Oct-2001  fvdl Catch up with -current.
 1.71.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.71.2.3 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.71.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.71.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.76.6.1 16-Dec-2004  jmc Pullup patch (requested by david in ticket #1800)

Bounds check syscall arguments where appropriate.
 1.76.4.2 15-Jul-2002  gehenna catch up with -current.
 1.76.4.1 16-May-2002  gehenna Get rid of iszerodev. Use the 'zerodev' (dev_t for /dev/zero).
 1.85.2.9 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.85.2.8 01-Apr-2005  skrll Sync with HEAD.
 1.85.2.7 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.85.2.6 04-Feb-2005  skrll Sync with HEAD.
 1.85.2.5 28-Nov-2004  skrll Adapt to branch
 1.85.2.4 02-Nov-2004  skrll Sync with HEAD.
 1.85.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.85.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.85.2.1 03-Aug-2004  skrll Sync with HEAD
 1.92.2.1 12-Nov-2004  jmc Pullup rev 1.95 (requested by david in ticket #946)

Bounds check syscall arguments where appropriate.
 1.95.4.1 29-Apr-2005  kent sync with -current
 1.96.2.3 26-Mar-2005  yamt sync with head.
 1.96.2.2 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.96.2.1 12-Feb-2005  yamt sync with head.
 1.98.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.99.2.5 24-Mar-2008  yamt sync with head.
 1.99.2.4 21-Jan-2008  yamt sync with head
 1.99.2.3 03-Sep-2007  yamt sync with head.
 1.99.2.2 26-Feb-2007  yamt sync with head.
 1.99.2.1 21-Jun-2006  yamt sync with head.
 1.104.20.2 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.104.20.1 29-Dec-2006  ad Checkpoint work in progress.
 1.105.2.2 17-May-2007  yamt sync with head.
 1.105.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.106.4.1 11-Jul-2007  mjf Sync with head.
 1.106.2.1 08-Jun-2007  ad Sync with head.
 1.108.20.1 02-Jan-2008  bouyer Sync with HEAD
 1.108.16.1 26-Dec-2007  ad Sync with head.
 1.108.14.1 18-Feb-2008  mjf Sync with HEAD.
 1.108.8.1 09-Jan-2008  matt sync with HEAD
 1.110.6.5 17-Jan-2009  mjf Sync with HEAD.
 1.110.6.4 28-Sep-2008  mjf Sync with HEAD.
 1.110.6.3 29-Jun-2008  mjf Sync with HEAD.
 1.110.6.2 02-Jun-2008  mjf Sync with HEAD.
 1.110.6.1 03-Apr-2008  mjf Sync with HEAD.
 1.111.2.1 18-May-2008  yamt sync with head.
 1.112.6.1 27-Jun-2008  simonb Sync with head.
 1.112.4.3 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.112.4.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.112.4.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.112.2.3 11-Aug-2010  yamt sync with head.
 1.112.2.2 11-Mar-2010  yamt sync with head
 1.112.2.1 04-May-2009  yamt sync with head.
 1.113.2.2 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.113.2.1 19-Oct-2008  haad Sync with HEAD.
 1.116.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.118.4.2 17-Aug-2010  uebayasi Sync with HEAD.
 1.118.4.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.120.2.1 05-Mar-2011  rmind sync with head
 1.121.12.1 24-Feb-2012  mrg sync to -current.
 1.121.8.1 17-Apr-2012  yamt sync with head
 1.122.32.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.123.2.2 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.123.2.1 21-May-2018  pgoyette Sync with HEAD
 1.124.2.1 10-Jun-2019  christos Sync with HEAD
 1.125.4.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.6 03-Mar-2019  pgoyette Fix the required-list for compat_ultrix. With the merge of the
[pgoyette-compat] branch there is no longer a "compat" module;
instead we have lots of version-specific compat_xx modules.

Code inspection shows compat_ultrix uses compat_13 (and newer)
stuff, so set the requirements list accordingly.

Should fix PR port-pmax/54037
 1.5 07-Mar-2014  christos branches: 1.5.30;
c99 initializers for struct execsw
 1.4 19-Sep-2013  christos exec modules need to be of the exec kind
 1.3 24-Nov-2008  ad branches: 1.3.4; 1.3.6; 1.3.8; 1.3.12; 1.3.24; 1.3.34; 1.3.38;
COMPAT_ULTRIX does not work on vax because there are no hooks, but make
it compile anyway.
 1.2 20-Nov-2008  cegger take ecoff header for ecoff code.
 1.1 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.3.38.1 18-May-2014  rmind sync with head
 1.3.34.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3.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.3.12.2 04-May-2009  yamt sync with head.
 1.3.12.1 24-Nov-2008  yamt file ultrix_mod.c was added on branch yamt-nfs-mp on 2009-05-04 08:12:29 +0000
 1.3.8.2 19-Jan-2009  skrll Sync with HEAD.
 1.3.8.1 24-Nov-2008  skrll file ultrix_mod.c was added on branch nick-hppapmap on 2009-01-19 13:17:45 +0000
 1.3.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.3.6.1 24-Nov-2008  mjf file ultrix_mod.c was added on branch mjf-devfs2 on 2009-01-17 13:28:49 +0000
 1.3.4.2 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.3.4.1 24-Nov-2008  haad file ultrix_mod.c was added on branch haad-dm on 2008-12-13 01:14:07 +0000
 1.5.30.1 10-Jun-2019  christos Sync with HEAD
 1.40 12-Oct-2022  andvar fix few typos in comments.
 1.39 05-Sep-2014  matt Try not to use f_data, use f_{vnode,socket,pipe,mqueue,kqueue,ksem} to get
a correctly typed pointer.
 1.38 14-Dec-2009  matt branches: 1.38.22;
Merge from matt-nb5-mips64
 1.37 29-Jun-2009  dholland 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.36 17-Jan-2009  he branches: 1.36.2;
Adapt to the state after the recent time_t change.
Type changes:
timeval -> timeval50
itimerval -> itimerval50
rusage -> rusage50
and use of the compat_50 calls where appropriate.
Untested, but at least it builds.

Discussed with christos@
 1.35 24-Jun-2008  ad branches: 1.35.4; 1.35.12;
Replace references to getsock/getvnode.
 1.34 21-Mar-2008  ad branches: 1.34.4; 1.34.6; 1.34.8;
Catch up with descriptor handling changes. See kern_descrip.c revision
1.173 for details.
 1.33 05-Jan-2008  dsl branches: 1.33.6;
Use FILE_LOCK() and FILE_UNLOCK().
Attempt to fix all the code paths so that the 'fp' returned by fd_getfile()
isn't left locked, and is always unlocked (and ref-counted) before
doing anything that might sleep.
 1.32 27-Dec-2007  christos make this compile again.
 1.31 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.30 08-Dec-2007  pooka branches: 1.30.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.29 27-Nov-2007  dogcow branches: 1.29.2;
more VFS_STATVFS(x,y,z) fallout; change them to VFS_STATVFS(x,y). (hi, pooka!)
 1.28 25-Apr-2007  matt branches: 1.28.6; 1.28.8; 1.28.14;
Make this compile again (after stackgap removal)
 1.27 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.26 04-Mar-2007  christos branches: 1.26.2; 1.26.4;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.25 09-Feb-2007  ad branches: 1.25.2;
Merge newlock2 to head.
 1.24 11-Dec-2005  christos branches: 1.24.20;
merge ktrace-lwp.
 1.23 26-Feb-2005  perry branches: 1.23.4;
nuke trailing whitespace
 1.22 21-Apr-2004  simonb branches: 1.22.4; 1.22.6;
ANSIfy, some KNF.
 1.21 21-Apr-2004  simonb Fix some statfs->statvfs fallout. Compile tested only...
 1.20 21-Apr-2004  christos Replace the statfs() family of system calls with statvfs().
Retain binary compatibility.
 1.19 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.18 29-Jun-2003  fvdl branches: 1.18.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.17 29-Jun-2003  simonb Fix 'struct lwp *' lossage.
 1.16 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.15 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.14 16-Mar-2002  christos 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.13 13-Nov-2001  lukem add RCSIDs (including regeneration of files as appropriate)
 1.12 14-Jun-2001  thorpej branches: 1.12.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.11 01-Dec-2000  jdolecek branches: 1.11.2;
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.10 30-Mar-2000  augustss Kill register declarations.
 1.9 05-May-1999  thorpej branches: 1.9.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.8 09-Feb-1999  christos branches: 1.8.4;
const poisoning and CHECK_ALT_CREAT fixes.
 1.7 09-Aug-1998  perry bzero->memset, bcopy->memcpy, bcmp->memcmp
 1.6 25-May-1997  jonathan lint: add prototype for static local function ultrixstatfs().
 1.5 14-Oct-1996  mhitch Now needs sys/proc.h since compat/common/compat_util.h doesn't anymore.
 1.4 29-Sep-1996  jonathan Fix cut-and-paste (ouap vs ap) bugs so the previous revision actually
compiles. Change variable names to use "ap" instead of "ouap" everywhere
to avoid similar bugs in future.
 1.3 03-Sep-1996  mycroft Define execv() and execve() consistently across emulations.
Do path name translation.
 1.2 07-Apr-1996  jonathan branches: 1.2.4;
Remove gcc -Wall lint from ultrix emulation.-
Mostly adding explicit != comparison to "if (error = copyin/out( ... ))".
Fix comment glitch in ultrix_fs.c
 1.1 07-Jan-1996  jonathan Add '/emul/ultrix' pathname processing to Ultrix emulation, and move
Ultrix syscalls that require that processing out of ultrix_misc.c
to ultrix_pathname.c.
 1.2.4.1 10-Dec-1996  mycroft From trunk:
Do execv() and execve() path name translation consistently across
emulations.
 1.8.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.9.2.2 08-Dec-2000  bouyer Sync with HEAD.
 1.9.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.11.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.11.2.4 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.11.2.3 06-Dec-2001  wdk struct proc -> struct lwp changes for COMPAT_ULTRIX support
 1.11.2.2 14-Nov-2001  nathanw Catch up to -current.
 1.11.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.12.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.12.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.18.2.6 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.18.2.5 28-Nov-2004  skrll Adapt to branch
 1.18.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.18.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.18.2.2 03-Aug-2004  skrll Sync with HEAD
 1.18.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.22.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.22.4.1 29-Apr-2005  kent sync with -current
 1.23.4.6 24-Mar-2008  yamt sync with head.
 1.23.4.5 21-Jan-2008  yamt sync with head
 1.23.4.4 07-Dec-2007  yamt sync with head
 1.23.4.3 03-Sep-2007  yamt sync with head.
 1.23.4.2 26-Feb-2007  yamt sync with head.
 1.23.4.1 21-Jun-2006  yamt sync with head.
 1.24.20.2 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.24.20.1 29-Dec-2006  ad Checkpoint work in progress.
 1.25.2.2 07-May-2007  yamt sync with head.
 1.25.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.26.4.1 11-Jul-2007  mjf Sync with head.
 1.26.2.1 08-Jun-2007  ad Sync with head.
 1.28.14.3 18-Feb-2008  mjf Sync with HEAD.
 1.28.14.2 27-Dec-2007  mjf Sync with HEAD.
 1.28.14.1 08-Dec-2007  mjf Sync with HEAD.
 1.28.8.1 09-Jan-2008  matt sync with HEAD
 1.28.6.2 09-Dec-2007  jmcneill Sync with HEAD.
 1.28.6.1 27-Nov-2007  joerg Sync with HEAD. amd64 Xen support needs testing.
 1.29.2.1 26-Dec-2007  ad Sync with head.
 1.30.4.2 08-Jan-2008  bouyer Sync with HEAD
 1.30.4.1 02-Jan-2008  bouyer Sync with HEAD
 1.33.6.2 29-Jun-2008  mjf Sync with HEAD.
 1.33.6.1 03-Apr-2008  mjf Sync with HEAD.
 1.34.8.1 27-Jun-2008  simonb Sync with head.
 1.34.6.3 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.34.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.34.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.34.4.3 11-Mar-2010  yamt sync with head
 1.34.4.2 18-Jul-2009  yamt sync with head.
 1.34.4.1 04-May-2009  yamt sync with head.
 1.35.12.1 09-Sep-2009  matt Change to use fixed sized types.
 1.35.4.1 19-Jan-2009  skrll Sync with HEAD.
 1.36.2.1 23-Jul-2009  jym Sync with HEAD.
 1.38.22.1 03-Dec-2017  jdolecek update from HEAD
 1.75 03-Mar-2019  pgoyette Regen
 1.74 27-Jan-2019  pgoyette Merge the [pgoyette-compat] branch
 1.73 10-Aug-2018  pgoyette Regen
 1.72 06-Jan-2018  kamil branches: 1.72.2; 1.72.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.71 19-Dec-2017  kamil compat/ultrix: Drop SYS_vadvise

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

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

sbrk - change data segment size

This syscall is dummy since the inception of the project.

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

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

Sponsored by <The NetBSD Foundation>
 1.68 10-May-2017  riastradh regen
 1.67 16-Jan-2017  christos branches: 1.67.4;
regen
 1.66 13-Jan-2017  christos branches: 1.66.2;
regen
 1.65 24-Sep-2015  christos branches: 1.65.2;
regen
 1.64 07-Mar-2015  christos regen
 1.63 07-Nov-2013  njoly branches: 1.63.6;
Regen for dup/dup2/dup3 argument types fix.
 1.62 02-Mar-2010  pooka branches: 1.62.10; 1.62.20; 1.62.24;
regen:
- remove nfssvc / fs_nfs.h / #ifdef NFS
- make getfh unconditional
 1.61 14-Dec-2009  matt branches: 1.61.2;
Regen (new makesyscalls.sh)
 1.60 17-Jan-2009  he Regenerate files after updating syscalls.master for compat_ultrix:

Adapt to the state after the recent time_t change.
Type changes:
timeval -> timeval50
itimerval -> itimerval50
rusage -> rusage50
and use of the compat_50 calls where appropriate.
Untested, but at least it builds.

Discussed with christos@
 1.59 13-Jan-2009  pooka Regen to prove I didn't screw up the conversion: purely RCSID changes.
 1.58 13-Jan-2009  pooka regen
 1.57 19-Nov-2008  ad Regen.
 1.56 19-Jun-2008  hans branches: 1.56.2; 1.56.4;
regen from syscalls.master r1.46
 1.55 23-Apr-2008  ad branches: 1.55.2; 1.55.4; 1.55.6;
Regen.
 1.54 20-Dec-2007  dsl branches: 1.54.6; 1.54.8;
regen
 1.53 04-Mar-2007  christos branches: 1.53.16; 1.53.24; 1.53.28;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.52 13-Jul-2006  pavel branches: 1.52.10;
regen (sys_getfh -> compat_30_sys_getfh)
 1.51 26-Jun-2006  mrg regenerate.
 1.50 11-Dec-2005  christos branches: 1.50.4; 1.50.8; 1.50.16;
merge ktrace-lwp.
 1.49 26-Feb-2005  perry branches: 1.49.4;
regen
 1.48 26-Feb-2005  perry regen
 1.47 18-Jan-2003  thorpej branches: 1.47.2; 1.47.10; 1.47.12;
Regen for correct RCS ID.
 1.46 18-Jan-2003  thorpej Regen: Merge the nathanw_sa branch.
 1.45 01-Nov-2002  jdolecek set nsysent to 512 (oh well, just three syscalls too many for 256)
 1.44 13-Nov-2001  lukem add RCSIDs (including regeneration of files as appropriate)
 1.43 30-May-2001  mrg branches: 1.43.2;
use _KERNEL_OPT.
 1.42 27-Jan-2001  thorpej branches: 1.42.2;
egen; getpid(2) is MP-safe.
 1.41 27-Jan-2001  thorpej Regen; add sy_flags.
 1.40 09-Dec-2000  mycroft Regen.
 1.39 18-Aug-2000  cgd update for changed makesyscalls.master
 1.38 30-Jul-1999  drochner branches: 1.38.2;
regen
 1.37 12-Jul-1999  kleink Regen.
 1.36 09-Feb-1999  christos branches: 1.36.2; 1.36.4;
Regen
 1.35 18-Dec-1998  drochner regen
 1.34 10-Dec-1998  christos Regen
 1.33 03-Oct-1998  drochner regen
 1.32 26-Sep-1998  drochner regen
 1.31 25-Jun-1998  thorpej Regen: defopt NFSSERVER
 1.30 19-Feb-1998  thorpej Regen: makesyscalls.sh changed.
 1.29 19-Feb-1998  thorpej Regen; syscalls.master and makesyscalls.sh changed.
 1.28 14-Feb-1998  kleink Regen: use POSIX semantics for chown()/fchown().
 1.27 22-Jan-1998  mycroft Regen.
 1.26 09-Jan-1998  thorpej Regen.
 1.25 08-Jan-1998  thorpej Regen: back out RCD ID related changes.
 1.24 05-Jan-1998  perry regened with RCSIDs in place
 1.23 16-Oct-1997  christos Regen.
 1.22 13-Jun-1997  thorpej Regen: Use compat_12_sys_swapon().
 1.21 09-Jun-1997  jonathan Emulate RISC Ultrix cacheflush() and cachectl() syscalls on mips.
 1.20 06-Apr-1997  jonathan Add changes to make vic-2.8 Ultrix binaries work on NetBSD with COMPAT_ULTRIX:
* Add IPmulticast setsockopt emulation.
* Add Ultrix shmsys emulation (untested).
* tidy up use of stackgap.
 1.19 31-Jan-1997  thorpej Syscalls.master changed, regen. (NFSCLIENT -> NFS)
 1.18 13-Jan-1997  thorpej Regen; makesyscalls.sh emits comments now.
 1.17 03-Sep-1996  mycroft Regen.
 1.16 23-Jun-1996  mycroft Regen.
 1.15 07-Jan-1996  jonathan branches: 1.15.4;
Add '/emul/ultrix' pathname processing to Ultrix emulation, and move
Ultrix syscalls that require that processing out of ultrix_misc.c
to ultrix_pathname.c.
 1.14 26-Dec-1995  jonathan Add emulation of ultrix mount(2). Sufficient to NFS-mount filesystems
using a NetBSD kernel in an ultrix root filesystem.

Move wait emulation to the old (v7) wait syscall number, as that's
what the Ultrix ufs_mount binary uses.
 1.13 26-Dec-1995  jonathan Add emulation of Ultrix select: before calling native sys_select(),
limit the number of FDs to select on to the maximum supported by NetBSD --
which is as many FDs as the emul_ultrix process can have open, anyway.

Add emulation of Ultrix getmnt(2) in ultrix_fs.c

Add partial emulation of Ultrix tty ioctl()s in ultrix_ioctl.c, derived
from compat/sunos/sunos_ioctl.c. Ultrix libc's ``isatty()'' now works
in compat_emul processes.
 1.12 07-Oct-1995  mycroft Reran makesyscalls.sh.
 1.11 19-Sep-1995  thorpej makesyscalls.sh changed
 1.10 01-Jun-1995  mellon Clear up name conflict between Ultrix syscall 103 and 139.
 1.9 29-May-1995  mellon syscall 139 is ULTRIX_SYS_sigcleanup (from Simon Burge)
 1.8 22-Apr-1995  christos - added struct emul to all emulations.
- removed all setup functions.
- added copyargs() functions where needed.
 1.7 01-Dec-1994  dean added sigreturn
 1.6 23-Nov-1994  dean changes for new sysent structure (from J. Stone)
 1.5 01-Aug-1994  glass add ultrix_{get,set}sysinfo() from Arne H Juul <arnej@dsl.unit.no>
 1.4 30-Jun-1994  cgd branches: 1.4.2;
fix a botch, and gen syscall files
 1.3 22-Jun-1994  glass update to reflect compat_ultrix syscalls.master
 1.2 15-Jun-1994  glass much works but untested w/new fs. expect more tomorrow
 1.1 02-Jun-1994  glass first swipe at ultrix compat. expect many bug fixes. very related to compat/sunos
 1.4.2.1 01-Aug-1994  cgd From trunk.
 1.15.4.1 10-Dec-1996  mycroft Regen.
 1.36.4.1 02-Aug-1999  thorpej Regen.
 1.36.2.1 31-Jan-2000  he Pull up regenerated files (requested by mhitch):
Emulate Ultrix fcntl(F_SETLK) & Co. so the Ultrix seti@home client
works.
 1.38.2.3 11-Feb-2001  bouyer Sync with HEAD.
 1.38.2.2 13-Dec-2000  bouyer Sync with HEAD (for UBC fixes).
 1.38.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.42.2.5 11-Nov-2002  nathanw Catch up to -current
 1.42.2.4 29-May-2002  nathanw Regen.
 1.42.2.3 06-Dec-2001  wdk Regen to incorperate LWP support
 1.42.2.2 14-Nov-2001  nathanw Catch up to -current.
 1.42.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.43.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.47.12.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.47.10.1 29-Apr-2005  kent sync with -current
 1.47.2.1 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.49.4.3 21-Jan-2008  yamt sync with head
 1.49.4.2 03-Sep-2007  yamt sync with head.
 1.49.4.1 30-Dec-2006  yamt sync with head.
 1.50.16.1 13-Jul-2006  gdamore Merge from HEAD.
 1.50.8.1 11-Aug-2006  yamt sync with head
 1.50.4.1 09-Sep-2006  rpaulo sync with head
 1.52.10.1 12-Mar-2007  rmind Sync with HEAD.
 1.53.28.1 02-Jan-2008  bouyer Sync with HEAD
 1.53.24.1 26-Dec-2007  ad Sync with head.
 1.53.16.1 09-Jan-2008  matt sync with HEAD
 1.54.8.1 18-May-2008  yamt sync with head.
 1.54.6.3 17-Jan-2009  mjf Sync with HEAD.
 1.54.6.2 29-Jun-2008  mjf Sync with HEAD.
 1.54.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.55.6.1 27-Jun-2008  simonb Sync with head.
 1.55.4.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.55.2.2 11-Mar-2010  yamt sync with head
 1.55.2.1 04-May-2009  yamt sync with head.
 1.56.4.1 19-Jan-2009  skrll Sync with HEAD.
 1.56.2.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.61.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.62.24.1 18-May-2014  rmind sync with head
 1.62.20.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.62.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.63.6.1 06-Apr-2015  skrll Sync with HEAD
 1.65.2.1 20-Mar-2017  pgoyette Sync with HEAD
 1.66.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.67.4.1 11-May-2017  pgoyette Sync with HEAD
 1.72.4.1 10-Jun-2019  christos Sync with HEAD
 1.72.2.2 29-Sep-2018  pgoyette Regen
 1.72.2.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.70 03-Mar-2019  pgoyette Regen
 1.69 27-Jan-2019  pgoyette Merge the [pgoyette-compat] branch
 1.68 10-Aug-2018  pgoyette Regen
 1.67 06-Jan-2018  kamil branches: 1.67.2; 1.67.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.66 19-Dec-2017  kamil compat/ultrix: Drop SYS_vadvise

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

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

sbrk - change data segment size

This syscall is dummy since the inception of the project.

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

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

Sponsored by <The NetBSD Foundation>
 1.63 10-May-2017  riastradh regen
 1.62 16-Jan-2017  christos branches: 1.62.4;
regen
 1.61 13-Jan-2017  christos branches: 1.61.2;
regen
 1.60 24-Sep-2015  christos branches: 1.60.2;
regen
 1.59 07-Mar-2015  christos regen
 1.58 07-Nov-2013  njoly branches: 1.58.6;
Regen for dup/dup2/dup3 argument types fix.
 1.57 02-Mar-2010  pooka branches: 1.57.10; 1.57.20; 1.57.24;
regen:
- remove nfssvc / fs_nfs.h / #ifdef NFS
- make getfh unconditional
 1.56 14-Dec-2009  matt branches: 1.56.2;
Regen (new makesyscalls.sh)
 1.55 17-Jan-2009  he Regenerate files after updating syscalls.master for compat_ultrix:

Adapt to the state after the recent time_t change.
Type changes:
timeval -> timeval50
itimerval -> itimerval50
rusage -> rusage50
and use of the compat_50 calls where appropriate.
Untested, but at least it builds.

Discussed with christos@
 1.54 13-Jan-2009  pooka Regen to prove I didn't screw up the conversion: purely RCSID changes.
 1.53 13-Jan-2009  pooka regen
 1.52 19-Nov-2008  ad Regen.
 1.51 19-Jun-2008  hans branches: 1.51.2; 1.51.4;
regen from syscalls.master r1.46
 1.50 23-Apr-2008  ad branches: 1.50.2; 1.50.4; 1.50.6;
Regen.
 1.49 27-Dec-2007  christos branches: 1.49.6; 1.49.8;
make this compile again.
 1.48 20-Dec-2007  dsl regen
 1.47 04-Mar-2007  christos branches: 1.47.16; 1.47.22; 1.47.24; 1.47.28;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.46 13-Jul-2006  pavel branches: 1.46.10;
regen (sys_getfh -> compat_30_sys_getfh)
 1.45 26-Jun-2006  mrg regenerate.
 1.44 11-Dec-2005  christos branches: 1.44.4; 1.44.8; 1.44.16;
merge ktrace-lwp.
 1.43 26-Feb-2005  perry branches: 1.43.4;
regen
 1.42 26-Feb-2005  perry regen
 1.41 18-Jan-2003  thorpej branches: 1.41.2; 1.41.10; 1.41.12;
Regen for correct RCS ID.
 1.40 18-Jan-2003  thorpej Regen: Merge the nathanw_sa branch.
 1.39 13-Nov-2001  lukem add RCSIDs (including regeneration of files as appropriate)
 1.38 30-May-2001  mrg branches: 1.38.2;
use _KERNEL_OPT.
 1.37 27-Jan-2001  thorpej branches: 1.37.2;
egen; getpid(2) is MP-safe.
 1.36 27-Jan-2001  thorpej Regen; add sy_flags.
 1.35 09-Dec-2000  mycroft Regen.
 1.34 18-Aug-2000  cgd update for changed makesyscalls.master
 1.33 18-Aug-2000  cgd update for my change to makesyscalls.sh, and apparently previous
changes as well...
 1.32 30-Jul-1999  drochner branches: 1.32.2;
regen
 1.31 12-Jul-1999  kleink Regen.
 1.30 09-Feb-1999  christos branches: 1.30.2; 1.30.4;
Regen
 1.29 18-Dec-1998  drochner regen
 1.28 10-Dec-1998  christos Regen
 1.27 03-Oct-1998  eeh Fixup big-endian syscall args.
 1.26 03-Oct-1998  drochner regen
 1.25 26-Sep-1998  drochner regen
 1.24 25-Jun-1998  thorpej Regen: defopt NFSSERVER
 1.23 19-Feb-1998  thorpej Regen: makesyscalls.sh changed.
 1.22 19-Feb-1998  thorpej Regen; syscalls.master and makesyscalls.sh changed.
 1.21 14-Feb-1998  kleink Regen: use POSIX semantics for chown()/fchown().
 1.20 22-Jan-1998  mycroft Regen.
 1.19 09-Jan-1998  thorpej Regen.
 1.18 08-Jan-1998  thorpej Regen: back out RCD ID related changes.
 1.17 05-Jan-1998  perry regened with RCSIDs in place
 1.16 16-Oct-1997  christos Regen.
 1.15 13-Jun-1997  thorpej Regen: Use compat_12_sys_swapon().
 1.14 09-Jun-1997  jonathan Emulate RISC Ultrix cacheflush() and cachectl() syscalls on mips.
 1.13 06-Apr-1997  jonathan Add changes to make vic-2.8 Ultrix binaries work on NetBSD with COMPAT_ULTRIX:
* Add IPmulticast setsockopt emulation.
* Add Ultrix shmsys emulation (untested).
* tidy up use of stackgap.
 1.12 31-Jan-1997  thorpej branches: 1.12.2;
Syscalls.master changed, regen. (NFSCLIENT -> NFS)
 1.11 03-Sep-1996  mycroft branches: 1.11.2;
Regen.
 1.10 23-Jun-1996  mycroft Regen.
 1.9 07-Jan-1996  jonathan branches: 1.9.4;
Add '/emul/ultrix' pathname processing to Ultrix emulation, and move
Ultrix syscalls that require that processing out of ultrix_misc.c
to ultrix_pathname.c.
 1.8 26-Dec-1995  jonathan Add emulation of ultrix mount(2). Sufficient to NFS-mount filesystems
using a NetBSD kernel in an ultrix root filesystem.

Move wait emulation to the old (v7) wait syscall number, as that's
what the Ultrix ufs_mount binary uses.
 1.7 26-Dec-1995  jonathan Add emulation of Ultrix select: before calling native sys_select(),
limit the number of FDs to select on to the maximum supported by NetBSD --
which is as many FDs as the emul_ultrix process can have open, anyway.

Add emulation of Ultrix getmnt(2) in ultrix_fs.c

Add partial emulation of Ultrix tty ioctl()s in ultrix_ioctl.c, derived
from compat/sunos/sunos_ioctl.c. Ultrix libc's ``isatty()'' now works
in compat_emul processes.
 1.6 07-Oct-1995  mycroft Reran makesyscalls.sh.
 1.5 19-Sep-1995  thorpej makesyscalls.sh changed
 1.4 01-Jun-1995  mellon Clear up name conflict between Ultrix syscall 103 and 139.
 1.3 22-Apr-1995  christos - added struct emul to all emulations.
- removed all setup functions.
- added copyargs() functions where needed.
 1.2 01-Dec-1994  dean added sigreturn
 1.1 01-Dec-1994  dean New syscall stuff
 1.9.4.1 10-Dec-1996  mycroft Regen.
 1.11.2.1 14-Jan-1997  thorpej syscalls.master changed; regen.
 1.12.2.1 14-Feb-1997  mrg regen.
 1.30.4.1 02-Aug-1999  thorpej Regen.
 1.30.2.1 31-Jan-2000  he Pull up regenerated files (requested by mhitch):
Emulate Ultrix fcntl(F_SETLK) & Co. so the Ultrix seti@home client
works.
 1.32.2.3 11-Feb-2001  bouyer Sync with HEAD.
 1.32.2.2 13-Dec-2000  bouyer Sync with HEAD (for UBC fixes).
 1.32.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.37.2.4 29-May-2002  nathanw Regen.
 1.37.2.3 06-Dec-2001  wdk Regen to incorperate LWP support
 1.37.2.2 14-Nov-2001  nathanw Catch up to -current.
 1.37.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.38.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.41.12.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.41.10.1 29-Apr-2005  kent sync with -current
 1.41.2.1 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.43.4.3 21-Jan-2008  yamt sync with head
 1.43.4.2 03-Sep-2007  yamt sync with head.
 1.43.4.1 30-Dec-2006  yamt sync with head.
 1.44.16.1 13-Jul-2006  gdamore Merge from HEAD.
 1.44.8.1 11-Aug-2006  yamt sync with head
 1.44.4.1 09-Sep-2006  rpaulo sync with head
 1.46.10.1 12-Mar-2007  rmind Sync with HEAD.
 1.47.28.1 02-Jan-2008  bouyer Sync with HEAD
 1.47.24.1 26-Dec-2007  ad Sync with head.
 1.47.22.1 18-Feb-2008  mjf Sync with HEAD.
 1.47.16.1 09-Jan-2008  matt sync with HEAD
 1.49.8.1 18-May-2008  yamt sync with head.
 1.49.6.3 17-Jan-2009  mjf Sync with HEAD.
 1.49.6.2 29-Jun-2008  mjf Sync with HEAD.
 1.49.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.50.6.1 27-Jun-2008  simonb Sync with head.
 1.50.4.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.50.2.2 11-Mar-2010  yamt sync with head
 1.50.2.1 04-May-2009  yamt sync with head.
 1.51.4.1 19-Jan-2009  skrll Sync with HEAD.
 1.51.2.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.56.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.57.24.1 18-May-2014  rmind sync with head
 1.57.20.2 03-Dec-2017  jdolecek update from HEAD
 1.57.20.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.57.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.58.6.2 28-Aug-2017  skrll Sync with HEAD
 1.58.6.1 06-Apr-2015  skrll Sync with HEAD
 1.60.2.1 20-Mar-2017  pgoyette Sync with HEAD
 1.61.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.62.4.1 11-May-2017  pgoyette Sync with HEAD
 1.67.4.1 10-Jun-2019  christos Sync with HEAD
 1.67.2.2 29-Sep-2018  pgoyette Regen
 1.67.2.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.74 03-Mar-2019  pgoyette Regen
 1.73 27-Jan-2019  pgoyette Merge the [pgoyette-compat] branch
 1.72 10-Aug-2018  pgoyette Regen
 1.71 06-Jan-2018  kamil branches: 1.71.2; 1.71.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.70 19-Dec-2017  kamil compat/ultrix: Drop SYS_vadvise

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

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

sbrk - change data segment size

This syscall is dummy since the inception of the project.

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

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

Sponsored by <The NetBSD Foundation>
 1.67 10-May-2017  riastradh regen
 1.66 16-Jan-2017  christos branches: 1.66.4;
regen
 1.65 13-Jan-2017  christos branches: 1.65.2;
regen
 1.64 24-Sep-2015  christos branches: 1.64.2;
regen
 1.63 07-Mar-2015  christos regen
 1.62 07-Nov-2013  njoly branches: 1.62.6;
Regen for dup/dup2/dup3 argument types fix.
 1.61 02-Mar-2010  pooka branches: 1.61.10; 1.61.20; 1.61.24;
regen:
- remove nfssvc / fs_nfs.h / #ifdef NFS
- make getfh unconditional
 1.60 14-Dec-2009  matt branches: 1.60.2;
Regen (new makesyscalls.sh)
 1.59 17-Jan-2009  he Regenerate files after updating syscalls.master for compat_ultrix:

Adapt to the state after the recent time_t change.
Type changes:
timeval -> timeval50
itimerval -> itimerval50
rusage -> rusage50
and use of the compat_50 calls where appropriate.
Untested, but at least it builds.

Discussed with christos@
 1.58 13-Jan-2009  pooka Regen to prove I didn't screw up the conversion: purely RCSID changes.
 1.57 13-Jan-2009  pooka regen
 1.56 19-Nov-2008  ad Regen.
 1.55 19-Jun-2008  hans branches: 1.55.2; 1.55.4;
regen from syscalls.master r1.46
 1.54 23-Apr-2008  ad branches: 1.54.2; 1.54.4; 1.54.6;
Regen.
 1.53 20-Dec-2007  dsl branches: 1.53.6; 1.53.8;
regen
 1.52 04-Mar-2007  christos branches: 1.52.16; 1.52.24; 1.52.28;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.51 09-Feb-2007  ad branches: 1.51.2;
Merge newlock2 to head.
 1.50 13-Jul-2006  pavel branches: 1.50.4;
regen (sys_getfh -> compat_30_sys_getfh)
 1.49 26-Jun-2006  mrg regenerate.
 1.48 11-Dec-2005  christos branches: 1.48.4; 1.48.8; 1.48.16;
merge ktrace-lwp.
 1.47 26-Feb-2005  perry branches: 1.47.4;
regen
 1.46 26-Feb-2005  perry regen
 1.45 18-Jan-2003  thorpej branches: 1.45.2; 1.45.10; 1.45.12;
Regen for correct RCS ID.
 1.44 18-Jan-2003  thorpej Regen: Merge the nathanw_sa branch.
 1.43 13-Nov-2001  lukem add RCSIDs (including regeneration of files as appropriate)
 1.42 30-May-2001  mrg branches: 1.42.2;
use _KERNEL_OPT.
 1.41 27-Jan-2001  thorpej branches: 1.41.2;
egen; getpid(2) is MP-safe.
 1.40 27-Jan-2001  thorpej Regen; add sy_flags.
 1.39 09-Dec-2000  mycroft Regen.
 1.38 13-Nov-2000  jdolecek change the type of *syscallnames[] array to 'const char * const foo[]'
 1.37 18-Aug-2000  cgd update for changed makesyscalls.master
 1.36 30-Jul-1999  drochner branches: 1.36.2;
regen
 1.35 12-Jul-1999  kleink Regen.
 1.34 09-Feb-1999  christos branches: 1.34.2; 1.34.4;
Regen
 1.33 18-Dec-1998  drochner regen
 1.32 10-Dec-1998  christos Regen
 1.31 03-Oct-1998  drochner regen
 1.30 26-Sep-1998  drochner regen
 1.29 25-Jun-1998  thorpej Regen: defopt NFSSERVER
 1.28 19-Feb-1998  thorpej Regen: makesyscalls.sh changed.
 1.27 19-Feb-1998  thorpej Regen; syscalls.master and makesyscalls.sh changed.
 1.26 14-Feb-1998  kleink Regen: use POSIX semantics for chown()/fchown().
 1.25 22-Jan-1998  mycroft Regen.
 1.24 09-Jan-1998  thorpej Regen.
 1.23 08-Jan-1998  thorpej Regen: back out RCD ID related changes.
 1.22 05-Jan-1998  perry regened with RCSIDs in place
 1.21 16-Oct-1997  christos Regen.
 1.20 13-Jun-1997  thorpej Regen: Use compat_12_sys_swapon().
 1.19 09-Jun-1997  jonathan Emulate RISC Ultrix cacheflush() and cachectl() syscalls on mips.
 1.18 06-Apr-1997  jonathan Add changes to make vic-2.8 Ultrix binaries work on NetBSD with COMPAT_ULTRIX:
* Add IPmulticast setsockopt emulation.
* Add Ultrix shmsys emulation (untested).
* tidy up use of stackgap.
 1.17 31-Jan-1997  thorpej Syscalls.master changed, regen. (NFSCLIENT -> NFS)
 1.16 03-Sep-1996  mycroft branches: 1.16.2;
Regen.
 1.15 23-Jun-1996  mycroft Regen.
 1.14 07-Jan-1996  jonathan branches: 1.14.4;
Add '/emul/ultrix' pathname processing to Ultrix emulation, and move
Ultrix syscalls that require that processing out of ultrix_misc.c
to ultrix_pathname.c.
 1.13 26-Dec-1995  jonathan Add emulation of ultrix mount(2). Sufficient to NFS-mount filesystems
using a NetBSD kernel in an ultrix root filesystem.

Move wait emulation to the old (v7) wait syscall number, as that's
what the Ultrix ufs_mount binary uses.
 1.12 26-Dec-1995  jonathan Add emulation of Ultrix select: before calling native sys_select(),
limit the number of FDs to select on to the maximum supported by NetBSD --
which is as many FDs as the emul_ultrix process can have open, anyway.

Add emulation of Ultrix getmnt(2) in ultrix_fs.c

Add partial emulation of Ultrix tty ioctl()s in ultrix_ioctl.c, derived
from compat/sunos/sunos_ioctl.c. Ultrix libc's ``isatty()'' now works
in compat_emul processes.
 1.11 07-Oct-1995  mycroft Reran makesyscalls.sh.
 1.10 19-Sep-1995  thorpej makesyscalls.sh changed
 1.9 01-Jun-1995  mellon Clear up name conflict between Ultrix syscall 103 and 139.
 1.8 22-Apr-1995  christos - added struct emul to all emulations.
- removed all setup functions.
- added copyargs() functions where needed.
 1.7 01-Dec-1994  dean added sigreturn
 1.6 23-Nov-1994  dean changes for new sysent structure (from J. Stone)
 1.5 01-Aug-1994  glass add ultrix_{get,set}sysinfo() from Arne H Juul <arnej@dsl.unit.no>
 1.4 30-Jun-1994  cgd branches: 1.4.2;
fix a botch, and gen syscall files
 1.3 22-Jun-1994  glass update to reflect compat_ultrix syscalls.master
 1.2 15-Jun-1994  glass much works but untested w/new fs. expect more tomorrow
 1.1 02-Jun-1994  glass first swipe at ultrix compat. expect many bug fixes. very related to compat/sunos
 1.4.2.1 01-Aug-1994  cgd From trunk.
 1.14.4.1 10-Dec-1996  mycroft Regen.
 1.16.2.1 14-Jan-1997  thorpej syscalls.master changed; regen.
 1.34.4.1 02-Aug-1999  thorpej Regen.
 1.34.2.1 31-Jan-2000  he Pull up regenerated files (requested by mhitch):
Emulate Ultrix fcntl(F_SETLK) & Co. so the Ultrix seti@home client
works.
 1.36.2.4 11-Feb-2001  bouyer Sync with HEAD.
 1.36.2.3 13-Dec-2000  bouyer Sync with HEAD (for UBC fixes).
 1.36.2.2 22-Nov-2000  bouyer Sync with HEAD.
 1.36.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.41.2.4 29-May-2002  nathanw Regen.
 1.41.2.3 06-Dec-2001  wdk Regen to incorperate LWP support
 1.41.2.2 14-Nov-2001  nathanw Catch up to -current.
 1.41.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.42.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.45.12.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.45.10.1 29-Apr-2005  kent sync with -current
 1.45.2.1 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.47.4.4 21-Jan-2008  yamt sync with head
 1.47.4.3 03-Sep-2007  yamt sync with head.
 1.47.4.2 26-Feb-2007  yamt sync with head.
 1.47.4.1 30-Dec-2006  yamt sync with head.
 1.48.16.1 13-Jul-2006  gdamore Merge from HEAD.
 1.48.8.1 11-Aug-2006  yamt sync with head
 1.48.4.1 09-Sep-2006  rpaulo sync with head
 1.50.4.1 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.51.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.52.28.1 02-Jan-2008  bouyer Sync with HEAD
 1.52.24.1 26-Dec-2007  ad Sync with head.
 1.52.16.1 09-Jan-2008  matt sync with HEAD
 1.53.8.1 18-May-2008  yamt sync with head.
 1.53.6.3 17-Jan-2009  mjf Sync with HEAD.
 1.53.6.2 29-Jun-2008  mjf Sync with HEAD.
 1.53.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.54.6.1 27-Jun-2008  simonb Sync with head.
 1.54.4.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.54.2.2 11-Mar-2010  yamt sync with head
 1.54.2.1 04-May-2009  yamt sync with head.
 1.55.4.1 19-Jan-2009  skrll Sync with HEAD.
 1.55.2.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.60.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.61.24.1 18-May-2014  rmind sync with head
 1.61.20.2 03-Dec-2017  jdolecek update from HEAD
 1.61.20.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.61.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.62.6.2 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.62.6.1 06-Apr-2015  skrll Sync with HEAD
 1.64.2.1 20-Mar-2017  pgoyette Sync with HEAD
 1.65.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.66.4.1 11-May-2017  pgoyette Sync with HEAD
 1.71.4.1 10-Jun-2019  christos Sync with HEAD
 1.71.2.2 29-Sep-2018  pgoyette Regen
 1.71.2.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.77 03-Mar-2019  pgoyette Regen
 1.76 27-Jan-2019  pgoyette Merge the [pgoyette-compat] branch
 1.75 10-Aug-2018  pgoyette Regen
 1.74 06-Jan-2018  kamil branches: 1.74.2; 1.74.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.73 19-Dec-2017  kamil compat/ultrix: Drop SYS_vadvise

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

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

sbrk - change data segment size

This syscall is dummy since the inception of the project.

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

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

Sponsored by <The NetBSD Foundation>
 1.70 10-May-2017  riastradh regen
 1.69 16-Jan-2017  christos branches: 1.69.4;
regen
 1.68 13-Jan-2017  christos branches: 1.68.2;
regen
 1.67 24-Sep-2015  christos branches: 1.67.2;
regen
 1.66 07-Mar-2015  christos regen
 1.65 07-Nov-2013  njoly branches: 1.65.6;
Regen for dup/dup2/dup3 argument types fix.
 1.64 02-Mar-2010  pooka branches: 1.64.10; 1.64.20; 1.64.24;
regen:
- remove nfssvc / fs_nfs.h / #ifdef NFS
- make getfh unconditional
 1.63 14-Dec-2009  matt branches: 1.63.2;
Regen (new makesyscalls.sh)
 1.62 17-Jan-2009  he Regenerate files after updating syscalls.master for compat_ultrix:

Adapt to the state after the recent time_t change.
Type changes:
timeval -> timeval50
itimerval -> itimerval50
rusage -> rusage50
and use of the compat_50 calls where appropriate.
Untested, but at least it builds.

Discussed with christos@
 1.61 13-Jan-2009  pooka Regen to prove I didn't screw up the conversion: purely RCSID changes.
 1.60 13-Jan-2009  pooka regen
 1.59 19-Nov-2008  ad Regen.
 1.58 19-Jun-2008  hans branches: 1.58.2; 1.58.4;
regen from syscalls.master r1.46
 1.57 23-Apr-2008  ad branches: 1.57.2; 1.57.4; 1.57.6;
Regen.
 1.56 20-Dec-2007  dsl branches: 1.56.6; 1.56.8;
regen
 1.55 04-Mar-2007  christos branches: 1.55.16; 1.55.24; 1.55.28;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.54 09-Feb-2007  ad branches: 1.54.2;
Merge newlock2 to head.
 1.53 13-Jul-2006  pavel branches: 1.53.4;
regen (sys_getfh -> compat_30_sys_getfh)
 1.52 26-Jun-2006  mrg regenerate.
 1.51 11-Dec-2005  christos branches: 1.51.4; 1.51.8; 1.51.16;
merge ktrace-lwp.
 1.50 26-Feb-2005  perry branches: 1.50.4;
regen
 1.49 26-Feb-2005  perry regen
 1.48 21-Apr-2004  simonb branches: 1.48.4; 1.48.6;
ANSIfy, some KNF.
 1.47 18-Jan-2003  thorpej branches: 1.47.2;
Regen for correct RCS ID.
 1.46 18-Jan-2003  thorpej Regen: Merge the nathanw_sa branch.
 1.45 01-Nov-2002  jdolecek set nsysent to 512 (oh well, just three syscalls too many for 256)
 1.44 13-Nov-2001  lukem add RCSIDs (including regeneration of files as appropriate)
 1.43 30-May-2001  mrg branches: 1.43.2;
use _KERNEL_OPT.
 1.42 27-Jan-2001  thorpej branches: 1.42.2;
egen; getpid(2) is MP-safe.
 1.41 27-Jan-2001  thorpej Regen; add sy_flags.
 1.40 09-Dec-2000  mycroft Regen.
 1.39 30-Nov-2000  jdolecek LKMify
 1.38 18-Aug-2000  cgd update for changed makesyscalls.master
 1.37 30-Jul-1999  drochner branches: 1.37.2;
regen
 1.36 12-Jul-1999  kleink Regen.
 1.35 09-Feb-1999  christos branches: 1.35.2; 1.35.4;
Regen
 1.34 18-Dec-1998  drochner regen
 1.33 10-Dec-1998  christos Regen
 1.32 03-Oct-1998  drochner regen
 1.31 26-Sep-1998  drochner regen
 1.30 25-Jun-1998  thorpej Regen: defopt NFSSERVER
 1.29 19-Feb-1998  thorpej Regen: makesyscalls.sh changed.
 1.28 19-Feb-1998  thorpej Regen; syscalls.master and makesyscalls.sh changed.
 1.27 14-Feb-1998  kleink Regen: use POSIX semantics for chown()/fchown().
 1.26 22-Jan-1998  mycroft Regen.
 1.25 09-Jan-1998  thorpej Regen.
 1.24 08-Jan-1998  thorpej Regen: back out RCD ID related changes.
 1.23 05-Jan-1998  perry regened with RCSIDs in place
 1.22 16-Oct-1997  christos Regen.
 1.21 13-Jun-1997  thorpej Regen: Use compat_12_sys_swapon().
 1.20 09-Jun-1997  jonathan Emulate RISC Ultrix cacheflush() and cachectl() syscalls on mips.
 1.19 06-Apr-1997  jonathan Add changes to make vic-2.8 Ultrix binaries work on NetBSD with COMPAT_ULTRIX:
* Add IPmulticast setsockopt emulation.
* Add Ultrix shmsys emulation (untested).
* tidy up use of stackgap.
 1.18 31-Jan-1997  thorpej branches: 1.18.2;
Syscalls.master changed, regen. (NFSCLIENT -> NFS)
 1.17 03-Sep-1996  mycroft branches: 1.17.2;
Regen.
 1.16 23-Jun-1996  mycroft Regen.
 1.15 07-Jan-1996  jonathan branches: 1.15.4;
Add '/emul/ultrix' pathname processing to Ultrix emulation, and move
Ultrix syscalls that require that processing out of ultrix_misc.c
to ultrix_pathname.c.
 1.14 26-Dec-1995  jonathan Add emulation of ultrix mount(2). Sufficient to NFS-mount filesystems
using a NetBSD kernel in an ultrix root filesystem.

Move wait emulation to the old (v7) wait syscall number, as that's
what the Ultrix ufs_mount binary uses.
 1.13 26-Dec-1995  jonathan Add emulation of Ultrix select: before calling native sys_select(),
limit the number of FDs to select on to the maximum supported by NetBSD --
which is as many FDs as the emul_ultrix process can have open, anyway.

Add emulation of Ultrix getmnt(2) in ultrix_fs.c

Add partial emulation of Ultrix tty ioctl()s in ultrix_ioctl.c, derived
from compat/sunos/sunos_ioctl.c. Ultrix libc's ``isatty()'' now works
in compat_emul processes.
 1.12 07-Oct-1995  mycroft Reran makesyscalls.sh.
 1.11 19-Sep-1995  thorpej makesyscalls.sh changed
 1.10 01-Jun-1995  mellon Clear up name conflict between Ultrix syscall 103 and 139.
 1.9 22-Apr-1995  christos - added struct emul to all emulations.
- removed all setup functions.
- added copyargs() functions where needed.
 1.8 02-Dec-1994  dean fixed typo
 1.7 01-Dec-1994  dean added sigreturn
 1.6 23-Nov-1994  dean changes for new sysent structure (from J. Stone)
 1.5 01-Aug-1994  glass add ultrix_{get,set}sysinfo() from Arne H Juul <arnej@dsl.unit.no>
 1.4 30-Jun-1994  cgd branches: 1.4.2;
fix a botch, and gen syscall files
 1.3 22-Jun-1994  glass update to reflect compat_ultrix syscalls.master
 1.2 15-Jun-1994  glass much works but untested w/new fs. expect more tomorrow
 1.1 02-Jun-1994  glass first swipe at ultrix compat. expect many bug fixes. very related to compat/sunos
 1.4.2.1 01-Aug-1994  cgd From trunk.
 1.15.4.1 10-Dec-1996  mycroft Regen.
 1.17.2.1 14-Jan-1997  thorpej syscalls.master changed; regen.
 1.18.2.1 14-Feb-1997  mrg regen.
 1.35.4.1 02-Aug-1999  thorpej Regen.
 1.35.2.1 31-Jan-2000  he Pull up regenerated files (requested by mhitch):
Emulate Ultrix fcntl(F_SETLK) & Co. so the Ultrix seti@home client
works.
 1.37.2.4 11-Feb-2001  bouyer Sync with HEAD.
 1.37.2.3 13-Dec-2000  bouyer Sync with HEAD (for UBC fixes).
 1.37.2.2 08-Dec-2000  bouyer Sync with HEAD.
 1.37.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.42.2.5 11-Nov-2002  nathanw Catch up to -current
 1.42.2.4 29-May-2002  nathanw Regen.
 1.42.2.3 06-Dec-2001  wdk Regen to incorperate LWP support
 1.42.2.2 14-Nov-2001  nathanw Catch up to -current.
 1.42.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.43.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.47.2.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 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.48.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.48.4.1 29-Apr-2005  kent sync with -current
 1.50.4.4 21-Jan-2008  yamt sync with head
 1.50.4.3 03-Sep-2007  yamt sync with head.
 1.50.4.2 26-Feb-2007  yamt sync with head.
 1.50.4.1 30-Dec-2006  yamt sync with head.
 1.51.16.1 13-Jul-2006  gdamore Merge from HEAD.
 1.51.8.1 11-Aug-2006  yamt sync with head
 1.51.4.1 09-Sep-2006  rpaulo sync with head
 1.53.4.1 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.54.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.55.28.1 02-Jan-2008  bouyer Sync with HEAD
 1.55.24.1 26-Dec-2007  ad Sync with head.
 1.55.16.1 09-Jan-2008  matt sync with HEAD
 1.56.8.1 18-May-2008  yamt sync with head.
 1.56.6.3 17-Jan-2009  mjf Sync with HEAD.
 1.56.6.2 29-Jun-2008  mjf Sync with HEAD.
 1.56.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.57.6.1 27-Jun-2008  simonb Sync with head.
 1.57.4.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.57.2.2 11-Mar-2010  yamt sync with head
 1.57.2.1 04-May-2009  yamt sync with head.
 1.58.4.1 19-Jan-2009  skrll Sync with HEAD.
 1.58.2.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.63.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.64.24.1 18-May-2014  rmind sync with head
 1.64.20.2 03-Dec-2017  jdolecek update from HEAD
 1.64.20.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.64.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.65.6.2 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.65.6.1 06-Apr-2015  skrll Sync with HEAD
 1.67.2.1 20-Mar-2017  pgoyette Sync with HEAD
 1.68.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.69.4.1 11-May-2017  pgoyette Sync with HEAD
 1.74.4.1 10-Jun-2019  christos Sync with HEAD
 1.74.2.2 29-Sep-2018  pgoyette Regen
 1.74.2.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.4 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.3 14-Dec-2009  matt branches: 1.3.22; 1.3.40;
Merge from matt-nb5-mips64
 1.2 04-Jan-1996  jonathan branches: 1.2.166; 1.2.186;
Rewrite (a copy of) the emul-sunos termio/termios emulation code to
emulate Ultrix termio/termios instead. Ultrix termio c_cc has separate
VMIM/VTIME attributes, and the Ultrix termios c_cc is a strict
superset of Ultrix termio c_cc. The termios-only c_cc indices are
all changed, relative to SunOS.
 1.1 27-Dec-1995  jonathan Ultrix-compatible termios struct and ioctl() definitions.
 1.2.186.1 09-Sep-2009  matt Change to use fixed sized types.
 1.2.166.1 11-Mar-2010  yamt sync with head
 1.3.40.1 22-Sep-2015  skrll Sync with HEAD
 1.3.22.1 03-Dec-2017  jdolecek update from HEAD
 1.6 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.5 09-Feb-1999  christos branches: 1.5.8;
const poisoning and CHECK_ALT_CREAT fixes.
 1.4 05-Sep-1998  christos Assign copyright to TNF.
 1.3 10-Oct-1997  mrg remove advertising clause from all my licenses.
 1.2 05-Oct-1996  mrg branches: 1.2.10;
minor copyright update.
 1.1 07-Jan-1996  jonathan Add '/emul/ultrix' pathname processing to Ultrix emulation, and move
Ultrix syscalls that require that processing out of ultrix_misc.c
to ultrix_pathname.c.
 1.2.10.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.5.8.1 08-Dec-2000  bouyer Sync with HEAD.

RSS XML Feed