Home | History | Annotate | only in /src/sys/compat/linux32/arch/amd64
History log of /src/sys/compat/linux32/arch/amd64
RevisionDateAuthorComments
 1.2 04-May-2014  njoly Remove now unneeded bsd.kinc.mk.
 1.1 09-Feb-2006  manu branches: 1.1.2; 1.1.10; 1.1.16; 1.1.22; 1.1.112; 1.1.122; 1.1.128; 1.1.138;
Add initial (but unfinished) COMPAT_LINUX32 for amd64. This is good enough so
that the i386 license manager part of amd64 version of Fluent works.

While I'm here, add SysV IPC to COMPAT_LINUX/amd64
 1.1.138.1 10-Aug-2014  tls Rebase.
 1.1.128.1 18-May-2014  rmind sync with head
 1.1.122.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.112.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.1.22.2 09-Sep-2006  rpaulo sync with head
 1.1.22.1 09-Feb-2006  rpaulo file Makefile was added on branch rpaulo-netinet-merge-pcb on 2006-09-09 02:45:52 +0000
 1.1.16.2 21-Jun-2006  yamt sync with head.
 1.1.16.1 09-Feb-2006  yamt file Makefile was added on branch yamt-lazymbuf on 2006-06-21 14:59:27 +0000
 1.1.10.2 22-Apr-2006  simonb Sync with head.
 1.1.10.1 09-Feb-2006  simonb file Makefile was added on branch simonb-timecounters on 2006-04-22 11:38:14 +0000
 1.1.2.2 18-Feb-2006  yamt sync with head.
 1.1.2.1 09-Feb-2006  yamt file Makefile was added on branch yamt-uio_vmspace on 2006-02-18 15:38:59 +0000
 1.3 20-May-2008  njoly Add compat linux32 ipc(2) syscall support, for shared memory and
semaphores.
 1.2 15-Jan-2008  njoly branches: 1.2.6; 1.2.8; 1.2.10; 1.2.12;
compat linux (and linux32) uid16 functions cleanup and fixes.

- Move uid16 functions to their own file linux_uid16.c, included by
needed archs (arm, i386 and m68k).
- Add new MI types linux_{u,g}id16_t.
- Add macros to handle linux_uid16_t and uid_t conversions.
- Add linux_sys_getres{uid,gid}16 syscalls, to fix an overflow with
bad sizes given to copyout when linux_sys_getres{uid,gid} are used.
- Update arm syscall table to use more uid16 functions.
 1.1 09-Feb-2006  manu branches: 1.1.2; 1.1.10; 1.1.16; 1.1.22; 1.1.48; 1.1.54; 1.1.62;
Add initial (but unfinished) COMPAT_LINUX32 for amd64. This is good enough so
that the i386 license manager part of amd64 version of Fluent works.

While I'm here, add SysV IPC to COMPAT_LINUX/amd64
 1.1.62.1 19-Jan-2008  bouyer Sync with HEAD
 1.1.54.1 18-Feb-2008  mjf Sync with HEAD.
 1.1.48.1 23-Mar-2008  matt sync with HEAD
 1.1.22.2 09-Sep-2006  rpaulo sync with head
 1.1.22.1 09-Feb-2006  rpaulo file files.linux32_amd64 was added on branch rpaulo-netinet-merge-pcb on 2006-09-09 02:45:52 +0000
 1.1.16.3 21-Jan-2008  yamt sync with head
 1.1.16.2 21-Jun-2006  yamt sync with head.
 1.1.16.1 09-Feb-2006  yamt file files.linux32_amd64 was added on branch yamt-lazymbuf on 2006-06-21 14:59:27 +0000
 1.1.10.2 22-Apr-2006  simonb Sync with head.
 1.1.10.1 09-Feb-2006  simonb file files.linux32_amd64 was added on branch simonb-timecounters on 2006-04-22 11:38:14 +0000
 1.1.2.2 18-Feb-2006  yamt sync with head.
 1.1.2.1 09-Feb-2006  yamt file files.linux32_amd64 was added on branch yamt-uio_vmspace on 2006-02-18 15:38:59 +0000
 1.2.12.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.2.10.1 04-May-2009  yamt sync with head.
 1.2.8.1 04-Jun-2008  yamt sync with head
 1.2.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.1 09-Feb-2006  manu branches: 1.1.2; 1.1.10; 1.1.16; 1.1.22;
Add initial (but unfinished) COMPAT_LINUX32 for amd64. This is good enough so
that the i386 license manager part of amd64 version of Fluent works.

While I'm here, add SysV IPC to COMPAT_LINUX/amd64
 1.1.22.2 09-Sep-2006  rpaulo sync with head
 1.1.22.1 09-Feb-2006  rpaulo file linux32_errno.h was added on branch rpaulo-netinet-merge-pcb on 2006-09-09 02:45:52 +0000
 1.1.16.2 21-Jun-2006  yamt sync with head.
 1.1.16.1 09-Feb-2006  yamt file linux32_errno.h was added on branch yamt-lazymbuf on 2006-06-21 14:59:27 +0000
 1.1.10.2 22-Apr-2006  simonb Sync with head.
 1.1.10.1 09-Feb-2006  simonb file linux32_errno.h was added on branch simonb-timecounters on 2006-04-22 11:38:14 +0000
 1.1.2.2 18-Feb-2006  yamt sync with head.
 1.1.2.1 09-Feb-2006  yamt file linux32_errno.h was added on branch yamt-uio_vmspace on 2006-02-18 15:38:59 +0000
 1.10 26-Nov-2021  ryo - LINUX_GO_RT0_SIGNATURE for compat_linux is no longer enabled by default.
it is now defined in each arch same as the other *_SIGNATURE definitions.
- add new LINUX32_GO_RT0_SIGNATURE for compat_linux32, and is defined in amd64 and aarch64.
 1.9 25-Nov-2021  ryo Extra arguments for AT_HWCAP and AT_PLATFORM are now passed when executing linux32 binaries.

AT_SYSINFO (vsyscall) feature seems to be broken, so leave it commented out.
 1.8 25-Nov-2021  ryo The default name of the `exec_setup_stack' function for linux32 should be `linux32_exec_setup_stack',
and it should be defined in each arch.
declaration of linux32_exec_setup_stack() in linux32/amd64 has been removed because it does not exist.

NFC.
 1.7 26-Apr-2017  christos catch up with unit fixes for es_arglen; consistently use bytes.
 1.6 21-Feb-2014  maxv branches: 1.6.6; 1.6.20;
Increase LINUX32_ELF_AUX_ENTRIES to avoid overrun in linux32/. Also,
add comments and KASSERTs to make sure people don't forget to increase
XX_AUX_ENTRIES's when adding vectors.

Reported by martin@ (CV), with suggestions from chs@.

ok martin@ chs@
 1.5 09-Feb-2014  chs account for the 16 bytes of AT_RANDOM data in the stack setup. fixes PR 48518.
use cprng_strong32() instead of random(). add AT_RANDOM support for linux32.
 1.4 07-Jul-2010  chs branches: 1.4.8; 1.4.18; 1.4.22;
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.3 18-Apr-2010  jym This patch fixes the NX regression issue observed on amd64 kernels, where
per-page execution right was disabled (therefore leading to the inability
of the kernel to detect fraudulent use of memory mappings marked as not
being executable).

- replace cpu_feature and ci_feature_flags variables by cpu_feature and
ci_feat_val arrays. This makes it cleaner and brings kernel code closer
to the design of cpuctl(8). A warning will be raised for each CPU that
does not expose the same features as the Boot Processor (BP).

- the blacklist of CPU features is now a macro defined in the
specialreg.h header, instead of hardcoding it inside MD initialization
code; fix comments.

- replace checks against CPUID_TSC with the cpu_hascounter() function.

- clean up the code in init_x86_64(), as cpu_feature variables are set
inside cpu_probe().

- use cpu_init_msrs() for i386. It will be eventually used later for NX
feature under i386 PAE kernels.

- remove code that checks for CPUID_NOX in amd64 mptramp.S, this is already
performed by cpu_hatch() through cpu_init_msrs().

- remove cpu_signature and feature_flags members from struct mpbios_proc
(they were never used).

This patch was tested with i386 MONOLITHIC, XEN3PAE_DOM0 and XEN3_DOM0 under
a native i386 host, and amd64 GENERIC, XEN3_DOM0 via QEMU virtual machines.

XXX Should kernel rev be bumped?

XXX A similar patch should be pulled-up for NetBSD-5, hopefully tomorrow.
 1.2 07-Aug-2006  manu branches: 1.2.6; 1.2.60; 1.2.82; 1.2.84;
Add a new signature test for linux probe function. We look for a .debuglink
section, which is specific to the Linux dynamic interpeter (yes, Linux
can execute it as a stand alone program)
 1.1 09-Feb-2006  manu branches: 1.1.2; 1.1.4; 1.1.10; 1.1.16;
Add initial (but unfinished) COMPAT_LINUX32 for amd64. This is good enough so
that the i386 license manager part of amd64 version of Fluent works.

While I'm here, add SysV IPC to COMPAT_LINUX/amd64
 1.1.16.3 30-Dec-2006  yamt sync with head.
 1.1.16.2 21-Jun-2006  yamt sync with head.
 1.1.16.1 09-Feb-2006  yamt file linux32_exec.h was added on branch yamt-lazymbuf on 2006-06-21 14:59:27 +0000
 1.1.10.2 22-Apr-2006  simonb Sync with head.
 1.1.10.1 09-Feb-2006  simonb file linux32_exec.h was added on branch simonb-timecounters on 2006-04-22 11:38:14 +0000
 1.1.4.1 11-Aug-2006  yamt sync with head
 1.1.2.2 18-Feb-2006  yamt sync with head.
 1.1.2.1 09-Feb-2006  yamt file linux32_exec.h was added on branch yamt-uio_vmspace on 2006-02-18 15:38:59 +0000
 1.2.84.2 05-Mar-2011  rmind sync with head
 1.2.84.1 30-May-2010  rmind sync with head
 1.2.82.2 17-Aug-2010  uebayasi Sync with HEAD.
 1.2.82.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.2.60.1 11-Aug-2010  yamt sync with head.
 1.2.6.2 09-Sep-2006  rpaulo sync with head
 1.2.6.1 07-Aug-2006  rpaulo file linux32_exec.h was added on branch rpaulo-netinet-merge-pcb on 2006-09-09 02:45:52 +0000
 1.4.22.1 18-May-2014  rmind sync with head
 1.4.18.2 03-Dec-2017  jdolecek update from HEAD
 1.4.18.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.4.8.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.6.20.1 02-May-2017  pgoyette Sync with HEAD - tag prg-localcount2-base1
 1.6.6.1 28-Aug-2017  skrll Sync with HEAD
 1.1 25-Nov-2021  ryo - Use LINUX32_F_xxx instead of LINUX_F_xxx for compat_linux32.
aarch64 and arm have different values.
- Compile linux32_sys_fadvise64() only if the syscall is required.
 1.1 15-Feb-2006  manu branches: 1.1.2; 1.1.10; 1.1.16; 1.1.22;
- Move the BSD to Linux and Linux to BSD termio/termios conversion functions
to a header where they can be shared between COMPAT_LINUX and COMPAT_LINUX32
- Add termios ioctl emulation to COMPAT_LINUX32
- Add the getcwd system call to COMPAT_LINUX32/amd64

That makes Linux's bash working with COMPAT_LINUX32.
 1.1.22.2 09-Sep-2006  rpaulo sync with head
 1.1.22.1 15-Feb-2006  rpaulo file linux32_ioctl.h was added on branch rpaulo-netinet-merge-pcb on 2006-09-09 02:45:52 +0000
 1.1.16.2 21-Jun-2006  yamt sync with head.
 1.1.16.1 15-Feb-2006  yamt file linux32_ioctl.h was added on branch yamt-lazymbuf on 2006-06-21 14:59:27 +0000
 1.1.10.2 22-Apr-2006  simonb Sync with head.
 1.1.10.1 15-Feb-2006  simonb file linux32_ioctl.h was added on branch simonb-timecounters on 2006-04-22 11:38:14 +0000
 1.1.2.2 18-Feb-2006  yamt sync with head.
 1.1.2.1 15-Feb-2006  yamt file linux32_ioctl.h was added on branch yamt-uio_vmspace on 2006-02-18 15:38:59 +0000
 1.48 20-Jun-2023  riastradh linux32_rt_sendsig: Memset zero before copyout.

Not sure if there's any padding here, but it's a pretty big
structure, fairly likely, so let's be rather safe than sorry.

XXX pullup-8
XXX pullup-9
XXX pullup-10
 1.47 01-Nov-2021  thorpej branches: 1.47.4;
Use "stack_t" instead of "struct sigaltstack", as the former is the
newer standardized name. NFC.
 1.46 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.45 19-May-2019  maxv branches: 1.45.2;
Rename

fpu_save_area_clear -> fpu_clear
fpu_save_area_reset -> fpu_sigreset

Clearer, and reduces a future diff. No real functional change.
 1.44 24-Mar-2019  maxv Disable preemption when setting PCB_COMPAT32, to prevent a context switch
before cpu_fsgs_reload() finishes, otherwise we write garbage in the GDT.
On NetBSD-current it is harmless, however in NetBSD-8 it might cause
panics, because NetBSD-8 uses the old SegRegs model and under this model
we reload %fs and %gs during switches.
 1.43 21-Oct-2017  maxv branches: 1.43.4;
Include opt_user_ldt.h when needed.
 1.42 19-Oct-2017  maxv Always mask the 16 bits of the segregs in the trapframe. We don't zero-
extend the uint64_t's when building it, so we're leaking 48 bits of kernel
stack to userland.

Having said that, it appears that I unintentionally fixed most of this
issue in locore.S::rev1.127 - by building the frame with interrupts
disabled, we are implicitly guaranteeing that the structure doesn't get
overwritten by the kernel. Which means, we are leaking to userland data
that comes from userland anyway.

(still other places with this issue, but I'll fix them differently)
 1.41 15-Oct-2017  maxv Use two separate functions: cpu_segregs32_zero and cpu_segregs64_zero. The
way segment registers work on amd64 will diverge between 32bit and 64bit
LWPs.
 1.40 15-Oct-2017  maxv Make sure the 32bit LWPs don't have MDL_IRET set. That's not a problem
right now, but will be in the future.
 1.39 02-Sep-2017  maxv Fix a subtle ring0 escalation vulnerability in amd64, and implement a
mitigation against similar bugs.

The operations on segment registers can generate a page fault if there is
an issue when touching the in-memory gdt. Theoretically, it is never
supposed to happen, since the gdt is mapped correctly. However, in the
kernel we allow the gdt to be resized, and to do that, we allocate the
maximum amount of va needed by it, but only kenter a few pages until we
need more. Moreover, to avoid reloading the gdt each time we grow it, the
'size' field of gdtr is set to the maximum value. All of this means that
if a mov or iretq is done with a segment register whose index hits a page
that has not been kentered, a page fault is sent.

Such a page fault, if received in kernel mode, does not trigger a swapgs
on amd64; in other words, the kernel would be re-entered with the userland
tls.

And there just happens to be a place in compat_linux32 where the index of
%cs is controlled by userland, making it easy to trigger the page fault
and get kernel privileges.

The mitigation simply consists in abandoning the gdt_grow mechanism and
allocating/kentering the maximum size right away, in such a way that no
page fault can be triggered because of segment registers.
 1.38 05-Feb-2017  maxv branches: 1.38.6;
Remove #if 0 on USER_LDT.
 1.37 02-Sep-2016  maxv branches: 1.37.2;
Fix argument (does not compile anyway).
 1.36 19-Feb-2014  dsl branches: 1.36.4; 1.36.6; 1.36.8; 1.36.10; 1.36.14;
Explicitly include x86/fpu.h instead of relying in x86/frame.h including it.
 1.35 15-Feb-2014  dsl Remove all references to MDL_USEDFPU and deferred fpu initialisation.
The cost of zeroing the save area on exec is minimal.
This stops the FP registers of a random process being used the first
time an lwp uses the fpu.
sendsig_siginfo() and get_mcontext() now unconditionally copy the FP
registers.
I'll remove the double-copy for signal handlers soon.
get_mcontext() might have been leaking kernel memory to userspace - and
may still do so if i386_use_fxsave is false (short copies).
 1.34 07-Feb-2014  dsl Convert the amd64 build to use x86/cpu_extended_state.h so that the fpu
definitions match those of i386.
Mostly just structure and field renames, in addition:
1) process_xmm_to_s87() and process_s87_to_xmm() moved into
x86/convert_xmm_s87.c so they can be used by amd64's netbsd32 code.
2) The linux signal code simplified to use a structure copy for ths fxsave
data - it matches the hardware definition and won't change.
 1.33 01-Dec-2013  christos revert fpu/pcu changes until we figure out what's wrong; they cause random
freezes
 1.32 23-Oct-2013  drochner Use the MI "pcu" framework for bookkeeping of npx/fpu states on x86.
This reduces the amount of MD code enormously, and makes it easier
to implement support for newer CPU features which require more fpu
state, or for fpu usage by the kernel.
For access to FPU state across CPUs, an xcall kthread is used now
rather than a dedicated IPI.
No user visible changes intended.
 1.31 15-Jul-2012  dsl branches: 1.31.2; 1.31.4;
Rename MDP_IRET to MDL_IRET since it is an lwp flag, not a proc one.
Add an MDL_COMPAT32 flag to the lwp's md_flags, set it for 32bit lwps
and use it to force 'return to user' with iret (as is done when
MDL_IRET is set).
Split the iret/sysret code paths much later.
Remove all the replicated code for 32bit system calls - which was only
needed so that iret was always used.
frameasm.h for XEN contains '#define swapgs', while XEN probable never
needs swapgs, this is likely to be confusing.
Add a SWAPGS which is a nop on XEN and swapgs otherwise.
(I've not yet checked all the swapgs in files that include frameasm.h)
Simple x86 programs still work.
Hijack 6.99.9 kernel bump (needed for compat32 modules)
 1.30 08-Jul-2012  dsl The MDP_USEDFPU (amd64 and sh3) and MDP_SSTEP (sh3) are lwp flags not
process ones, rename to MDL_xxx.
 1.29 04-Mar-2011  joerg branches: 1.29.4; 1.29.10; 1.29.14; 1.29.16;
Refactor ps_strings access. Based on PK_32, write either the normal
version or the 32bit compat layout in execve1. Introduce a new function
copyin_psstrings for reading it back from userland and converting it to
the native layout. Refactor procfs to share most of the code with the
kern.proc_args sysctl handler.

This material is based upon work partially supported by
The NetBSD Foundation under a contract with Joerg Sonnenberger.
 1.28 07-Feb-2011  chs move macros for validating fs/gs to segments.h and use them
in the linux32 code as well.
 1.27 02-Nov-2010  chs branches: 1.27.2; 1.27.4;
implement the following syscalls for linux32:
truncate64
ftruncate64
profil
ioperm
iopl
setdomainname
modify_ldt
statfs64
fstatfs64

note that iopl(), ioperm() and modify_ldt() just call
the respective 64-bit handlers, which don't do anything yet.
 1.26 12-Jul-2010  christos fix debugging build.
 1.25 07-Jul-2010  jmmv Add missing includes to bring the linux_semun type needed by
linux_syscallargs.h.
 1.24 07-Jul-2010  chs 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.23 23-Nov-2009  rmind branches: 1.23.2; 1.23.4;
Use lwp_getpcb() in compat code, clean from struct user.
 1.22 29-May-2009  njoly Add native to linux siginfo si_status translation, used on i386 and
amd64.
 1.21 15-Mar-2009  cegger ansify function definitions
 1.20 19-Oct-2008  njoly branches: 1.20.2; 1.20.8;
Add native to linux siginfo si_code translation, mostly for negative
values. Adjust amd64 and i386 accordingly, not sure about aother archs
i can't test.
 1.19 09-Oct-2008  njoly Fix linux32 siginfo si_signo value. Do not convert ksi_signo twice.
 1.18 18-Sep-2008  christos Define a PSL_CLEARSIG macro for the psl flags to be cleared on signal delivery
and use it everywhere.
 1.17 24-Apr-2008  ad branches: 1.17.2; 1.17.4; 1.17.8;
Merge proc::p_mutex and proc::p_smutex into a single adaptive mutex, since
we no longer need to guard against access from hardware interrupt handlers.

Additionally, if cloning a process with CLONE_SIGHAND, arrange to have the
child process share the parent's lock so that signal state may be kept in
sync. Partially addresses PR kern/37437.
 1.16 20-Dec-2007  dsl branches: 1.16.6; 1.16.8;
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.15 08-Dec-2007  dsl branches: 1.15.4;
ANSIfy most of the function definitions in sys/compat (but not ndis).
All by the magic of sed ...
 1.14 04-Dec-2007  dsl Remove all the __P
 1.13 24-Nov-2007  christos branches: 1.13.2;
- move the save context before the signal reset (Arto Huusko)
- set the sigcontext cr2
 1.12 19-Oct-2007  ad branches: 1.12.2;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.11 21-May-2007  christos branches: 1.11.6; 1.11.8; 1.11.12;
rename si_sigval -> si_value to match POSIX RTS.
 1.10 18-Mar-2007  dsl Change all the NETBSD32PTR64(SCARG(uap, xxx))) to SCARG_P32(uap, xxx).
 1.9 16-Mar-2007  dsl remove all the double (and triple) casts used to convert 32bit userspace
pointers to and from 64bit kernel pointers. Instead use the defines
NETBSD32PTR64(p32) to read a 32bit pointer and (the new) NETBSD32PTR32(p32,p64)
to write a 32bit pointer throughout.
The 32bit pointer is now a struct to enforce the above.
amd64 (with linux emul) and sparc64 will both compile (when the arch stuff
goes in soon), and amd64 still runs some i386 binaries.
 1.8 05-Mar-2007  christos branches: 1.8.2; 1.8.4; 1.8.6;
fix caddr_t lossage
 1.7 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.6 17-Feb-2007  pavel Change the process/lwp flags seen by userland via sysctl back to the
P_*/L_* naming convention, and rename the in-kernel flags to avoid
conflict. (P_ -> PK_, L_ -> LW_ ). Add back the (now unused) LSDEAD
constant.

Restores source compatibility with pre-newlock2 tools like ps or top.

Reviewed by Andrew Doran.
 1.5 15-Feb-2007  ad branches: 1.5.2;
Fix COMPAT_LINUX32.
 1.4 09-Feb-2007  ad Merge newlock2 to head.
 1.3 22-Nov-2006  christos adjust_limits takes p, not l again
 1.2 21-Nov-2006  christos From Nicolas Joly:

> It seems that 32bits programs, running under compat_netbsd32, using
> setrlimit force all other programs to have their maximum data size
> fixed at 3GB, where native 64bits apps used 8GB previously.

I tracked this one to the `netbsd32_adjust_limits()' function (called
when creating a new process under compat_netbsd32), where data and
stack limits are set without checking for shared `p_limit' structure
(p_limit->p_refcnt > 1). This explain the side effect where processes
have their limits changed when a compat_netbsd32 (or compat_linux32)
program is run.

The fix is to use `dosetrlimit()' to ensure the needed copy-on-write
behaviour for shared structure.
 1.1 09-Feb-2006  manu branches: 1.1.2; 1.1.10; 1.1.16; 1.1.20; 1.1.22; 1.1.24;
Add initial (but unfinished) COMPAT_LINUX32 for amd64. This is good enough so
that the i386 license manager part of amd64 version of Fluent works.

While I'm here, add SysV IPC to COMPAT_LINUX/amd64
 1.1.24.1 10-Dec-2006  yamt sync with head.
 1.1.22.2 09-Sep-2006  rpaulo sync with head
 1.1.22.1 09-Feb-2006  rpaulo file linux32_machdep.c was added on branch rpaulo-netinet-merge-pcb on 2006-09-09 02:45:52 +0000
 1.1.20.3 06-Feb-2007  ad More compat changes.

XXX compat_irix, compat_mach and compat_darwin need work.
 1.1.20.2 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.1.20.1 12-Jan-2007  ad Sync with head.
 1.1.16.8 21-Jan-2008  yamt sync with head
 1.1.16.7 07-Dec-2007  yamt sync with head
 1.1.16.6 27-Oct-2007  yamt sync with head.
 1.1.16.5 03-Sep-2007  yamt sync with head.
 1.1.16.4 26-Feb-2007  yamt sync with head.
 1.1.16.3 30-Dec-2006  yamt sync with head.
 1.1.16.2 21-Jun-2006  yamt sync with head.
 1.1.16.1 09-Feb-2006  yamt file linux32_machdep.c was added on branch yamt-lazymbuf on 2006-06-21 14:59:27 +0000
 1.1.10.2 22-Apr-2006  simonb Sync with head.
 1.1.10.1 09-Feb-2006  simonb file linux32_machdep.c was added on branch simonb-timecounters on 2006-04-22 11:38:14 +0000
 1.1.2.2 18-Feb-2006  yamt sync with head.
 1.1.2.1 09-Feb-2006  yamt file linux32_machdep.c was added on branch yamt-uio_vmspace on 2006-02-18 15:38:59 +0000
 1.5.2.3 24-Mar-2007  yamt sync with head.
 1.5.2.2 12-Mar-2007  rmind Sync with HEAD.
 1.5.2.1 27-Feb-2007  yamt - sync with head.
- move sched_changepri back to kern_synch.c as it doesn't know PPQ anymore.
 1.8.6.2 29-Mar-2007  reinoud Pullup to -current
 1.8.6.1 18-Mar-2007  reinoud First attempt to bring branch in sync with HEAD
 1.8.4.1 11-Jul-2007  mjf Sync with head.
 1.8.2.3 23-Oct-2007  ad Sync with head.
 1.8.2.2 27-May-2007  ad Sync with head.
 1.8.2.1 10-Apr-2007  ad Sync with head.
 1.11.12.1 25-Oct-2007  bouyer Sync with HEAD.
 1.11.8.2 09-Jan-2008  matt sync with HEAD
 1.11.8.1 06-Nov-2007  matt sync with HEAD
 1.11.6.3 09-Dec-2007  jmcneill Sync with HEAD.
 1.11.6.2 27-Nov-2007  joerg Sync with HEAD. amd64 Xen support needs testing.
 1.11.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.12.2.2 27-Dec-2007  mjf Sync with HEAD.
 1.12.2.1 08-Dec-2007  mjf Sync with HEAD.
 1.13.2.2 26-Dec-2007  ad Sync with head.
 1.13.2.1 08-Dec-2007  ad Sync with head.
 1.15.4.1 02-Jan-2008  bouyer Sync with HEAD
 1.16.8.1 18-May-2008  yamt sync with head.
 1.16.6.3 17-Jan-2009  mjf Sync with HEAD.
 1.16.6.2 28-Sep-2008  mjf Sync with HEAD.
 1.16.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.17.8.1 19-Oct-2008  haad Sync with HEAD.
 1.17.4.4 10-Oct-2008  skrll Sync with HEAD.
 1.17.4.3 24-Sep-2008  wrstuden Merge in changes between wrstuden-revivesa-base-2 and
wrstuden-revivesa-base-3.
 1.17.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.17.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.17.2.4 11-Aug-2010  yamt sync with head.
 1.17.2.3 11-Mar-2010  yamt sync with head
 1.17.2.2 20-Jun-2009  yamt sync with head
 1.17.2.1 04-May-2009  yamt sync with head.
 1.20.8.2 23-Jul-2009  jym Sync with HEAD.
 1.20.8.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.20.2.1 28-Apr-2009  skrll Sync with HEAD.
 1.23.4.1 05-Mar-2011  rmind sync with head
 1.23.2.2 06-Nov-2010  uebayasi Sync with HEAD.
 1.23.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.27.4.2 05-Mar-2011  bouyer Sync with HEAD
 1.27.4.1 08-Feb-2011  bouyer Sync with HEAD
 1.27.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.29.16.1 09-Sep-2017  snj Pull up following revision(s) (requested by maxv in ticket #1502):
sys/compat/linux32/arch/amd64/linux32_machdep.c: revision 1.39
Fix a ring0 escalation vulnerability in compat_linux32 where the
index of %cs is controlled by userland, making it easy to trigger
the page fault and get kernel privileges.
 1.29.14.1 09-Sep-2017  snj Pull up following revision(s) (requested by maxv in ticket #1502):
sys/compat/linux32/arch/amd64/linux32_machdep.c: revision 1.39
Fix a ring0 escalation vulnerability in compat_linux32 where the
index of %cs is controlled by userland, making it easy to trigger
the page fault and get kernel privileges.
 1.29.10.1 09-Sep-2017  snj Pull up following revision(s) (requested by maxv in ticket #1502):
sys/compat/linux32/arch/amd64/linux32_machdep.c: revision 1.39
Fix a ring0 escalation vulnerability in compat_linux32 where the
index of %cs is controlled by userland, making it easy to trigger
the page fault and get kernel privileges.
 1.29.4.2 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.29.4.1 30-Oct-2012  yamt sync with head
 1.31.4.1 18-May-2014  rmind sync with head
 1.31.2.2 03-Dec-2017  jdolecek update from HEAD
 1.31.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.36.14.1 09-Sep-2017  snj Pull up following revision(s) (requested by maxv in ticket #1507):
sys/compat/linux32/arch/amd64/linux32_machdep.c: revision 1.39
Fix a ring0 escalation vulnerability in compat_linux32 where the
index of %cs is controlled by userland, making it easy to trigger
the page fault and get kernel privileges.
 1.36.10.1 20-Mar-2017  pgoyette Sync with HEAD
 1.36.8.1 09-Sep-2017  snj Pull up following revision(s) (requested by maxv in ticket #1507):
sys/compat/linux32/arch/amd64/linux32_machdep.c: revision 1.39
Fix a ring0 escalation vulnerability in compat_linux32 where the
index of %cs is controlled by userland, making it easy to trigger
the page fault and get kernel privileges.
 1.36.6.2 28-Aug-2017  skrll Sync with HEAD
 1.36.6.1 05-Oct-2016  skrll Sync with HEAD
 1.36.4.1 09-Sep-2017  snj Pull up following revision(s) (requested by maxv in ticket #1507):
sys/compat/linux32/arch/amd64/linux32_machdep.c: revision 1.39
Fix a ring0 escalation vulnerability in compat_linux32 where the
index of %cs is controlled by userland, making it easy to trigger
the page fault and get kernel privileges.
 1.37.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.38.6.4 21-Jun-2023  martin Pull up following revision(s) (requested by riastradh in ticket #1841):

sys/compat/sunos32/sunos32_misc.c: revision 1.86
sys/compat/ossaudio/ossaudio.c: revision 1.85
sys/compat/linux32/arch/amd64/linux32_machdep.c: revision 1.48

compat_sunos32: Memset zero before copyout.

Unclear if this can leak anything but let's be on the safe side.

compat_ossaudio: Zero-initialize idat before copyout.
Unclear if there are any paths to the copyout without initialization,
but let's play it safe to keep the auditing effort low.

linux32_rt_sendsig: Memset zero before copyout.
Not sure if there's any padding here, but it's a pretty big
structure, fairly likely, so let's be rather safe than sorry.
 1.38.6.3 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.6.2 05-Apr-2019  martin Pull up following revision(s) (requested by maxv):

sys/arch/amd64/amd64/netbsd32_machdep.c: revision 1.120
sys/compat/linux/arch/amd64/linux_machdep.c: revision 1.57
sys/compat/linux32/arch/amd64/linux32_machdep.c: revision 1.44
sys/arch/amd64/amd64/machdep.c: revision 1.328
sys/arch/amd64/amd64/machdep.c: revision 1.329

Fix a tiny race in setregs and linux_setregs. Between the moment we set
pcb_flags to zero, and the moment cpu_segregs64_zero resets pcb_gs, we may
be preempted.

If this happens, and if the calling LWP was a 32bit thread, when switching
back to that LWP, the context switcher sees that PCB_COMPAT32 is not set in
pcb_flags and tries to perform a 64bit context switch; but pcb_gs contains
a 32bit GDT descriptor, and not a 64bit GS.base value. The wrmsr therefore
faults because the value is non-canonical, and this fault is fatal.

Rearrange the code so that the update of pcb_flags and pcb_gs/pcb_fs is non
interruptible. This fixes the problem, tested with a reproducer (which
therefore doesn't work anymore).

Likely fixes PR/53993.

Disable preemption when setting PCB_COMPAT32, to prevent a context switch
before cpu_fsgs_reload() finishes, otherwise we write garbage in the GDT.

On NetBSD-current it is harmless, however in NetBSD-8 it might cause
panics, because NetBSD-8 uses the old SegRegs model and under this model
we reload %fs and %gs during switches.
 1.38.6.1 09-Sep-2017  snj Pull up following revision(s) (requested by maxv in ticket #270):
sys/compat/linux32/arch/amd64/linux32_machdep.c: revision 1.39
Fix a ring0 escalation vulnerability in compat_linux32 where the
index of %cs is controlled by userland, making it easy to trigger
the page fault and get kernel privileges.
 1.43.4.1 10-Jun-2019  christos Sync with HEAD
 1.45.2.2 21-Jun-2023  martin Pull up following revision(s) (requested by riastradh in ticket #1650):

sys/compat/sunos32/sunos32_misc.c: revision 1.86
sys/compat/ossaudio/ossaudio.c: revision 1.85
sys/compat/linux32/arch/amd64/linux32_machdep.c: revision 1.48

compat_sunos32: Memset zero before copyout.

Unclear if this can leak anything but let's be on the safe side.

compat_ossaudio: Zero-initialize idat before copyout.
Unclear if there are any paths to the copyout without initialization,
but let's play it safe to keep the auditing effort low.

linux32_rt_sendsig: Memset zero before copyout.
Not sure if there's any padding here, but it's a pretty big
structure, fairly likely, so let's be rather safe than sorry.
 1.45.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.47.4.1 21-Jun-2023  martin Pull up following revision(s) (requested by riastradh in ticket #204):

sys/compat/sunos32/sunos32_misc.c: revision 1.86
sys/compat/ossaudio/ossaudio.c: revision 1.85
sys/compat/linux32/arch/amd64/linux32_machdep.c: revision 1.48

compat_sunos32: Memset zero before copyout.

Unclear if this can leak anything but let's be on the safe side.

compat_ossaudio: Zero-initialize idat before copyout.
Unclear if there are any paths to the copyout without initialization,
but let's play it safe to keep the auditing effort low.

linux32_rt_sendsig: Memset zero before copyout.
Not sure if there's any padding here, but it's a pretty big
structure, fairly likely, so let's be rather safe than sorry.
 1.2 04-Dec-2007  dsl Remove all the __P
 1.1 09-Feb-2006  manu branches: 1.1.2; 1.1.10; 1.1.16; 1.1.22; 1.1.46; 1.1.48; 1.1.54; 1.1.58;
Add initial (but unfinished) COMPAT_LINUX32 for amd64. This is good enough so
that the i386 license manager part of amd64 version of Fluent works.

While I'm here, add SysV IPC to COMPAT_LINUX/amd64
 1.1.58.1 08-Dec-2007  ad Sync with head.
 1.1.54.1 08-Dec-2007  mjf Sync with HEAD.
 1.1.48.1 09-Jan-2008  matt sync with HEAD
 1.1.46.1 09-Dec-2007  jmcneill Sync with HEAD.
 1.1.22.2 09-Sep-2006  rpaulo sync with head
 1.1.22.1 09-Feb-2006  rpaulo file linux32_machdep.h was added on branch rpaulo-netinet-merge-pcb on 2006-09-09 02:45:52 +0000
 1.1.16.3 07-Dec-2007  yamt sync with head
 1.1.16.2 21-Jun-2006  yamt sync with head.
 1.1.16.1 09-Feb-2006  yamt file linux32_machdep.h was added on branch yamt-lazymbuf on 2006-06-21 14:59:27 +0000
 1.1.10.2 22-Apr-2006  simonb Sync with head.
 1.1.10.1 09-Feb-2006  simonb file linux32_machdep.h was added on branch simonb-timecounters on 2006-04-22 11:38:14 +0000
 1.1.2.2 18-Feb-2006  yamt sync with head.
 1.1.2.1 09-Feb-2006  yamt file linux32_machdep.h was added on branch yamt-uio_vmspace on 2006-02-18 15:38:59 +0000
 1.7 18-Nov-2013  chs implement the *at() syscalls.
bring the unimplemented syscall list up to date.
 1.6 19-Nov-2008  ad branches: 1.6.16; 1.6.26; 1.6.30;
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 02-Feb-2008  dsl branches: 1.5.6; 1.5.10; 1.5.12; 1.5.16; 1.5.18;
Extract the fcntl64() suppoort from linux_file64.c into linux_fcntl64.c
Unravel some of the knots that caused linux_file64.c to be compiled twice
for an amd64 kernel (once for linux and once for linux32) with different
parts being skipped each time.
 1.4 15-Jan-2008  njoly compat linux (and linux32) uid16 functions cleanup and fixes.

- Move uid16 functions to their own file linux_uid16.c, included by
needed archs (arm, i386 and m68k).
- Add new MI types linux_{u,g}id16_t.
- Add macros to handle linux_uid16_t and uid_t conversions.
- Add linux_sys_getres{uid,gid}16 syscalls, to fix an overflow with
bad sizes given to copyout when linux_sys_getres{uid,gid} are used.
- Update arm syscall table to use more uid16 functions.
 1.3 19-Jul-2007  dsl branches: 1.3.6; 1.3.12; 1.3.18; 1.3.22;
include sys/cdefs.h
 1.2 09-Feb-2007  ad branches: 1.2.6; 1.2.14;
Merge newlock2 to head.
 1.1 09-Feb-2006  manu branches: 1.1.2; 1.1.10; 1.1.16; 1.1.20; 1.1.22;
Add initial (but unfinished) COMPAT_LINUX32 for amd64. This is good enough so
that the i386 license manager part of amd64 version of Fluent works.

While I'm here, add SysV IPC to COMPAT_LINUX/amd64
 1.1.22.2 09-Sep-2006  rpaulo sync with head
 1.1.22.1 09-Feb-2006  rpaulo file linux32_missing.c was added on branch rpaulo-netinet-merge-pcb on 2006-09-09 02:45:52 +0000
 1.1.20.1 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.1.16.6 04-Feb-2008  yamt sync with head.
 1.1.16.5 21-Jan-2008  yamt sync with head
 1.1.16.4 03-Sep-2007  yamt sync with head.
 1.1.16.3 26-Feb-2007  yamt sync with head.
 1.1.16.2 21-Jun-2006  yamt sync with head.
 1.1.16.1 09-Feb-2006  yamt file linux32_missing.c was added on branch yamt-lazymbuf on 2006-06-21 14:59:27 +0000
 1.1.10.2 22-Apr-2006  simonb Sync with head.
 1.1.10.1 09-Feb-2006  simonb file linux32_missing.c was added on branch simonb-timecounters on 2006-04-22 11:38:14 +0000
 1.1.2.2 18-Feb-2006  yamt sync with head.
 1.1.2.1 09-Feb-2006  yamt file linux32_missing.c was added on branch yamt-uio_vmspace on 2006-02-18 15:38:59 +0000
 1.2.14.1 15-Aug-2007  skrll Sync with HEAD.
 1.2.6.1 20-Aug-2007  ad Sync with HEAD.
 1.3.22.2 19-Jul-2007  dsl include sys/cdefs.h
 1.3.22.1 19-Jul-2007  dsl file linux32_missing.c was added on branch matt-mips64 on 2007-07-19 22:17:24 +0000
 1.3.18.1 19-Jan-2008  bouyer Sync with HEAD
 1.3.12.1 18-Feb-2008  mjf Sync with HEAD.
 1.3.6.1 23-Mar-2008  matt sync with HEAD
 1.5.18.1 19-Jan-2009  skrll Sync with HEAD.
 1.5.16.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.5.12.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.5.12.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.5.10.1 04-May-2009  yamt sync with head.
 1.5.6.1 17-Jan-2009  mjf Sync with HEAD.
 1.6.30.1 18-May-2014  rmind sync with head
 1.6.26.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.6.16.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.9 08-Jun-2009  njoly Fix defines against multiple inclusion protection (s/I386/AMD64).
 1.8 16-Apr-2008  njoly branches: 1.8.4; 1.8.18;
Kill a few other unused linux syscall arguments/prototypes
definitions.
 1.7 15-Apr-2008  njoly Remove syscall prototypes forgotten in previous commit.
 1.6 15-Apr-2008  njoly Remove unused linux_sys_setresgid16_args/linux_sys_setresuid16_args
definitions.
 1.5 15-Jan-2008  njoly branches: 1.5.6;
compat linux (and linux32) uid16 functions cleanup and fixes.

- Move uid16 functions to their own file linux_uid16.c, included by
needed archs (arm, i386 and m68k).
- Add new MI types linux_{u,g}id16_t.
- Add macros to handle linux_uid16_t and uid_t conversions.
- Add linux_sys_getres{uid,gid}16 syscalls, to fix an overflow with
bad sizes given to copyout when linux_sys_getres{uid,gid} are used.
- Update arm syscall table to use more uid16 functions.
 1.4 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.3 04-Mar-2007  christos branches: 1.3.16; 1.3.22; 1.3.24; 1.3.28;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.2 13-Sep-2006  manu branches: 1.2.6;
Jumbo COMPAT_LINUX/COMPAT_LINUX32 bugfix, with the help of Nicolas Joly
- Fix shmat return value on amd64: it uses no black magic with retval[0]
- Fix integer overflows in sysinfo
- Implement sysinfo, mmap2, sched_getparam, sched_getscheduler, mremap,
and madvise in COMPAT_LINUX32
- Fix improper types used in setgroups16/getgroups16
- Implement mmap2 for COMPAT_LINUX32
- Ifdef debug messages by DEBUG_LINUX
 1.1 09-Feb-2006  manu branches: 1.1.2; 1.1.4; 1.1.10; 1.1.16; 1.1.20; 1.1.22;
Add initial (but unfinished) COMPAT_LINUX32 for amd64. This is good enough so
that the i386 license manager part of amd64 version of Fluent works.

While I'm here, add SysV IPC to COMPAT_LINUX/amd64
 1.1.22.2 09-Sep-2006  rpaulo sync with head
 1.1.22.1 09-Feb-2006  rpaulo file linux32_missing.h was added on branch rpaulo-netinet-merge-pcb on 2006-09-09 02:45:52 +0000
 1.1.20.1 18-Nov-2006  ad Sync with head.
 1.1.16.5 21-Jan-2008  yamt sync with head
 1.1.16.4 03-Sep-2007  yamt sync with head.
 1.1.16.3 30-Dec-2006  yamt sync with head.
 1.1.16.2 21-Jun-2006  yamt sync with head.
 1.1.16.1 09-Feb-2006  yamt file linux32_missing.h was added on branch yamt-lazymbuf on 2006-06-21 14:59:27 +0000
 1.1.10.2 22-Apr-2006  simonb Sync with head.
 1.1.10.1 09-Feb-2006  simonb file linux32_missing.h was added on branch simonb-timecounters on 2006-04-22 11:38:14 +0000
 1.1.4.1 14-Sep-2006  yamt sync with head.
 1.1.2.2 18-Feb-2006  yamt sync with head.
 1.1.2.1 09-Feb-2006  yamt file linux32_missing.h was added on branch yamt-uio_vmspace on 2006-02-18 15:38:59 +0000
 1.2.6.1 12-Mar-2007  rmind Sync with HEAD.
 1.3.28.2 19-Jan-2008  bouyer Sync with HEAD
 1.3.28.1 02-Jan-2008  bouyer Sync with HEAD
 1.3.24.1 26-Dec-2007  ad Sync with head.
 1.3.22.1 18-Feb-2008  mjf Sync with HEAD.
 1.3.16.2 23-Mar-2008  matt sync with HEAD
 1.3.16.1 09-Jan-2008  matt sync with HEAD
 1.5.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.8.18.1 23-Jul-2009  jym Sync with HEAD.
 1.8.4.1 20-Jun-2009  yamt sync with head
 1.2 19-Sep-2021  thorpej Add routines to convert from linux32 to native sigevent_t.
 1.1 18-Nov-2011  christos branches: 1.1.8; 1.1.66;
add sigtimedwait support
 1.1.66.1 17-Dec-2020  thorpej Add sigevent mapping for Linux-32 compat.
 1.1.8.2 17-Apr-2012  yamt sync with head
 1.1.8.1 18-Nov-2011  yamt file linux32_siginfo.h was added on branch yamt-pagecache on 2012-04-17 00:07:18 +0000
 1.4 08-Mar-2015  christos fix inconsistent names
 1.3 18-Nov-2011  christos branches: 1.3.10; 1.3.28;
add sigtimedwait support
 1.2 08-Jun-2009  njoly branches: 1.2.12;
Fix defines against multiple inclusion protection (s/I386/AMD64).
 1.1 09-Feb-2006  manu branches: 1.1.2; 1.1.10; 1.1.16; 1.1.22; 1.1.76; 1.1.92;
Add initial (but unfinished) COMPAT_LINUX32 for amd64. This is good enough so
that the i386 license manager part of amd64 version of Fluent works.

While I'm here, add SysV IPC to COMPAT_LINUX/amd64
 1.1.92.1 23-Jul-2009  jym Sync with HEAD.
 1.1.76.1 20-Jun-2009  yamt sync with head
 1.1.22.2 09-Sep-2006  rpaulo sync with head
 1.1.22.1 09-Feb-2006  rpaulo file linux32_signal.h was added on branch rpaulo-netinet-merge-pcb on 2006-09-09 02:45:52 +0000
 1.1.16.2 21-Jun-2006  yamt sync with head.
 1.1.16.1 09-Feb-2006  yamt file linux32_signal.h was added on branch yamt-lazymbuf on 2006-06-21 14:59:27 +0000
 1.1.10.2 22-Apr-2006  simonb Sync with head.
 1.1.10.1 09-Feb-2006  simonb file linux32_signal.h was added on branch simonb-timecounters on 2006-04-22 11:38:14 +0000
 1.1.2.2 18-Feb-2006  yamt sync with head.
 1.1.2.1 09-Feb-2006  yamt file linux32_signal.h was added on branch yamt-uio_vmspace on 2006-02-18 15:38:59 +0000
 1.2.12.1 17-Apr-2012  yamt sync with head
 1.3.28.1 06-Apr-2015  skrll Sync with HEAD
 1.3.10.1 03-Dec-2017  jdolecek update from HEAD
 1.87 02-Dec-2021  ryo regen
 1.86 27-Nov-2021  ryo regen
 1.85 20-Sep-2021  thorpej Regen for preadv(2) / pwritev(2).
 1.84 20-Sep-2021  thorpej Regen for eventfd.
 1.83 19-Sep-2021  thorpej Regen for timerfd.
 1.82 19-Sep-2021  thorpej Regen for POSIX timer syscalls.
 1.81 26-Apr-2020  thorpej branches: 1.81.2;
Regen for native futex calls.
 1.80 09-Nov-2019  jdolecek regen
 1.79 10-Aug-2018  pgoyette Regen
 1.78 10-May-2017  riastradh branches: 1.78.8; 1.78.10;
regen
 1.77 16-Jan-2017  christos branches: 1.77.4;
descend and regen
 1.76 13-Jan-2017  christos branches: 1.76.2;
regen
 1.75 08-Mar-2015  christos branches: 1.75.2;
regen
 1.74 07-Mar-2015  christos regen
 1.73 22-Nov-2014  njoly branches: 1.73.2;
Regen for ppoll(2)
 1.72 29-May-2014  njoly Regen for utimes(2).
 1.71 04-May-2014  njoly Regen for pread/pwrite 64bit offset argument.
 1.70 18-Nov-2013  christos branches: 1.70.2;
Regen
 1.69 18-Nov-2013  chs regen
 1.68 07-Nov-2013  njoly Regen for dup/dup2/dup3 argument types fix.
 1.67 13-Jul-2012  christos branches: 1.67.2; 1.67.4;
regen
 1.66 10-May-2012  christos regen
 1.65 18-Nov-2011  christos branches: 1.65.4; 1.65.6;
regen
 1.64 18-Nov-2011  christos add sigtimedwait support
 1.63 30-May-2011  alnsn branches: 1.63.4;
Regenerate files to pick up correct RCS Ids. Suggested by Chris Badura.
 1.62 30-May-2011  alnsn Add fadvise64 and fadvise64_64 syscalls to compat_linux and compat_linux32.
 1.61 10-Apr-2011  christos Regen: XXX: produces errors because of rump changes!
 1.60 02-Nov-2010  chs branches: 1.60.2;
regen
 1.59 07-Jul-2010  chs regen
 1.58 24-Nov-2009  njoly branches: 1.58.2; 1.58.4;
Regen for personality(2) update.
 1.57 08-Jun-2009  njoly Regen for rt_queueinfo addition.
 1.56 05-Jun-2009  njoly Regen for fstatfs.
 1.55 04-Jun-2009  njoly Regen for stat/lstat/fstat syscalls.
 1.54 02-Jun-2009  njoly Regen for siggetmask/sigsetmask.
 1.53 30-Jan-2009  njoly branches: 1.53.2;
Regen for mincore(2).
 1.52 20-Jan-2009  njoly Regen for personality(2) addition.
 1.51 17-Jan-2009  njoly Regen for wait4 update.
 1.50 16-Jan-2009  njoly Regen for compat 50 update.
 1.49 13-Jan-2009  pooka Regen to prove I didn't screw up the conversion: purely RCSID changes.
 1.48 11-Jan-2009  christos merge christos-time_t
 1.47 12-Dec-2008  njoly branches: 1.47.2;
Regen for clock_nanosleep.
 1.46 06-Dec-2008  njoly Regen for netbsd32_caddr_t removal.
 1.45 05-Dec-2008  njoly Regen for getres{uid,gid} syscalls.
 1.44 01-Dec-2008  njoly Regen for sched_get_priority_{min,max}.
 1.43 19-Nov-2008  ad Regen.
 1.42 12-Nov-2008  njoly Regen for nanosleep(2) fix.
 1.41 06-Oct-2008  njoly branches: 1.41.2; 1.41.4;
Regen.
 1.40 22-Sep-2008  njoly Regen after cleanup.
 1.39 24-Jul-2008  njoly Regen for rt_sigpending.
 1.38 16-Jun-2008  christos branches: 1.38.2;
regen
 1.37 20-May-2008  njoly branches: 1.37.2;
Regen for ipc(2) syscall support.
 1.36 17-Apr-2008  njoly branches: 1.36.2; 1.36.4; 1.36.6;
Regen for sys_clock_{getres,gettime,settime} syscalls.
 1.35 04-Apr-2008  njoly Regen for msync(2) support.
 1.34 20-Feb-2008  njoly branches: 1.34.6;
Regen for mlock/munlock syscalls
 1.33 17-Feb-2008  njoly Regen for pread/pwrite fixes.
 1.32 04-Feb-2008  dsl Regen for merging fcntl() and fcntl64().
 1.31 02-Feb-2008  dsl Regen for pread and pwrite
 1.30 15-Jan-2008  njoly Regen.
 1.29 07-Jan-2008  njoly Regen.
 1.28 26-Dec-2007  njoly Regen for readdir syscall.
 1.27 24-Dec-2007  njoly Regen for old_uname syscall.
 1.26 24-Dec-2007  njoly Regen for getpgid.
 1.25 21-Dec-2007  njoly Regen for getfsuid/setfsgid syscall exchange.
 1.24 20-Dec-2007  dsl regen
 1.23 16-Nov-2007  njoly branches: 1.23.2; 1.23.6;
Regen.
 1.22 11-Nov-2007  christos regen
 1.21 07-Nov-2007  njoly Regen for 64-bit linux syscalls removal.
 1.20 31-Oct-2007  dsl branches: 1.20.2;
regen
 1.19 31-Oct-2007  njoly Regen for syscalls cleanup.
 1.18 27-Oct-2007  njoly Regen for chown additions.
 1.17 20-Apr-2007  njoly branches: 1.17.6; 1.17.8; 1.17.12;
Regen (ftruncate fix).
 1.16 11-Apr-2007  njoly Regen (statfs support).
 1.15 05-Mar-2007  christos branches: 1.15.2; 1.15.4;
fix caddr_t lossage.
 1.14 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.13 16-Feb-2007  njoly branches: 1.13.2;
Regen.
 1.12 08-Feb-2007  njoly Regen (aliases cleanup).
 1.11 07-Feb-2007  njoly Regen (poll argument fix).
 1.10 13-Sep-2006  manu branches: 1.10.4;
Jumbo COMPAT_LINUX/COMPAT_LINUX32 bugfix, with the help of Nicolas Joly
- Fix shmat return value on amd64: it uses no black magic with retval[0]
- Fix integer overflows in sysinfo
- Implement sysinfo, mmap2, sched_getparam, sched_getscheduler, mremap,
and madvise in COMPAT_LINUX32
- Fix improper types used in setgroups16/getgroups16
- Implement mmap2 for COMPAT_LINUX32
- Ifdef debug messages by DEBUG_LINUX
 1.9 06-Sep-2006  manu branches: 1.9.2; 1.9.4;
Implement Linux's fdatasync, patch from Nicolas Joly
 1.8 06-Sep-2006  manu Fix linux32_sys_setres{uid|gid}: -1 does not means the same thing on i386
and amd64...
 1.7 05-Sep-2006  manu typo
 1.6 01-Sep-2006  matt Regen.
 1.5 25-Jun-2006  manu Regen
 1.4 25-Jun-2006  manu - Complete exit_group() implementation. We now maintain a list of Linux
threads in a processes and kill them properly. The code is a bit too
complicated, but I could not find a simplier way of dealing with it

- Change getpid() and getppid() semantics to match what Linux does,
and implement gettid(). In the Linux kernel, threads are implemnted
as plain old processes. A thread group is just a set of processes,
with the parent called leader. Thread ID, which are returned by gettid(),
are just the PID of the plain old processes, and getpid() returns the
PID of the thread group leader.

- Remove struct linux32_emuldata. COMPAT_LINUX32 uses a lot of COMPAT_LINUX
code, where a struct linux_emuldata is assumed. By having distinct emuldata
structure with different sizes and layouts, we caused kernel memory
corruptions.

- Fix setprioriry() and getpriority()

Thanks to Nicolas Joly for tracking down the problem and providing me the
hardware to fix them.
 1.3 15-Feb-2006  manu branches: 1.3.2; 1.3.4; 1.3.10; 1.3.14; 1.3.16;
Add getcwd (for real this time), fix dup and dup2
 1.2 15-Feb-2006  manu - Move the BSD to Linux and Linux to BSD termio/termios conversion functions
to a header where they can be shared between COMPAT_LINUX and COMPAT_LINUX32
- Add termios ioctl emulation to COMPAT_LINUX32
- Add the getcwd system call to COMPAT_LINUX32/amd64

That makes Linux's bash working with COMPAT_LINUX32.
 1.1 09-Feb-2006  manu Add initial (but unfinished) COMPAT_LINUX32 for amd64. This is good enough so
that the i386 license manager part of amd64 version of Fluent works.

While I'm here, add SysV IPC to COMPAT_LINUX/amd64
 1.3.16.12 27-Feb-2008  yamt sync with head.
 1.3.16.11 11-Feb-2008  yamt sync with head.
 1.3.16.10 04-Feb-2008  yamt sync with head.
 1.3.16.9 21-Jan-2008  yamt sync with head
 1.3.16.8 07-Dec-2007  yamt sync with head
 1.3.16.7 15-Nov-2007  yamt sync with head.
 1.3.16.6 27-Oct-2007  yamt sync with head.
 1.3.16.5 03-Sep-2007  yamt sync with head.
 1.3.16.4 26-Feb-2007  yamt sync with head.
 1.3.16.3 30-Dec-2006  yamt sync with head.
 1.3.16.2 21-Jun-2006  yamt sync with head.
 1.3.16.1 15-Feb-2006  yamt file linux32_syscall.h was added on branch yamt-lazymbuf on 2006-06-21 14:59:27 +0000
 1.3.14.1 13-Jul-2006  gdamore Merge from HEAD.
 1.3.10.2 22-Apr-2006  simonb Sync with head.
 1.3.10.1 15-Feb-2006  simonb file linux32_syscall.h was added on branch simonb-timecounters on 2006-04-22 11:38:14 +0000
 1.3.4.2 14-Sep-2006  yamt sync with head.
 1.3.4.1 26-Jun-2006  yamt sync with head.
 1.3.2.2 18-Feb-2006  yamt sync with head.
 1.3.2.1 15-Feb-2006  yamt file linux32_syscall.h was added on branch yamt-uio_vmspace on 2006-02-18 15:38:59 +0000
 1.9.4.2 09-Sep-2006  rpaulo sync with head
 1.9.4.1 06-Sep-2006  rpaulo file linux32_syscall.h was added on branch rpaulo-netinet-merge-pcb on 2006-09-09 02:45:52 +0000
 1.9.2.2 09-Feb-2007  ad Sync with HEAD.
 1.9.2.1 18-Nov-2006  ad Sync with head.
 1.10.4.2 20-Apr-2007  bouyer regen for ticket #582
 1.10.4.1 02-Apr-2007  bouyer Regen for ticket #544
 1.13.2.3 07-May-2007  yamt sync with head.
 1.13.2.2 15-Apr-2007  yamt sync with head.
 1.13.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.15.4.1 11-Jul-2007  mjf Sync with head.
 1.15.2.1 27-May-2007  ad Sync with head.
 1.17.12.2 18-Nov-2007  bouyer Sync with HEAD
 1.17.12.1 13-Nov-2007  bouyer Sync with HEAD
 1.17.8.4 23-Mar-2008  matt sync with HEAD
 1.17.8.3 09-Jan-2008  matt sync with HEAD
 1.17.8.2 08-Nov-2007  matt sync with -HEAD
 1.17.8.1 06-Nov-2007  matt sync with HEAD
 1.17.6.6 21-Nov-2007  joerg Sync with HEAD.
 1.17.6.5 14-Nov-2007  joerg Sync with HEAD.
 1.17.6.4 11-Nov-2007  joerg Sync with HEAD.
 1.17.6.3 04-Nov-2007  jmcneill Sync with HEAD.
 1.17.6.2 31-Oct-2007  joerg Sync with HEAD.
 1.17.6.1 28-Oct-2007  joerg Sync with HEAD.
 1.20.2.3 18-Feb-2008  mjf Sync with HEAD.
 1.20.2.2 27-Dec-2007  mjf Sync with HEAD.
 1.20.2.1 19-Nov-2007  mjf Sync with HEAD.
 1.23.6.3 19-Jan-2008  bouyer Sync with HEAD
 1.23.6.2 08-Jan-2008  bouyer Sync with HEAD
 1.23.6.1 02-Jan-2008  bouyer Sync with HEAD
 1.23.2.1 26-Dec-2007  ad Sync with head.
 1.34.6.4 17-Jan-2009  mjf Sync with HEAD.
 1.34.6.3 28-Sep-2008  mjf Sync with HEAD.
 1.34.6.2 29-Jun-2008  mjf Sync with HEAD.
 1.34.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.36.6.3 10-Oct-2008  skrll Sync with HEAD.
 1.36.6.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.36.6.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.36.4.4 11-Aug-2010  yamt sync with head.
 1.36.4.3 11-Mar-2010  yamt sync with head
 1.36.4.2 20-Jun-2009  yamt sync with head
 1.36.4.1 04-May-2009  yamt sync with head.
 1.36.2.2 17-Jun-2008  yamt sync with head.
 1.36.2.1 04-Jun-2008  yamt sync with head
 1.37.2.2 28-Jul-2008  simonb Sync with head.
 1.37.2.1 18-Jun-2008  simonb Sync with head.
 1.38.2.2 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.38.2.1 19-Oct-2008  haad Sync with HEAD.
 1.41.4.2 18-Mar-2015  snj regen for ticket 1149
 1.41.4.1 20-Nov-2008  snj Regen for ticket 81.
 1.41.2.2 03-Mar-2009  skrll Sync with HEAD.
 1.41.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.47.2.2 04-Jan-2009  christos use compat_50 syscalls where appropriate.
 1.47.2.1 12-Dec-2008  christos file linux32_syscall.h was added on branch christos-time_t on 2009-01-04 01:58:39 +0000
 1.53.2.1 23-Jul-2009  jym Sync with HEAD.
 1.58.4.3 31-May-2011  rmind sync with head
 1.58.4.2 21-Apr-2011  rmind sync with head
 1.58.4.1 05-Mar-2011  rmind sync with head
 1.58.2.2 06-Nov-2010  uebayasi Sync with HEAD.
 1.58.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.60.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.63.4.4 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.4.3 30-Oct-2012  yamt sync with head
 1.63.4.2 23-May-2012  yamt sync with head.
 1.63.4.1 17-Apr-2012  yamt sync with head
 1.65.6.2 20-Jul-2012  riz Pull up following revision(s) (requested by christos in ticket #424):
sys/compat/linux32/arch/amd64/linux32_syscallargs.h: revision 1.67
sys/compat/linux32/arch/amd64/syscalls.master: revision 1.62
sys/compat/linux32/arch/amd64/linux32_syscall.h: revision 1.67
sys/compat/linux32/arch/amd64/linux32_sysent.c: revision 1.67
sys/compat/linux32/arch/amd64/linux32_syscalls.c: revision 1.67
add xattr stubs
regen
 1.65.6.1 19-May-2012  riz Pull up following revision(s) (requested by christos in ticket #263):
sys/compat/linux32/arch/amd64/linux32_syscallargs.h: revision 1.66
sys/compat/linux32/arch/amd64/syscalls.master: revision 1.61
sys/compat/linux32/common/linux32_signal.c: revision 1.16
sys/compat/linux32/arch/amd64/linux32_syscall.h: revision 1.66
sys/compat/linux32/arch/amd64/linux32_sysent.c: revision 1.66
sys/compat/linux32/arch/amd64/linux32_syscalls.c: revision 1.66
regen
Fix rt_sigtimedwait():
It is wishful thinking that:
1. declaring a 32 bit syscall with 64 bit pointers
2. passing a struct with 32 bit pointers to a 64 bit function
is going to work.
 1.65.4.1 02-Jun-2012  mrg sync to latest -current.
 1.67.4.1 18-May-2014  rmind sync with head
 1.67.2.2 03-Dec-2017  jdolecek update from HEAD
 1.67.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.70.2.1 10-Aug-2014  tls Rebase.
 1.73.2.1 06-Apr-2015  skrll Sync with HEAD
 1.75.2.1 20-Mar-2017  pgoyette Sync with HEAD
 1.76.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.77.4.1 11-May-2017  pgoyette Sync with HEAD
 1.78.10.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.78.10.1 10-Jun-2019  christos Sync with HEAD
 1.78.8.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.81.2.3 03-Jan-2021  thorpej Regen for preadv(2) and pwritev(2).
 1.81.2.2 17-Dec-2020  thorpej Regen for POSIX timers and timerfd.
 1.81.2.1 16-Dec-2020  thorpej Regen for eventfd.
 1.87 02-Dec-2021  ryo regen
 1.86 27-Nov-2021  ryo regen
 1.85 20-Sep-2021  thorpej Regen for preadv(2) / pwritev(2).
 1.84 20-Sep-2021  thorpej Regen for eventfd.
 1.83 19-Sep-2021  thorpej Regen for timerfd.
 1.82 19-Sep-2021  thorpej Regen for POSIX timer syscalls.
 1.81 26-Apr-2020  thorpej branches: 1.81.2;
Regen for native futex calls.
 1.80 09-Nov-2019  jdolecek regen
 1.79 10-Aug-2018  pgoyette Regen
 1.78 10-May-2017  riastradh branches: 1.78.8; 1.78.10;
regen
 1.77 16-Jan-2017  christos branches: 1.77.4;
descend and regen
 1.76 13-Jan-2017  christos branches: 1.76.2;
regen
 1.75 08-Mar-2015  christos branches: 1.75.2;
regen
 1.74 07-Mar-2015  christos regen
 1.73 22-Nov-2014  njoly branches: 1.73.2;
Regen for ppoll(2)
 1.72 29-May-2014  njoly Regen for utimes(2).
 1.71 04-May-2014  njoly Regen for pread/pwrite 64bit offset argument.
 1.70 18-Nov-2013  christos branches: 1.70.2;
Regen
 1.69 18-Nov-2013  chs regen
 1.68 07-Nov-2013  njoly Regen for dup/dup2/dup3 argument types fix.
 1.67 13-Jul-2012  christos branches: 1.67.2; 1.67.4;
regen
 1.66 10-May-2012  christos regen
 1.65 18-Nov-2011  christos branches: 1.65.4; 1.65.6;
regen
 1.64 18-Nov-2011  christos add sigtimedwait support
 1.63 30-May-2011  alnsn branches: 1.63.4;
Regenerate files to pick up correct RCS Ids. Suggested by Chris Badura.
 1.62 30-May-2011  alnsn Add fadvise64 and fadvise64_64 syscalls to compat_linux and compat_linux32.
 1.61 10-Apr-2011  christos Regen: XXX: produces errors because of rump changes!
 1.60 02-Nov-2010  chs branches: 1.60.2;
regen
 1.59 07-Jul-2010  chs regen
 1.58 24-Nov-2009  njoly branches: 1.58.2; 1.58.4;
Regen for personality(2) update.
 1.57 08-Jun-2009  njoly Regen for rt_queueinfo addition.
 1.56 05-Jun-2009  njoly Regen for fstatfs.
 1.55 04-Jun-2009  njoly Regen for stat/lstat/fstat syscalls.
 1.54 02-Jun-2009  njoly Regen for siggetmask/sigsetmask.
 1.53 30-Jan-2009  njoly branches: 1.53.2;
Regen for mincore(2).
 1.52 20-Jan-2009  njoly Regen for personality(2) addition.
 1.51 17-Jan-2009  njoly Regen for wait4 update.
 1.50 16-Jan-2009  njoly Regen for compat 50 update.
 1.49 13-Jan-2009  pooka Regen to prove I didn't screw up the conversion: purely RCSID changes.
 1.48 11-Jan-2009  christos merge christos-time_t
 1.47 12-Dec-2008  njoly branches: 1.47.2;
Regen for clock_nanosleep.
 1.46 06-Dec-2008  njoly Regen for netbsd32_caddr_t removal.
 1.45 05-Dec-2008  njoly Regen for getres{uid,gid} syscalls.
 1.44 01-Dec-2008  njoly Regen for sched_get_priority_{min,max}.
 1.43 19-Nov-2008  ad Regen.
 1.42 12-Nov-2008  njoly Regen for nanosleep(2) fix.
 1.41 06-Oct-2008  njoly branches: 1.41.2; 1.41.4;
Regen.
 1.40 22-Sep-2008  njoly Regen after cleanup.
 1.39 24-Jul-2008  njoly Regen for rt_sigpending.
 1.38 16-Jun-2008  christos branches: 1.38.2;
regen
 1.37 20-May-2008  njoly branches: 1.37.2;
Regen for ipc(2) syscall support.
 1.36 17-Apr-2008  njoly branches: 1.36.2; 1.36.4; 1.36.6;
Regen for sys_clock_{getres,gettime,settime} syscalls.
 1.35 04-Apr-2008  njoly Regen for msync(2) support.
 1.34 20-Feb-2008  njoly branches: 1.34.6;
Regen for mlock/munlock syscalls
 1.33 17-Feb-2008  njoly Regen for pread/pwrite fixes.
 1.32 04-Feb-2008  dsl Regen for merging fcntl() and fcntl64().
 1.31 02-Feb-2008  dsl Regen for pread and pwrite
 1.30 15-Jan-2008  njoly Regen.
 1.29 07-Jan-2008  njoly Regen.
 1.28 26-Dec-2007  njoly Regen for readdir syscall.
 1.27 24-Dec-2007  njoly Regen for old_uname syscall.
 1.26 24-Dec-2007  njoly Regen for getpgid.
 1.25 21-Dec-2007  njoly Regen for getfsuid/setfsgid syscall exchange.
 1.24 20-Dec-2007  dsl regen
 1.23 16-Nov-2007  njoly branches: 1.23.2; 1.23.6;
Regen.
 1.22 11-Nov-2007  christos regen
 1.21 07-Nov-2007  njoly Regen for 64-bit linux syscalls removal.
 1.20 31-Oct-2007  dsl branches: 1.20.2;
regen
 1.19 31-Oct-2007  njoly Regen for syscalls cleanup.
 1.18 27-Oct-2007  njoly Regen for chown additions.
 1.17 20-Apr-2007  njoly branches: 1.17.6; 1.17.8; 1.17.12;
Regen (ftruncate fix).
 1.16 11-Apr-2007  njoly Regen (statfs support).
 1.15 05-Mar-2007  christos branches: 1.15.2; 1.15.4;
fix caddr_t lossage.
 1.14 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.13 16-Feb-2007  njoly branches: 1.13.2;
Regen.
 1.12 08-Feb-2007  njoly Regen (aliases cleanup).
 1.11 07-Feb-2007  njoly Regen (poll argument fix).
 1.10 13-Sep-2006  manu branches: 1.10.4;
Jumbo COMPAT_LINUX/COMPAT_LINUX32 bugfix, with the help of Nicolas Joly
- Fix shmat return value on amd64: it uses no black magic with retval[0]
- Fix integer overflows in sysinfo
- Implement sysinfo, mmap2, sched_getparam, sched_getscheduler, mremap,
and madvise in COMPAT_LINUX32
- Fix improper types used in setgroups16/getgroups16
- Implement mmap2 for COMPAT_LINUX32
- Ifdef debug messages by DEBUG_LINUX
 1.9 06-Sep-2006  manu branches: 1.9.2; 1.9.4;
Implement Linux's fdatasync, patch from Nicolas Joly
 1.8 06-Sep-2006  manu Fix linux32_sys_setres{uid|gid}: -1 does not means the same thing on i386
and amd64...
 1.7 05-Sep-2006  manu typo
 1.6 01-Sep-2006  matt Regen.
 1.5 25-Jun-2006  manu Regen
 1.4 25-Jun-2006  manu - Complete exit_group() implementation. We now maintain a list of Linux
threads in a processes and kill them properly. The code is a bit too
complicated, but I could not find a simplier way of dealing with it

- Change getpid() and getppid() semantics to match what Linux does,
and implement gettid(). In the Linux kernel, threads are implemnted
as plain old processes. A thread group is just a set of processes,
with the parent called leader. Thread ID, which are returned by gettid(),
are just the PID of the plain old processes, and getpid() returns the
PID of the thread group leader.

- Remove struct linux32_emuldata. COMPAT_LINUX32 uses a lot of COMPAT_LINUX
code, where a struct linux_emuldata is assumed. By having distinct emuldata
structure with different sizes and layouts, we caused kernel memory
corruptions.

- Fix setprioriry() and getpriority()

Thanks to Nicolas Joly for tracking down the problem and providing me the
hardware to fix them.
 1.3 15-Feb-2006  manu branches: 1.3.2; 1.3.4; 1.3.10; 1.3.14; 1.3.16;
Add getcwd (for real this time), fix dup and dup2
 1.2 15-Feb-2006  manu - Move the BSD to Linux and Linux to BSD termio/termios conversion functions
to a header where they can be shared between COMPAT_LINUX and COMPAT_LINUX32
- Add termios ioctl emulation to COMPAT_LINUX32
- Add the getcwd system call to COMPAT_LINUX32/amd64

That makes Linux's bash working with COMPAT_LINUX32.
 1.1 09-Feb-2006  manu Add initial (but unfinished) COMPAT_LINUX32 for amd64. This is good enough so
that the i386 license manager part of amd64 version of Fluent works.

While I'm here, add SysV IPC to COMPAT_LINUX/amd64
 1.3.16.12 27-Feb-2008  yamt sync with head.
 1.3.16.11 11-Feb-2008  yamt sync with head.
 1.3.16.10 04-Feb-2008  yamt sync with head.
 1.3.16.9 21-Jan-2008  yamt sync with head
 1.3.16.8 07-Dec-2007  yamt sync with head
 1.3.16.7 15-Nov-2007  yamt sync with head.
 1.3.16.6 27-Oct-2007  yamt sync with head.
 1.3.16.5 03-Sep-2007  yamt sync with head.
 1.3.16.4 26-Feb-2007  yamt sync with head.
 1.3.16.3 30-Dec-2006  yamt sync with head.
 1.3.16.2 21-Jun-2006  yamt sync with head.
 1.3.16.1 15-Feb-2006  yamt file linux32_syscallargs.h was added on branch yamt-lazymbuf on 2006-06-21 14:59:27 +0000
 1.3.14.1 13-Jul-2006  gdamore Merge from HEAD.
 1.3.10.2 22-Apr-2006  simonb Sync with head.
 1.3.10.1 15-Feb-2006  simonb file linux32_syscallargs.h was added on branch simonb-timecounters on 2006-04-22 11:38:14 +0000
 1.3.4.2 14-Sep-2006  yamt sync with head.
 1.3.4.1 26-Jun-2006  yamt sync with head.
 1.3.2.2 18-Feb-2006  yamt sync with head.
 1.3.2.1 15-Feb-2006  yamt file linux32_syscallargs.h was added on branch yamt-uio_vmspace on 2006-02-18 15:38:59 +0000
 1.9.4.2 09-Sep-2006  rpaulo sync with head
 1.9.4.1 06-Sep-2006  rpaulo file linux32_syscallargs.h was added on branch rpaulo-netinet-merge-pcb on 2006-09-09 02:45:52 +0000
 1.9.2.2 09-Feb-2007  ad Sync with HEAD.
 1.9.2.1 18-Nov-2006  ad Sync with head.
 1.10.4.2 20-Apr-2007  bouyer regen for ticket #582
 1.10.4.1 02-Apr-2007  bouyer Regen for ticket #544
 1.13.2.3 07-May-2007  yamt sync with head.
 1.13.2.2 15-Apr-2007  yamt sync with head.
 1.13.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.15.4.1 11-Jul-2007  mjf Sync with head.
 1.15.2.1 27-May-2007  ad Sync with head.
 1.17.12.2 18-Nov-2007  bouyer Sync with HEAD
 1.17.12.1 13-Nov-2007  bouyer Sync with HEAD
 1.17.8.4 23-Mar-2008  matt sync with HEAD
 1.17.8.3 09-Jan-2008  matt sync with HEAD
 1.17.8.2 08-Nov-2007  matt sync with -HEAD
 1.17.8.1 06-Nov-2007  matt sync with HEAD
 1.17.6.6 21-Nov-2007  joerg Sync with HEAD.
 1.17.6.5 14-Nov-2007  joerg Sync with HEAD.
 1.17.6.4 11-Nov-2007  joerg Sync with HEAD.
 1.17.6.3 04-Nov-2007  jmcneill Sync with HEAD.
 1.17.6.2 31-Oct-2007  joerg Sync with HEAD.
 1.17.6.1 28-Oct-2007  joerg Sync with HEAD.
 1.20.2.3 18-Feb-2008  mjf Sync with HEAD.
 1.20.2.2 27-Dec-2007  mjf Sync with HEAD.
 1.20.2.1 19-Nov-2007  mjf Sync with HEAD.
 1.23.6.3 19-Jan-2008  bouyer Sync with HEAD
 1.23.6.2 08-Jan-2008  bouyer Sync with HEAD
 1.23.6.1 02-Jan-2008  bouyer Sync with HEAD
 1.23.2.1 26-Dec-2007  ad Sync with head.
 1.34.6.4 17-Jan-2009  mjf Sync with HEAD.
 1.34.6.3 28-Sep-2008  mjf Sync with HEAD.
 1.34.6.2 29-Jun-2008  mjf Sync with HEAD.
 1.34.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.36.6.3 10-Oct-2008  skrll Sync with HEAD.
 1.36.6.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.36.6.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.36.4.4 11-Aug-2010  yamt sync with head.
 1.36.4.3 11-Mar-2010  yamt sync with head
 1.36.4.2 20-Jun-2009  yamt sync with head
 1.36.4.1 04-May-2009  yamt sync with head.
 1.36.2.2 17-Jun-2008  yamt sync with head.
 1.36.2.1 04-Jun-2008  yamt sync with head
 1.37.2.2 28-Jul-2008  simonb Sync with head.
 1.37.2.1 18-Jun-2008  simonb Sync with head.
 1.38.2.2 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.38.2.1 19-Oct-2008  haad Sync with HEAD.
 1.41.4.2 18-Mar-2015  snj regen for ticket 1149
 1.41.4.1 20-Nov-2008  snj Regen for ticket 81.
 1.41.2.2 03-Mar-2009  skrll Sync with HEAD.
 1.41.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.47.2.2 04-Jan-2009  christos use compat_50 syscalls where appropriate.
 1.47.2.1 12-Dec-2008  christos file linux32_syscallargs.h was added on branch christos-time_t on 2009-01-04 01:58:39 +0000
 1.53.2.1 23-Jul-2009  jym Sync with HEAD.
 1.58.4.3 31-May-2011  rmind sync with head
 1.58.4.2 21-Apr-2011  rmind sync with head
 1.58.4.1 05-Mar-2011  rmind sync with head
 1.58.2.2 06-Nov-2010  uebayasi Sync with HEAD.
 1.58.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.60.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.63.4.4 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.4.3 30-Oct-2012  yamt sync with head
 1.63.4.2 23-May-2012  yamt sync with head.
 1.63.4.1 17-Apr-2012  yamt sync with head
 1.65.6.2 20-Jul-2012  riz Pull up following revision(s) (requested by christos in ticket #424):
sys/compat/linux32/arch/amd64/linux32_syscallargs.h: revision 1.67
sys/compat/linux32/arch/amd64/syscalls.master: revision 1.62
sys/compat/linux32/arch/amd64/linux32_syscall.h: revision 1.67
sys/compat/linux32/arch/amd64/linux32_sysent.c: revision 1.67
sys/compat/linux32/arch/amd64/linux32_syscalls.c: revision 1.67
add xattr stubs
regen
 1.65.6.1 19-May-2012  riz Pull up following revision(s) (requested by christos in ticket #263):
sys/compat/linux32/arch/amd64/linux32_syscallargs.h: revision 1.66
sys/compat/linux32/arch/amd64/syscalls.master: revision 1.61
sys/compat/linux32/common/linux32_signal.c: revision 1.16
sys/compat/linux32/arch/amd64/linux32_syscall.h: revision 1.66
sys/compat/linux32/arch/amd64/linux32_sysent.c: revision 1.66
sys/compat/linux32/arch/amd64/linux32_syscalls.c: revision 1.66
regen
Fix rt_sigtimedwait():
It is wishful thinking that:
1. declaring a 32 bit syscall with 64 bit pointers
2. passing a struct with 32 bit pointers to a 64 bit function
is going to work.
 1.65.4.1 02-Jun-2012  mrg sync to latest -current.
 1.67.4.1 18-May-2014  rmind sync with head
 1.67.2.2 03-Dec-2017  jdolecek update from HEAD
 1.67.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.70.2.1 10-Aug-2014  tls Rebase.
 1.73.2.2 28-Aug-2017  skrll Sync with HEAD
 1.73.2.1 06-Apr-2015  skrll Sync with HEAD
 1.75.2.1 20-Mar-2017  pgoyette Sync with HEAD
 1.76.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.77.4.1 11-May-2017  pgoyette Sync with HEAD
 1.78.10.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.78.10.1 10-Jun-2019  christos Sync with HEAD
 1.78.8.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.81.2.3 03-Jan-2021  thorpej Regen for preadv(2) and pwritev(2).
 1.81.2.2 17-Dec-2020  thorpej Regen for POSIX timers and timerfd.
 1.81.2.1 16-Dec-2020  thorpej Regen for eventfd.
 1.87 02-Dec-2021  ryo regen
 1.86 27-Nov-2021  ryo regen
 1.85 20-Sep-2021  thorpej Regen for preadv(2) / pwritev(2).
 1.84 20-Sep-2021  thorpej Regen for eventfd.
 1.83 19-Sep-2021  thorpej Regen for timerfd.
 1.82 19-Sep-2021  thorpej Regen for POSIX timer syscalls.
 1.81 26-Apr-2020  thorpej branches: 1.81.2;
Regen for native futex calls.
 1.80 09-Nov-2019  jdolecek regen
 1.79 10-Aug-2018  pgoyette Regen
 1.78 10-May-2017  riastradh branches: 1.78.8; 1.78.10;
regen
 1.77 16-Jan-2017  christos branches: 1.77.4;
descend and regen
 1.76 13-Jan-2017  christos branches: 1.76.2;
regen
 1.75 08-Mar-2015  christos branches: 1.75.2;
regen
 1.74 07-Mar-2015  christos regen
 1.73 22-Nov-2014  njoly branches: 1.73.2;
Regen for ppoll(2)
 1.72 29-May-2014  njoly Regen for utimes(2).
 1.71 04-May-2014  njoly Regen for pread/pwrite 64bit offset argument.
 1.70 18-Nov-2013  christos branches: 1.70.2;
Regen
 1.69 18-Nov-2013  chs regen
 1.68 07-Nov-2013  njoly Regen for dup/dup2/dup3 argument types fix.
 1.67 13-Jul-2012  christos branches: 1.67.2; 1.67.4;
regen
 1.66 10-May-2012  christos regen
 1.65 18-Nov-2011  christos branches: 1.65.4; 1.65.6;
regen
 1.64 18-Nov-2011  christos add sigtimedwait support
 1.63 30-May-2011  alnsn branches: 1.63.4;
Regenerate files to pick up correct RCS Ids. Suggested by Chris Badura.
 1.62 30-May-2011  alnsn Add fadvise64 and fadvise64_64 syscalls to compat_linux and compat_linux32.
 1.61 10-Apr-2011  christos Regen: XXX: produces errors because of rump changes!
 1.60 02-Nov-2010  chs branches: 1.60.2;
regen
 1.59 07-Jul-2010  chs regen
 1.58 24-Nov-2009  njoly branches: 1.58.2; 1.58.4;
Regen for personality(2) update.
 1.57 08-Jun-2009  njoly Regen for rt_queueinfo addition.
 1.56 05-Jun-2009  njoly Regen for fstatfs.
 1.55 04-Jun-2009  njoly Regen for stat/lstat/fstat syscalls.
 1.54 02-Jun-2009  njoly Regen for siggetmask/sigsetmask.
 1.53 30-Jan-2009  njoly branches: 1.53.2;
Regen for mincore(2).
 1.52 20-Jan-2009  njoly Regen for personality(2) addition.
 1.51 17-Jan-2009  njoly Regen for wait4 update.
 1.50 16-Jan-2009  njoly Regen for compat 50 update.
 1.49 13-Jan-2009  pooka Regen to prove I didn't screw up the conversion: purely RCSID changes.
 1.48 11-Jan-2009  christos merge christos-time_t
 1.47 12-Dec-2008  njoly branches: 1.47.2;
Regen for clock_nanosleep.
 1.46 06-Dec-2008  njoly Regen for netbsd32_caddr_t removal.
 1.45 05-Dec-2008  njoly Regen for getres{uid,gid} syscalls.
 1.44 01-Dec-2008  njoly Regen for sched_get_priority_{min,max}.
 1.43 19-Nov-2008  ad Regen.
 1.42 12-Nov-2008  njoly Regen for nanosleep(2) fix.
 1.41 06-Oct-2008  njoly branches: 1.41.2; 1.41.4;
Regen.
 1.40 22-Sep-2008  njoly Regen after cleanup.
 1.39 24-Jul-2008  njoly Regen for rt_sigpending.
 1.38 16-Jun-2008  christos branches: 1.38.2;
regen
 1.37 20-May-2008  njoly branches: 1.37.2;
Regen for ipc(2) syscall support.
 1.36 17-Apr-2008  njoly branches: 1.36.2; 1.36.4; 1.36.6;
Regen for sys_clock_{getres,gettime,settime} syscalls.
 1.35 04-Apr-2008  njoly Regen for msync(2) support.
 1.34 20-Feb-2008  njoly branches: 1.34.6;
Regen for mlock/munlock syscalls
 1.33 17-Feb-2008  njoly Regen for pread/pwrite fixes.
 1.32 04-Feb-2008  dsl Regen for merging fcntl() and fcntl64().
 1.31 02-Feb-2008  dsl Regen for pread and pwrite
 1.30 15-Jan-2008  njoly Regen.
 1.29 07-Jan-2008  njoly Regen.
 1.28 26-Dec-2007  njoly Regen for readdir syscall.
 1.27 24-Dec-2007  njoly Regen for old_uname syscall.
 1.26 24-Dec-2007  njoly Regen for getpgid.
 1.25 21-Dec-2007  njoly Regen for getfsuid/setfsgid syscall exchange.
 1.24 20-Dec-2007  dsl regen
 1.23 16-Nov-2007  njoly branches: 1.23.2; 1.23.6;
Regen.
 1.22 11-Nov-2007  christos regen
 1.21 07-Nov-2007  njoly Regen for 64-bit linux syscalls removal.
 1.20 31-Oct-2007  dsl branches: 1.20.2;
regen
 1.19 31-Oct-2007  njoly Regen for syscalls cleanup.
 1.18 27-Oct-2007  njoly Regen for chown additions.
 1.17 20-Apr-2007  njoly branches: 1.17.6; 1.17.8; 1.17.12;
Regen (ftruncate fix).
 1.16 11-Apr-2007  njoly Regen (statfs support).
 1.15 05-Mar-2007  christos branches: 1.15.2; 1.15.4;
fix caddr_t lossage.
 1.14 16-Feb-2007  njoly branches: 1.14.2;
Regen.
 1.13 09-Feb-2007  ad Merge newlock2 to head.
 1.12 08-Feb-2007  njoly Regen (aliases cleanup).
 1.11 07-Feb-2007  njoly Regen (poll argument fix).
 1.10 13-Sep-2006  manu branches: 1.10.4;
Jumbo COMPAT_LINUX/COMPAT_LINUX32 bugfix, with the help of Nicolas Joly
- Fix shmat return value on amd64: it uses no black magic with retval[0]
- Fix integer overflows in sysinfo
- Implement sysinfo, mmap2, sched_getparam, sched_getscheduler, mremap,
and madvise in COMPAT_LINUX32
- Fix improper types used in setgroups16/getgroups16
- Implement mmap2 for COMPAT_LINUX32
- Ifdef debug messages by DEBUG_LINUX
 1.9 06-Sep-2006  manu branches: 1.9.2; 1.9.4;
Implement Linux's fdatasync, patch from Nicolas Joly
 1.8 06-Sep-2006  manu Fix linux32_sys_setres{uid|gid}: -1 does not means the same thing on i386
and amd64...
 1.7 05-Sep-2006  manu typo
 1.6 01-Sep-2006  matt Regen.
 1.5 25-Jun-2006  manu Regen
 1.4 25-Jun-2006  manu - Complete exit_group() implementation. We now maintain a list of Linux
threads in a processes and kill them properly. The code is a bit too
complicated, but I could not find a simplier way of dealing with it

- Change getpid() and getppid() semantics to match what Linux does,
and implement gettid(). In the Linux kernel, threads are implemnted
as plain old processes. A thread group is just a set of processes,
with the parent called leader. Thread ID, which are returned by gettid(),
are just the PID of the plain old processes, and getpid() returns the
PID of the thread group leader.

- Remove struct linux32_emuldata. COMPAT_LINUX32 uses a lot of COMPAT_LINUX
code, where a struct linux_emuldata is assumed. By having distinct emuldata
structure with different sizes and layouts, we caused kernel memory
corruptions.

- Fix setprioriry() and getpriority()

Thanks to Nicolas Joly for tracking down the problem and providing me the
hardware to fix them.
 1.3 15-Feb-2006  manu branches: 1.3.2; 1.3.4; 1.3.10; 1.3.14; 1.3.16;
Add getcwd (for real this time), fix dup and dup2
 1.2 15-Feb-2006  manu - Move the BSD to Linux and Linux to BSD termio/termios conversion functions
to a header where they can be shared between COMPAT_LINUX and COMPAT_LINUX32
- Add termios ioctl emulation to COMPAT_LINUX32
- Add the getcwd system call to COMPAT_LINUX32/amd64

That makes Linux's bash working with COMPAT_LINUX32.
 1.1 09-Feb-2006  manu Add initial (but unfinished) COMPAT_LINUX32 for amd64. This is good enough so
that the i386 license manager part of amd64 version of Fluent works.

While I'm here, add SysV IPC to COMPAT_LINUX/amd64
 1.3.16.12 27-Feb-2008  yamt sync with head.
 1.3.16.11 11-Feb-2008  yamt sync with head.
 1.3.16.10 04-Feb-2008  yamt sync with head.
 1.3.16.9 21-Jan-2008  yamt sync with head
 1.3.16.8 07-Dec-2007  yamt sync with head
 1.3.16.7 15-Nov-2007  yamt sync with head.
 1.3.16.6 27-Oct-2007  yamt sync with head.
 1.3.16.5 03-Sep-2007  yamt sync with head.
 1.3.16.4 26-Feb-2007  yamt sync with head.
 1.3.16.3 30-Dec-2006  yamt sync with head.
 1.3.16.2 21-Jun-2006  yamt sync with head.
 1.3.16.1 15-Feb-2006  yamt file linux32_syscalls.c was added on branch yamt-lazymbuf on 2006-06-21 14:59:27 +0000
 1.3.14.1 13-Jul-2006  gdamore Merge from HEAD.
 1.3.10.2 22-Apr-2006  simonb Sync with head.
 1.3.10.1 15-Feb-2006  simonb file linux32_syscalls.c was added on branch simonb-timecounters on 2006-04-22 11:38:14 +0000
 1.3.4.2 14-Sep-2006  yamt sync with head.
 1.3.4.1 26-Jun-2006  yamt sync with head.
 1.3.2.2 18-Feb-2006  yamt sync with head.
 1.3.2.1 15-Feb-2006  yamt file linux32_syscalls.c was added on branch yamt-uio_vmspace on 2006-02-18 15:38:59 +0000
 1.9.4.2 09-Sep-2006  rpaulo sync with head
 1.9.4.1 06-Sep-2006  rpaulo file linux32_syscalls.c was added on branch rpaulo-netinet-merge-pcb on 2006-09-09 02:45:52 +0000
 1.9.2.3 09-Feb-2007  ad Sync with HEAD.
 1.9.2.2 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.9.2.1 18-Nov-2006  ad Sync with head.
 1.10.4.2 20-Apr-2007  bouyer regen for ticket #582
 1.10.4.1 02-Apr-2007  bouyer Regen for ticket #544
 1.14.2.3 07-May-2007  yamt sync with head.
 1.14.2.2 15-Apr-2007  yamt sync with head.
 1.14.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.15.4.1 11-Jul-2007  mjf Sync with head.
 1.15.2.1 27-May-2007  ad Sync with head.
 1.17.12.2 18-Nov-2007  bouyer Sync with HEAD
 1.17.12.1 13-Nov-2007  bouyer Sync with HEAD
 1.17.8.4 23-Mar-2008  matt sync with HEAD
 1.17.8.3 09-Jan-2008  matt sync with HEAD
 1.17.8.2 08-Nov-2007  matt sync with -HEAD
 1.17.8.1 06-Nov-2007  matt sync with HEAD
 1.17.6.6 21-Nov-2007  joerg Sync with HEAD.
 1.17.6.5 14-Nov-2007  joerg Sync with HEAD.
 1.17.6.4 11-Nov-2007  joerg Sync with HEAD.
 1.17.6.3 04-Nov-2007  jmcneill Sync with HEAD.
 1.17.6.2 31-Oct-2007  joerg Sync with HEAD.
 1.17.6.1 28-Oct-2007  joerg Sync with HEAD.
 1.20.2.3 18-Feb-2008  mjf Sync with HEAD.
 1.20.2.2 27-Dec-2007  mjf Sync with HEAD.
 1.20.2.1 19-Nov-2007  mjf Sync with HEAD.
 1.23.6.3 19-Jan-2008  bouyer Sync with HEAD
 1.23.6.2 08-Jan-2008  bouyer Sync with HEAD
 1.23.6.1 02-Jan-2008  bouyer Sync with HEAD
 1.23.2.1 26-Dec-2007  ad Sync with head.
 1.34.6.4 17-Jan-2009  mjf Sync with HEAD.
 1.34.6.3 28-Sep-2008  mjf Sync with HEAD.
 1.34.6.2 29-Jun-2008  mjf Sync with HEAD.
 1.34.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.36.6.3 10-Oct-2008  skrll Sync with HEAD.
 1.36.6.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.36.6.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.36.4.4 11-Aug-2010  yamt sync with head.
 1.36.4.3 11-Mar-2010  yamt sync with head
 1.36.4.2 20-Jun-2009  yamt sync with head
 1.36.4.1 04-May-2009  yamt sync with head.
 1.36.2.2 17-Jun-2008  yamt sync with head.
 1.36.2.1 04-Jun-2008  yamt sync with head
 1.37.2.2 28-Jul-2008  simonb Sync with head.
 1.37.2.1 18-Jun-2008  simonb Sync with head.
 1.38.2.2 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.38.2.1 19-Oct-2008  haad Sync with HEAD.
 1.41.4.2 18-Mar-2015  snj regen for ticket 1149
 1.41.4.1 20-Nov-2008  snj Regen for ticket 81.
 1.41.2.2 03-Mar-2009  skrll Sync with HEAD.
 1.41.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.47.2.2 04-Jan-2009  christos use compat_50 syscalls where appropriate.
 1.47.2.1 12-Dec-2008  christos file linux32_syscalls.c was added on branch christos-time_t on 2009-01-04 01:58:39 +0000
 1.53.2.1 23-Jul-2009  jym Sync with HEAD.
 1.58.4.3 31-May-2011  rmind sync with head
 1.58.4.2 21-Apr-2011  rmind sync with head
 1.58.4.1 05-Mar-2011  rmind sync with head
 1.58.2.2 06-Nov-2010  uebayasi Sync with HEAD.
 1.58.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.60.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.63.4.4 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.4.3 30-Oct-2012  yamt sync with head
 1.63.4.2 23-May-2012  yamt sync with head.
 1.63.4.1 17-Apr-2012  yamt sync with head
 1.65.6.2 20-Jul-2012  riz Pull up following revision(s) (requested by christos in ticket #424):
sys/compat/linux32/arch/amd64/linux32_syscallargs.h: revision 1.67
sys/compat/linux32/arch/amd64/syscalls.master: revision 1.62
sys/compat/linux32/arch/amd64/linux32_syscall.h: revision 1.67
sys/compat/linux32/arch/amd64/linux32_sysent.c: revision 1.67
sys/compat/linux32/arch/amd64/linux32_syscalls.c: revision 1.67
add xattr stubs
regen
 1.65.6.1 19-May-2012  riz Pull up following revision(s) (requested by christos in ticket #263):
sys/compat/linux32/arch/amd64/linux32_syscallargs.h: revision 1.66
sys/compat/linux32/arch/amd64/syscalls.master: revision 1.61
sys/compat/linux32/common/linux32_signal.c: revision 1.16
sys/compat/linux32/arch/amd64/linux32_syscall.h: revision 1.66
sys/compat/linux32/arch/amd64/linux32_sysent.c: revision 1.66
sys/compat/linux32/arch/amd64/linux32_syscalls.c: revision 1.66
regen
Fix rt_sigtimedwait():
It is wishful thinking that:
1. declaring a 32 bit syscall with 64 bit pointers
2. passing a struct with 32 bit pointers to a 64 bit function
is going to work.
 1.65.4.1 02-Jun-2012  mrg sync to latest -current.
 1.67.4.1 18-May-2014  rmind sync with head
 1.67.2.2 03-Dec-2017  jdolecek update from HEAD
 1.67.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.70.2.1 10-Aug-2014  tls Rebase.
 1.73.2.2 05-Feb-2017  skrll Sync with HEAD
 1.73.2.1 06-Apr-2015  skrll Sync with HEAD
 1.75.2.1 20-Mar-2017  pgoyette Sync with HEAD
 1.76.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.77.4.1 11-May-2017  pgoyette Sync with HEAD
 1.78.10.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.78.10.1 10-Jun-2019  christos Sync with HEAD
 1.78.8.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.81.2.3 03-Jan-2021  thorpej Regen for preadv(2) and pwritev(2).
 1.81.2.2 17-Dec-2020  thorpej Regen for POSIX timers and timerfd.
 1.81.2.1 16-Dec-2020  thorpej Regen for eventfd.
 1.87 02-Dec-2021  ryo regen
 1.86 27-Nov-2021  ryo regen
 1.85 20-Sep-2021  thorpej Regen for preadv(2) / pwritev(2).
 1.84 20-Sep-2021  thorpej Regen for eventfd.
 1.83 19-Sep-2021  thorpej Regen for timerfd.
 1.82 19-Sep-2021  thorpej Regen for POSIX timer syscalls.
 1.81 26-Apr-2020  thorpej branches: 1.81.2;
Regen for native futex calls.
 1.80 09-Nov-2019  jdolecek regen
 1.79 10-Aug-2018  pgoyette Regen
 1.78 10-May-2017  riastradh branches: 1.78.8; 1.78.10;
regen
 1.77 16-Jan-2017  christos branches: 1.77.4;
descend and regen
 1.76 13-Jan-2017  christos branches: 1.76.2;
regen
 1.75 08-Mar-2015  christos branches: 1.75.2;
regen
 1.74 07-Mar-2015  christos regen
 1.73 22-Nov-2014  njoly branches: 1.73.2;
Regen for ppoll(2)
 1.72 29-May-2014  njoly Regen for utimes(2).
 1.71 04-May-2014  njoly Regen for pread/pwrite 64bit offset argument.
 1.70 18-Nov-2013  christos branches: 1.70.2;
Regen
 1.69 18-Nov-2013  chs regen
 1.68 07-Nov-2013  njoly Regen for dup/dup2/dup3 argument types fix.
 1.67 13-Jul-2012  christos branches: 1.67.2; 1.67.4;
regen
 1.66 10-May-2012  christos regen
 1.65 18-Nov-2011  christos branches: 1.65.4; 1.65.6;
regen
 1.64 18-Nov-2011  christos add sigtimedwait support
 1.63 30-May-2011  alnsn branches: 1.63.4;
Regenerate files to pick up correct RCS Ids. Suggested by Chris Badura.
 1.62 30-May-2011  alnsn Add fadvise64 and fadvise64_64 syscalls to compat_linux and compat_linux32.
 1.61 10-Apr-2011  christos Regen: XXX: produces errors because of rump changes!
 1.60 02-Nov-2010  chs branches: 1.60.2;
regen
 1.59 07-Jul-2010  chs regen
 1.58 24-Nov-2009  njoly branches: 1.58.2; 1.58.4;
Regen for personality(2) update.
 1.57 08-Jun-2009  njoly Regen for rt_queueinfo addition.
 1.56 05-Jun-2009  njoly Regen for fstatfs.
 1.55 04-Jun-2009  njoly Regen for stat/lstat/fstat syscalls.
 1.54 02-Jun-2009  njoly Regen for siggetmask/sigsetmask.
 1.53 30-Jan-2009  njoly branches: 1.53.2;
Regen for mincore(2).
 1.52 20-Jan-2009  njoly Regen for personality(2) addition.
 1.51 17-Jan-2009  njoly Regen for wait4 update.
 1.50 16-Jan-2009  njoly Regen for compat 50 update.
 1.49 13-Jan-2009  pooka Regen to prove I didn't screw up the conversion: purely RCSID changes.
 1.48 11-Jan-2009  christos merge christos-time_t
 1.47 12-Dec-2008  njoly branches: 1.47.2;
Regen for clock_nanosleep.
 1.46 06-Dec-2008  njoly Regen for netbsd32_caddr_t removal.
 1.45 05-Dec-2008  njoly Regen for getres{uid,gid} syscalls.
 1.44 01-Dec-2008  njoly Regen for sched_get_priority_{min,max}.
 1.43 19-Nov-2008  ad Regen.
 1.42 12-Nov-2008  njoly Regen for nanosleep(2) fix.
 1.41 06-Oct-2008  njoly branches: 1.41.2; 1.41.4;
Regen.
 1.40 22-Sep-2008  njoly Regen after cleanup.
 1.39 24-Jul-2008  njoly Regen for rt_sigpending.
 1.38 16-Jun-2008  christos branches: 1.38.2;
regen
 1.37 20-May-2008  njoly branches: 1.37.2;
Regen for ipc(2) syscall support.
 1.36 17-Apr-2008  njoly branches: 1.36.2; 1.36.4; 1.36.6;
Regen for sys_clock_{getres,gettime,settime} syscalls.
 1.35 04-Apr-2008  njoly Regen for msync(2) support.
 1.34 20-Feb-2008  njoly branches: 1.34.6;
Regen for mlock/munlock syscalls
 1.33 17-Feb-2008  njoly Regen for pread/pwrite fixes.
 1.32 04-Feb-2008  dsl Regen for merging fcntl() and fcntl64().
 1.31 02-Feb-2008  dsl Regen for pread and pwrite
 1.30 15-Jan-2008  njoly Regen.
 1.29 07-Jan-2008  njoly Regen.
 1.28 26-Dec-2007  njoly Regen for readdir syscall.
 1.27 24-Dec-2007  njoly Regen for old_uname syscall.
 1.26 24-Dec-2007  njoly Regen for getpgid.
 1.25 21-Dec-2007  njoly Regen for getfsuid/setfsgid syscall exchange.
 1.24 20-Dec-2007  dsl regen
 1.23 16-Nov-2007  njoly branches: 1.23.2; 1.23.6;
Regen.
 1.22 11-Nov-2007  christos regen
 1.21 07-Nov-2007  njoly Regen for 64-bit linux syscalls removal.
 1.20 31-Oct-2007  dsl branches: 1.20.2;
regen
 1.19 31-Oct-2007  njoly Regen for syscalls cleanup.
 1.18 27-Oct-2007  njoly Regen for chown additions.
 1.17 20-Apr-2007  njoly branches: 1.17.6; 1.17.8; 1.17.12;
Regen (ftruncate fix).
 1.16 11-Apr-2007  njoly Regen (statfs support).
 1.15 05-Mar-2007  christos branches: 1.15.2; 1.15.4;
fix caddr_t lossage.
 1.14 16-Feb-2007  njoly branches: 1.14.2;
Regen.
 1.13 09-Feb-2007  ad Merge newlock2 to head.
 1.12 08-Feb-2007  njoly Regen (aliases cleanup).
 1.11 07-Feb-2007  njoly Regen (poll argument fix).
 1.10 13-Sep-2006  manu branches: 1.10.4;
Jumbo COMPAT_LINUX/COMPAT_LINUX32 bugfix, with the help of Nicolas Joly
- Fix shmat return value on amd64: it uses no black magic with retval[0]
- Fix integer overflows in sysinfo
- Implement sysinfo, mmap2, sched_getparam, sched_getscheduler, mremap,
and madvise in COMPAT_LINUX32
- Fix improper types used in setgroups16/getgroups16
- Implement mmap2 for COMPAT_LINUX32
- Ifdef debug messages by DEBUG_LINUX
 1.9 06-Sep-2006  manu branches: 1.9.2; 1.9.4;
Implement Linux's fdatasync, patch from Nicolas Joly
 1.8 06-Sep-2006  manu Fix linux32_sys_setres{uid|gid}: -1 does not means the same thing on i386
and amd64...
 1.7 05-Sep-2006  manu typo
 1.6 01-Sep-2006  matt Regen.
 1.5 25-Jun-2006  manu Regen
 1.4 25-Jun-2006  manu - Complete exit_group() implementation. We now maintain a list of Linux
threads in a processes and kill them properly. The code is a bit too
complicated, but I could not find a simplier way of dealing with it

- Change getpid() and getppid() semantics to match what Linux does,
and implement gettid(). In the Linux kernel, threads are implemnted
as plain old processes. A thread group is just a set of processes,
with the parent called leader. Thread ID, which are returned by gettid(),
are just the PID of the plain old processes, and getpid() returns the
PID of the thread group leader.

- Remove struct linux32_emuldata. COMPAT_LINUX32 uses a lot of COMPAT_LINUX
code, where a struct linux_emuldata is assumed. By having distinct emuldata
structure with different sizes and layouts, we caused kernel memory
corruptions.

- Fix setprioriry() and getpriority()

Thanks to Nicolas Joly for tracking down the problem and providing me the
hardware to fix them.
 1.3 15-Feb-2006  manu branches: 1.3.2; 1.3.4; 1.3.10; 1.3.14; 1.3.16;
Add getcwd (for real this time), fix dup and dup2
 1.2 15-Feb-2006  manu - Move the BSD to Linux and Linux to BSD termio/termios conversion functions
to a header where they can be shared between COMPAT_LINUX and COMPAT_LINUX32
- Add termios ioctl emulation to COMPAT_LINUX32
- Add the getcwd system call to COMPAT_LINUX32/amd64

That makes Linux's bash working with COMPAT_LINUX32.
 1.1 09-Feb-2006  manu Add initial (but unfinished) COMPAT_LINUX32 for amd64. This is good enough so
that the i386 license manager part of amd64 version of Fluent works.

While I'm here, add SysV IPC to COMPAT_LINUX/amd64
 1.3.16.12 27-Feb-2008  yamt sync with head.
 1.3.16.11 11-Feb-2008  yamt sync with head.
 1.3.16.10 04-Feb-2008  yamt sync with head.
 1.3.16.9 21-Jan-2008  yamt sync with head
 1.3.16.8 07-Dec-2007  yamt sync with head
 1.3.16.7 15-Nov-2007  yamt sync with head.
 1.3.16.6 27-Oct-2007  yamt sync with head.
 1.3.16.5 03-Sep-2007  yamt sync with head.
 1.3.16.4 26-Feb-2007  yamt sync with head.
 1.3.16.3 30-Dec-2006  yamt sync with head.
 1.3.16.2 21-Jun-2006  yamt sync with head.
 1.3.16.1 15-Feb-2006  yamt file linux32_sysent.c was added on branch yamt-lazymbuf on 2006-06-21 14:59:27 +0000
 1.3.14.1 13-Jul-2006  gdamore Merge from HEAD.
 1.3.10.2 22-Apr-2006  simonb Sync with head.
 1.3.10.1 15-Feb-2006  simonb file linux32_sysent.c was added on branch simonb-timecounters on 2006-04-22 11:38:14 +0000
 1.3.4.2 14-Sep-2006  yamt sync with head.
 1.3.4.1 26-Jun-2006  yamt sync with head.
 1.3.2.2 18-Feb-2006  yamt sync with head.
 1.3.2.1 15-Feb-2006  yamt file linux32_sysent.c was added on branch yamt-uio_vmspace on 2006-02-18 15:38:59 +0000
 1.9.4.2 09-Sep-2006  rpaulo sync with head
 1.9.4.1 06-Sep-2006  rpaulo file linux32_sysent.c was added on branch rpaulo-netinet-merge-pcb on 2006-09-09 02:45:52 +0000
 1.9.2.3 09-Feb-2007  ad Sync with HEAD.
 1.9.2.2 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.9.2.1 18-Nov-2006  ad Sync with head.
 1.10.4.2 20-Apr-2007  bouyer regen for ticket #582
 1.10.4.1 02-Apr-2007  bouyer Regen for ticket #544
 1.14.2.3 07-May-2007  yamt sync with head.
 1.14.2.2 15-Apr-2007  yamt sync with head.
 1.14.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.15.4.1 11-Jul-2007  mjf Sync with head.
 1.15.2.1 27-May-2007  ad Sync with head.
 1.17.12.2 18-Nov-2007  bouyer Sync with HEAD
 1.17.12.1 13-Nov-2007  bouyer Sync with HEAD
 1.17.8.4 23-Mar-2008  matt sync with HEAD
 1.17.8.3 09-Jan-2008  matt sync with HEAD
 1.17.8.2 08-Nov-2007  matt sync with -HEAD
 1.17.8.1 06-Nov-2007  matt sync with HEAD
 1.17.6.6 21-Nov-2007  joerg Sync with HEAD.
 1.17.6.5 14-Nov-2007  joerg Sync with HEAD.
 1.17.6.4 11-Nov-2007  joerg Sync with HEAD.
 1.17.6.3 04-Nov-2007  jmcneill Sync with HEAD.
 1.17.6.2 31-Oct-2007  joerg Sync with HEAD.
 1.17.6.1 28-Oct-2007  joerg Sync with HEAD.
 1.20.2.3 18-Feb-2008  mjf Sync with HEAD.
 1.20.2.2 27-Dec-2007  mjf Sync with HEAD.
 1.20.2.1 19-Nov-2007  mjf Sync with HEAD.
 1.23.6.3 19-Jan-2008  bouyer Sync with HEAD
 1.23.6.2 08-Jan-2008  bouyer Sync with HEAD
 1.23.6.1 02-Jan-2008  bouyer Sync with HEAD
 1.23.2.1 26-Dec-2007  ad Sync with head.
 1.34.6.4 17-Jan-2009  mjf Sync with HEAD.
 1.34.6.3 28-Sep-2008  mjf Sync with HEAD.
 1.34.6.2 29-Jun-2008  mjf Sync with HEAD.
 1.34.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.36.6.3 10-Oct-2008  skrll Sync with HEAD.
 1.36.6.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.36.6.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.36.4.4 11-Aug-2010  yamt sync with head.
 1.36.4.3 11-Mar-2010  yamt sync with head
 1.36.4.2 20-Jun-2009  yamt sync with head
 1.36.4.1 04-May-2009  yamt sync with head.
 1.36.2.2 17-Jun-2008  yamt sync with head.
 1.36.2.1 04-Jun-2008  yamt sync with head
 1.37.2.2 28-Jul-2008  simonb Sync with head.
 1.37.2.1 18-Jun-2008  simonb Sync with head.
 1.38.2.2 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.38.2.1 19-Oct-2008  haad Sync with HEAD.
 1.41.4.2 18-Mar-2015  snj regen for ticket 1149
 1.41.4.1 20-Nov-2008  snj Regen for ticket 81.
 1.41.2.2 03-Mar-2009  skrll Sync with HEAD.
 1.41.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.47.2.2 04-Jan-2009  christos use compat_50 syscalls where appropriate.
 1.47.2.1 12-Dec-2008  christos file linux32_sysent.c was added on branch christos-time_t on 2009-01-04 01:58:39 +0000
 1.53.2.1 23-Jul-2009  jym Sync with HEAD.
 1.58.4.3 31-May-2011  rmind sync with head
 1.58.4.2 21-Apr-2011  rmind sync with head
 1.58.4.1 05-Mar-2011  rmind sync with head
 1.58.2.2 06-Nov-2010  uebayasi Sync with HEAD.
 1.58.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.60.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.63.4.4 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.4.3 30-Oct-2012  yamt sync with head
 1.63.4.2 23-May-2012  yamt sync with head.
 1.63.4.1 17-Apr-2012  yamt sync with head
 1.65.6.2 20-Jul-2012  riz Pull up following revision(s) (requested by christos in ticket #424):
sys/compat/linux32/arch/amd64/linux32_syscallargs.h: revision 1.67
sys/compat/linux32/arch/amd64/syscalls.master: revision 1.62
sys/compat/linux32/arch/amd64/linux32_syscall.h: revision 1.67
sys/compat/linux32/arch/amd64/linux32_sysent.c: revision 1.67
sys/compat/linux32/arch/amd64/linux32_syscalls.c: revision 1.67
add xattr stubs
regen
 1.65.6.1 19-May-2012  riz Pull up following revision(s) (requested by christos in ticket #263):
sys/compat/linux32/arch/amd64/linux32_syscallargs.h: revision 1.66
sys/compat/linux32/arch/amd64/syscalls.master: revision 1.61
sys/compat/linux32/common/linux32_signal.c: revision 1.16
sys/compat/linux32/arch/amd64/linux32_syscall.h: revision 1.66
sys/compat/linux32/arch/amd64/linux32_sysent.c: revision 1.66
sys/compat/linux32/arch/amd64/linux32_syscalls.c: revision 1.66
regen
Fix rt_sigtimedwait():
It is wishful thinking that:
1. declaring a 32 bit syscall with 64 bit pointers
2. passing a struct with 32 bit pointers to a 64 bit function
is going to work.
 1.65.4.1 02-Jun-2012  mrg sync to latest -current.
 1.67.4.1 18-May-2014  rmind sync with head
 1.67.2.2 03-Dec-2017  jdolecek update from HEAD
 1.67.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.70.2.1 10-Aug-2014  tls Rebase.
 1.73.2.2 05-Feb-2017  skrll Sync with HEAD
 1.73.2.1 06-Apr-2015  skrll Sync with HEAD
 1.75.2.1 20-Mar-2017  pgoyette Sync with HEAD
 1.76.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.77.4.1 11-May-2017  pgoyette Sync with HEAD
 1.78.10.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.78.10.1 10-Jun-2019  christos Sync with HEAD
 1.78.8.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.81.2.3 03-Jan-2021  thorpej Regen for preadv(2) and pwritev(2).
 1.81.2.2 17-Dec-2020  thorpej Regen for POSIX timers and timerfd.
 1.81.2.1 16-Dec-2020  thorpej Regen for eventfd.
 1.14 02-Dec-2021  ryo regen
 1.13 27-Nov-2021  ryo regen
 1.12 20-Sep-2021  thorpej Regen for preadv(2) / pwritev(2).
 1.11 20-Sep-2021  thorpej Regen for eventfd.
 1.10 19-Sep-2021  thorpej Regen for timerfd.
 1.9 19-Sep-2021  thorpej Regen for POSIX timer syscalls.
 1.8 26-Apr-2020  thorpej branches: 1.8.2;
Regen for native futex calls.
 1.7 09-Nov-2019  jdolecek regen
 1.6 10-Aug-2018  pgoyette Regen
 1.5 10-May-2017  riastradh branches: 1.5.8; 1.5.10; 1.5.12;
regen
 1.4 16-Jan-2017  christos branches: 1.4.4;
descend and regen
 1.3 13-Jan-2017  christos branches: 1.3.2;
regen
 1.2 08-Mar-2015  christos branches: 1.2.2; 1.2.4;
regen
 1.1 07-Mar-2015  christos regen
 1.2.4.1 20-Mar-2017  pgoyette Sync with HEAD
 1.2.2.3 05-Feb-2017  skrll Sync with HEAD
 1.2.2.2 06-Apr-2015  skrll Sync with HEAD
 1.2.2.1 08-Mar-2015  skrll file linux32_systrace_args.c was added on branch nick-nhusb on 2015-04-06 15:18:06 +0000
 1.3.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.4.4.1 11-May-2017  pgoyette Sync with HEAD
 1.5.12.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.5.12.1 10-Jun-2019  christos Sync with HEAD
 1.5.10.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.5.8.2 03-Dec-2017  jdolecek update from HEAD
 1.5.8.1 10-May-2017  jdolecek file linux32_systrace_args.c was added on branch tls-maxphys on 2017-12-03 11:36:55 +0000
 1.8.2.3 03-Jan-2021  thorpej Regen for preadv(2) and pwritev(2).
 1.8.2.2 17-Dec-2020  thorpej Regen for POSIX timers and timerfd.
 1.8.2.1 16-Dec-2020  thorpej Regen for eventfd.
 1.2 26-Mar-2007  njoly Sync with recent compat linux termios changes.
 1.1 15-Feb-2006  manu branches: 1.1.2; 1.1.10; 1.1.16; 1.1.22; 1.1.28; 1.1.32; 1.1.34; 1.1.36;
- Move the BSD to Linux and Linux to BSD termio/termios conversion functions
to a header where they can be shared between COMPAT_LINUX and COMPAT_LINUX32
- Add termios ioctl emulation to COMPAT_LINUX32
- Add the getcwd system call to COMPAT_LINUX32/amd64

That makes Linux's bash working with COMPAT_LINUX32.
 1.1.36.1 29-Mar-2007  reinoud Pullup to -current
 1.1.34.1 11-Jul-2007  mjf Sync with head.
 1.1.32.1 10-Apr-2007  ad Sync with head.
 1.1.28.1 15-Apr-2007  yamt sync with head.
 1.1.22.2 09-Sep-2006  rpaulo sync with head
 1.1.22.1 15-Feb-2006  rpaulo file linux32_termios.h was added on branch rpaulo-netinet-merge-pcb on 2006-09-09 02:45:52 +0000
 1.1.16.3 03-Sep-2007  yamt sync with head.
 1.1.16.2 21-Jun-2006  yamt sync with head.
 1.1.16.1 15-Feb-2006  yamt file linux32_termios.h was added on branch yamt-lazymbuf on 2006-06-21 14:59:27 +0000
 1.1.10.2 22-Apr-2006  simonb Sync with head.
 1.1.10.1 15-Feb-2006  simonb file linux32_termios.h was added on branch simonb-timecounters on 2006-04-22 11:38:14 +0000
 1.1.2.2 18-Feb-2006  yamt sync with head.
 1.1.2.1 15-Feb-2006  yamt file linux32_termios.h was added on branch yamt-uio_vmspace on 2006-02-18 15:38:59 +0000
 1.7 07-Jul-2010  chs 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.6 08-Jun-2009  njoly branches: 1.6.2; 1.6.4;
Fix defines against multiple inclusion protection (s/I386/AMD64).
 1.5 04-Sep-2008  njoly branches: 1.5.8;
Make linux32 getdents(2) do its own job instead of calling the
corresponding compat linux function, where struct dirent members types
differs.
 1.4 25-Dec-2007  perry branches: 1.4.6; 1.4.10; 1.4.12; 1.4.16;
Convert many of the uses of __attribute__ to equivalent
__packed, __unused and __dead macros from cdefs.h
 1.3 05-Apr-2007  njoly branches: 1.3.10; 1.3.16; 1.3.18; 1.3.22;
Enable stat/stat64 nsec time support, for amd64 compat linux/linux32.
 1.2 13-Sep-2006  manu branches: 1.2.6; 1.2.10; 1.2.12;
Jumbo COMPAT_LINUX/COMPAT_LINUX32 bugfix, with the help of Nicolas Joly
- Fix shmat return value on amd64: it uses no black magic with retval[0]
- Fix integer overflows in sysinfo
- Implement sysinfo, mmap2, sched_getparam, sched_getscheduler, mremap,
and madvise in COMPAT_LINUX32
- Fix improper types used in setgroups16/getgroups16
- Implement mmap2 for COMPAT_LINUX32
- Ifdef debug messages by DEBUG_LINUX
 1.1 09-Feb-2006  manu branches: 1.1.2; 1.1.4; 1.1.10; 1.1.16; 1.1.20; 1.1.22;
Add initial (but unfinished) COMPAT_LINUX32 for amd64. This is good enough so
that the i386 license manager part of amd64 version of Fluent works.

While I'm here, add SysV IPC to COMPAT_LINUX/amd64
 1.1.22.2 09-Sep-2006  rpaulo sync with head
 1.1.22.1 09-Feb-2006  rpaulo file linux32_types.h was added on branch rpaulo-netinet-merge-pcb on 2006-09-09 02:45:52 +0000
 1.1.20.1 18-Nov-2006  ad Sync with head.
 1.1.16.5 21-Jan-2008  yamt sync with head
 1.1.16.4 03-Sep-2007  yamt sync with head.
 1.1.16.3 30-Dec-2006  yamt sync with head.
 1.1.16.2 21-Jun-2006  yamt sync with head.
 1.1.16.1 09-Feb-2006  yamt file linux32_types.h was added on branch yamt-lazymbuf on 2006-06-21 14:59:27 +0000
 1.1.10.2 22-Apr-2006  simonb Sync with head.
 1.1.10.1 09-Feb-2006  simonb file linux32_types.h was added on branch simonb-timecounters on 2006-04-22 11:38:14 +0000
 1.1.4.1 14-Sep-2006  yamt sync with head.
 1.1.2.2 18-Feb-2006  yamt sync with head.
 1.1.2.1 09-Feb-2006  yamt file linux32_types.h was added on branch yamt-uio_vmspace on 2006-02-18 15:38:59 +0000
 1.2.12.1 11-Jul-2007  mjf Sync with head.
 1.2.10.1 10-Apr-2007  ad Sync with head.
 1.2.6.1 15-Apr-2007  yamt sync with head.
 1.3.22.1 02-Jan-2008  bouyer Sync with HEAD
 1.3.18.1 26-Dec-2007  ad Sync with head.
 1.3.16.1 18-Feb-2008  mjf Sync with HEAD.
 1.3.10.1 09-Jan-2008  matt sync with HEAD
 1.4.16.1 19-Oct-2008  haad Sync with HEAD.
 1.4.12.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.4.10.3 11-Aug-2010  yamt sync with head.
 1.4.10.2 20-Jun-2009  yamt sync with head
 1.4.10.1 04-May-2009  yamt sync with head.
 1.4.6.1 28-Sep-2008  mjf Sync with HEAD.
 1.5.8.1 23-Jul-2009  jym Sync with HEAD.
 1.6.4.1 05-Mar-2011  rmind sync with head
 1.6.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.2 07-Mar-2015  christos Add systrace output file
 1.1 09-Feb-2006  manu branches: 1.1.2; 1.1.10; 1.1.16; 1.1.22; 1.1.122; 1.1.142;
Add initial (but unfinished) COMPAT_LINUX32 for amd64. This is good enough so
that the i386 license manager part of amd64 version of Fluent works.

While I'm here, add SysV IPC to COMPAT_LINUX/amd64
 1.1.142.1 06-Apr-2015  skrll Sync with HEAD
 1.1.122.1 03-Dec-2017  jdolecek update from HEAD
 1.1.22.2 09-Sep-2006  rpaulo sync with head
 1.1.22.1 09-Feb-2006  rpaulo file syscalls.conf was added on branch rpaulo-netinet-merge-pcb on 2006-09-09 02:45:52 +0000
 1.1.16.2 21-Jun-2006  yamt sync with head.
 1.1.16.1 09-Feb-2006  yamt file syscalls.conf was added on branch yamt-lazymbuf on 2006-06-21 14:59:27 +0000
 1.1.10.2 22-Apr-2006  simonb Sync with head.
 1.1.10.1 09-Feb-2006  simonb file syscalls.conf was added on branch simonb-timecounters on 2006-04-22 11:38:14 +0000
 1.1.2.2 18-Feb-2006  yamt sync with head.
 1.1.2.1 09-Feb-2006  yamt file syscalls.conf was added on branch yamt-uio_vmspace on 2006-02-18 15:38:59 +0000
 1.77 02-Dec-2021  ryo add prlimit64(2) syscall to COMPAT_LINUX and COMPAT_LINUX32
 1.76 27-Nov-2021  ryo Add pselect6(2) system call to COMPAT_LINUX32
 1.75 20-Sep-2021  thorpej Add preadv(2) and pwritev(2) system calls to COMPAT_LINUX and COMPAT_LINUX32.
 1.74 20-Sep-2021  thorpej Add the eventfd system calls to COMPAT_LINUX and COMPAT_LINUX32.
 1.73 19-Sep-2021  thorpej Add the timerfd syscalls to COMPAT_LINUX and COMPAT_LINUX32.
 1.72 19-Sep-2021  thorpej Add the POSIX timer syscalls (timer_create(), timer_settime(), timer_gettime(),
timer_getoverrun(), and timer_delete()) to COMPAT_LINUX and COMPAT_LINUX32.
 1.71 26-Apr-2020  thorpej branches: 1.71.2;
Add a NetBSD native futex implementation, mostly written by riastradh@.
Map the COMPAT_LINUX futex calls to the native ones.
 1.70 09-Nov-2019  jdolecek add dummy implementation of linux fallocate() which just returns EOPNOTSUPP;
this is needed so that glibc falls back to emulation and apps behaving
properly, since EOPNOTSUPP is a documented and expected return code, but
ENOSYS is not

right now there are no filesystems in NetBSD tree supporting the fallocate
VOP, so no point trying to map this to a native call

supposed to help with problem reported in
https://mail-index.netbsd.org/tech-kern/2019/11/03/msg025641.html
 1.69 08-Mar-2015  christos branches: 1.69.18;
fix inconsistent names
 1.68 22-Nov-2014  njoly branches: 1.68.2;
Add ppoll(2) for compat linux32.
 1.67 29-May-2014  njoly Add utimes(2) support.
 1.66 04-May-2014  njoly Fix pread/pwrite syscalls which need a 64bit offset argument.
 1.65 18-Nov-2013  christos branches: 1.65.2;
Fix extended attribute syscalls to use the proper types and call their netbsd32
counterparts for now.
 1.64 18-Nov-2013  chs implement the *at() syscalls.
bring the unimplemented syscall list up to date.
 1.63 07-Nov-2013  njoly Fix dup/dup2/dup3 argument types (u_int -> int).
 1.62 13-Jul-2012  christos branches: 1.62.2; 1.62.4;
add xattr stubs
 1.61 10-May-2012  christos Fix rt_sigtimedwait():
It is wishful thinking that:
1. declaring a 32 bit syscall with 64 bit pointers
2. passing a struct with 32 bit pointers to a 64 bit function
is going to work.
 1.60 18-Nov-2011  christos branches: 1.60.4; 1.60.6;
add sigtimedwait support
 1.59 30-May-2011  alnsn branches: 1.59.4;
Add fadvise64 and fadvise64_64 syscalls to compat_linux and compat_linux32.
 1.58 10-Apr-2011  christos add pipe2 and dup3
 1.57 02-Nov-2010  chs branches: 1.57.2;
implement the following syscalls for linux32:
truncate64
ftruncate64
profil
ioperm
iopl
setdomainname
modify_ldt
statfs64
fstatfs64

note that iopl(), ioperm() and modify_ldt() just call
the respective 64-bit handlers, which don't do anything yet.
 1.56 07-Jul-2010  chs 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.55 24-Nov-2009  njoly branches: 1.55.2; 1.55.4;
Update personality(2) to match Linux definition where the argument is an
unsigned long.
 1.54 08-Jun-2009  njoly Add rt_queueinfo(2) support.
 1.53 05-Jun-2009  njoly Add fstatfs syscall.
 1.52 04-Jun-2009  njoly Add stat/lstat/fstat syscalls.
 1.51 02-Jun-2009  njoly Add siggetmask/sigsetmask syscalls.
 1.50 30-Jan-2009  njoly branches: 1.50.2;
Add mincore syscall.
 1.49 20-Jan-2009  njoly Add basic support for linux32 personality(2) syscall.
 1.48 17-Jan-2009  njoly Convert linux/linux32 wait(4) to use a compat50 rusage structure.
 1.47 16-Jan-2009  njoly Update some syscalls that now needs compat50 timeval structure.
 1.46 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.45 11-Jan-2009  christos merge christos-time_t
 1.44 12-Dec-2008  njoly branches: 1.44.2;
Add clock_nanosleep syscall.
 1.43 06-Dec-2008  njoly Cleanup; kill netbsd32_caddr_t use.
 1.42 05-Dec-2008  njoly Add getres{uid,gid} syscalls.
 1.41 01-Dec-2008  njoly Add sched_get_priority_{min,max} syscalls.
 1.40 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.39 12-Nov-2008  njoly Fix nanosleep(2) on 64-bit archs. Do not call native nanosleep
syscall, but rather a modified version the will take care of `struct
timespec' conversions.
 1.38 06-Oct-2008  njoly branches: 1.38.2; 1.38.4;
Cleanup. Reduce diffs against netbsd32 syscalls.master.
- Remove const keyword for pointer types.
- Update some argument types.
 1.37 22-Sep-2008  njoly Kill a few linux32 syscalls identical to netbsd32 ones.
No functional changes expected.
 1.36 24-Jul-2008  njoly Add rt_sigpending syscall.
 1.35 16-Jun-2008  christos branches: 1.35.2;
an attempt at ptrace32
 1.34 20-May-2008  njoly branches: 1.34.2;
Add compat linux32 ipc(2) syscall support, for shared memory and
semaphores.
 1.33 17-Apr-2008  njoly branches: 1.33.2; 1.33.4; 1.33.6;
Add compat linux32 sys_clock_{getres,gettime,settime} syscalls.
 1.32 04-Apr-2008  njoly Add msync(2) syscall.
 1.31 20-Feb-2008  njoly branches: 1.31.6;
Add mlock/munlock syscalls
 1.30 17-Feb-2008  njoly pread/pwrite fixes: use SCARG_P32 to access pointers, and update
syscalls definitions.
 1.29 04-Feb-2008  dsl Use the same function to implement linux32_sys_fcntl() and linux_sys_fcntl64().
A rather excessive amount of 'appending 64' to names seems to have happened
when linux won support for files > 4G.
technically the linux32_sys_fcntl() function should error the 64bit file
locking requests - but life is too short.
 1.28 02-Feb-2008  dsl Impletemt pread() and pwrite().
 1.27 15-Jan-2008  njoly compat linux (and linux32) uid16 functions cleanup and fixes.

- Move uid16 functions to their own file linux_uid16.c, included by
needed archs (arm, i386 and m68k).
- Add new MI types linux_{u,g}id16_t.
- Add macros to handle linux_uid16_t and uid_t conversions.
- Add linux_sys_getres{uid,gid}16 syscalls, to fix an overflow with
bad sizes given to copyout when linux_sys_getres{uid,gid} are used.
- Update arm syscall table to use more uid16 functions.
 1.26 07-Jan-2008  njoly Remove wrong linux32_sys_mmap2_args define.
 1.25 26-Dec-2007  njoly Add readdir syscall.
 1.24 24-Dec-2007  njoly Add old_uname syscall.
 1.23 24-Dec-2007  njoly Add getpgid syscall.
 1.22 21-Dec-2007  njoly - Fix setfsuid to return uid on success.
- Replace getfsuid, which never existed on Linux, by correct setfsgid
syscall.

ok by christos and dsl.
 1.21 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.20 16-Nov-2007  njoly branches: 1.20.2; 1.20.6;
Update, for linux_sys_readlink() removal.
 1.19 07-Nov-2007  njoly Remove remaining 64-bit compat linux syscalls linux_sys_xxx() (except
for ones without arguments), and replace them by their 32-bit
equivalent linux32_sys_xxxx().
 1.18 31-Oct-2007  dsl branches: 1.18.2;
This file must use the netbsd32_xxx() system calls, not the sys_xxx() ones.
The latter actually function (due to luck) for calls with one argument,
but will fail badly if more than one is required.
Noticed as an error in the ktrace outut by Nicolas Joly, reported on
tech-kern.
 1.17 31-Oct-2007  njoly compat linux32 syscalls cleanup.

With stackgap and CHECK_ALT_xxx removal, some linux32 and netbsd32
syscalls are now identical.
To avoid code duplication, remove the linux32 definition and use the
netbsd32 one (no functional change).
 1.16 27-Oct-2007  njoly Add missing chown's syscalls family members.
This makes chown(1)/chgrp(1) works under compat linux32.

Problem reported and fix tested by Arto Huusko. Thanks.
 1.15 20-Apr-2007  njoly branches: 1.15.6; 1.15.8; 1.15.12;
Fix ftruncate syscall. Do not use compat_43_sys_ftruncate, but
compat_43_netbsd32_oftruncate instead.
 1.14 11-Apr-2007  njoly - Add compat amd64 linux32 statfs support, adapted from PR/35956.
- Move bsd_to_linux_statfs() function to its own file to be shared
between both linux compats.

ok by manu.
 1.13 05-Mar-2007  christos branches: 1.13.2; 1.13.4;
fix caddr_t lossage.
 1.12 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.11 16-Feb-2007  njoly branches: 1.11.2;
Add support for a few syscalls:
setfsuid16/getfsuid16
setfsuid/getfsuid
sched_yield

ok by manu
 1.10 09-Feb-2007  ad Merge newlock2 to head.
 1.9 08-Feb-2007  njoly Remove some aliases, for syscalls that use their netbsd32 equivalent.
This makes the ktrace output more consistent.

ok by manu.
 1.8 07-Feb-2007  njoly Use netbsd32_pollfdp_t instead of wrong `struct pollfd *'.

ok by manu.
 1.7 13-Sep-2006  manu branches: 1.7.4;
Jumbo COMPAT_LINUX/COMPAT_LINUX32 bugfix, with the help of Nicolas Joly
- Fix shmat return value on amd64: it uses no black magic with retval[0]
- Fix integer overflows in sysinfo
- Implement sysinfo, mmap2, sched_getparam, sched_getscheduler, mremap,
and madvise in COMPAT_LINUX32
- Fix improper types used in setgroups16/getgroups16
- Implement mmap2 for COMPAT_LINUX32
- Ifdef debug messages by DEBUG_LINUX
 1.6 06-Sep-2006  manu branches: 1.6.2; 1.6.4;
Implement Linux's fdatasync, patch from Nicolas Joly
 1.5 06-Sep-2006  manu Fix linux32_sys_setres{uid|gid}: -1 does not means the same thing on i386
and amd64...
 1.4 05-Sep-2006  manu typo
 1.3 25-Jun-2006  manu - Complete exit_group() implementation. We now maintain a list of Linux
threads in a processes and kill them properly. The code is a bit too
complicated, but I could not find a simplier way of dealing with it

- Change getpid() and getppid() semantics to match what Linux does,
and implement gettid(). In the Linux kernel, threads are implemnted
as plain old processes. A thread group is just a set of processes,
with the parent called leader. Thread ID, which are returned by gettid(),
are just the PID of the plain old processes, and getpid() returns the
PID of the thread group leader.

- Remove struct linux32_emuldata. COMPAT_LINUX32 uses a lot of COMPAT_LINUX
code, where a struct linux_emuldata is assumed. By having distinct emuldata
structure with different sizes and layouts, we caused kernel memory
corruptions.

- Fix setprioriry() and getpriority()

Thanks to Nicolas Joly for tracking down the problem and providing me the
hardware to fix them.
 1.2 15-Feb-2006  manu branches: 1.2.2; 1.2.4; 1.2.10; 1.2.14; 1.2.16;
Add getcwd (for real this time), fix dup and dup2
 1.1 09-Feb-2006  manu Add initial (but unfinished) COMPAT_LINUX32 for amd64. This is good enough so
that the i386 license manager part of amd64 version of Fluent works.

While I'm here, add SysV IPC to COMPAT_LINUX/amd64
 1.2.16.12 27-Feb-2008  yamt sync with head.
 1.2.16.11 11-Feb-2008  yamt sync with head.
 1.2.16.10 04-Feb-2008  yamt sync with head.
 1.2.16.9 21-Jan-2008  yamt sync with head
 1.2.16.8 07-Dec-2007  yamt sync with head
 1.2.16.7 15-Nov-2007  yamt sync with head.
 1.2.16.6 27-Oct-2007  yamt sync with head.
 1.2.16.5 03-Sep-2007  yamt sync with head.
 1.2.16.4 26-Feb-2007  yamt sync with head.
 1.2.16.3 30-Dec-2006  yamt sync with head.
 1.2.16.2 21-Jun-2006  yamt sync with head.
 1.2.16.1 15-Feb-2006  yamt file syscalls.master was added on branch yamt-lazymbuf on 2006-06-21 14:59:27 +0000
 1.2.14.1 13-Jul-2006  gdamore Merge from HEAD.
 1.2.10.2 22-Apr-2006  simonb Sync with head.
 1.2.10.1 15-Feb-2006  simonb file syscalls.master was added on branch simonb-timecounters on 2006-04-22 11:38:14 +0000
 1.2.4.2 14-Sep-2006  yamt sync with head.
 1.2.4.1 26-Jun-2006  yamt sync with head.
 1.2.2.2 18-Feb-2006  yamt sync with head.
 1.2.2.1 15-Feb-2006  yamt file syscalls.master was added on branch yamt-uio_vmspace on 2006-02-18 15:38:59 +0000
 1.6.4.2 09-Sep-2006  rpaulo sync with head
 1.6.4.1 06-Sep-2006  rpaulo file syscalls.master was added on branch rpaulo-netinet-merge-pcb on 2006-09-09 02:45:52 +0000
 1.6.2.3 09-Feb-2007  ad Sync with HEAD.
 1.6.2.2 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.6.2.1 18-Nov-2006  ad Sync with head.
 1.7.4.2 20-Apr-2007  bouyer Pull up following revision(s) (requested by njoly in ticket #582):
sys/compat/linux32/common/linux32_types.h: revision 1.4 via patch
sys/compat/linux32/arch/amd64/syscalls.master: revision 1.14 via patch
sys/compat/linux/common/linux_statfs.h: revision 1.1 via patch
sys/compat/linux/common/linux_misc.c: revision 1.170 via patch
sys/compat/linux32/common/linux32_misc.c: revision 1.5 via patch
sys/compat/linux32/files.linux32: revision 1.4 via patch
- Add compat amd64 linux32 statfs support, adapted from PR/35956.
- Move bsd_to_linux_statfs() function to its own file to be shared
between both linux compats.
 1.7.4.1 31-Mar-2007  bouyer Pull up following revision(s) (requested by njoly in ticket #544):
sys/compat/linux32/arch/amd64/syscalls.master: revision 1.11
Add support for a few syscalls:
setfsuid16/getfsuid16
setfsuid/getfsuid
sched_yield
ok by manu
 1.11.2.2 07-May-2007  yamt sync with head.
 1.11.2.1 15-Apr-2007  yamt sync with head.
 1.13.4.1 11-Jul-2007  mjf Sync with head.
 1.13.2.1 27-May-2007  ad Sync with head.
 1.15.12.2 18-Nov-2007  bouyer Sync with HEAD
 1.15.12.1 13-Nov-2007  bouyer Sync with HEAD
 1.15.8.4 23-Mar-2008  matt sync with HEAD
 1.15.8.3 09-Jan-2008  matt sync with HEAD
 1.15.8.2 08-Nov-2007  matt sync with -HEAD
 1.15.8.1 06-Nov-2007  matt sync with HEAD
 1.15.6.5 21-Nov-2007  joerg Sync with HEAD.
 1.15.6.4 11-Nov-2007  joerg Sync with HEAD.
 1.15.6.3 04-Nov-2007  jmcneill Sync with HEAD.
 1.15.6.2 31-Oct-2007  joerg Sync with HEAD.
 1.15.6.1 28-Oct-2007  joerg Sync with HEAD.
 1.18.2.3 18-Feb-2008  mjf Sync with HEAD.
 1.18.2.2 27-Dec-2007  mjf Sync with HEAD.
 1.18.2.1 19-Nov-2007  mjf Sync with HEAD.
 1.20.6.3 19-Jan-2008  bouyer Sync with HEAD
 1.20.6.2 08-Jan-2008  bouyer Sync with HEAD
 1.20.6.1 02-Jan-2008  bouyer Sync with HEAD
 1.20.2.1 26-Dec-2007  ad Sync with head.
 1.31.6.4 17-Jan-2009  mjf Sync with HEAD.
 1.31.6.3 28-Sep-2008  mjf Sync with HEAD.
 1.31.6.2 29-Jun-2008  mjf Sync with HEAD.
 1.31.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.33.6.5 10-Oct-2008  skrll Sync with HEAD.
 1.33.6.4 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.33.6.3 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.33.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.33.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.33.4.4 11-Aug-2010  yamt sync with head.
 1.33.4.3 11-Mar-2010  yamt sync with head
 1.33.4.2 20-Jun-2009  yamt sync with head
 1.33.4.1 04-May-2009  yamt sync with head.
 1.33.2.2 17-Jun-2008  yamt sync with head.
 1.33.2.1 04-Jun-2008  yamt sync with head
 1.34.2.2 28-Jul-2008  simonb Sync with head.
 1.34.2.1 18-Jun-2008  simonb Sync with head.
 1.35.2.2 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.35.2.1 19-Oct-2008  haad Sync with HEAD.
 1.38.4.2 18-Mar-2015  snj Pull up following revision(s) (requested by joerg in ticket #1149):
sys/compat/linux32/arch/amd64/syscalls.master: revisions 1.52, 1.53 via patch
sys/compat/linux32/common/linux32_misc.c: revision 1.17 via patch
sys/compat/linux32/common/linux32_stat.c: revision 1.14-1.16 via patch
Fix inverted lst_ino/__lst_ino assignment in linux32_from_stat().
--
Cleanup (no functional changes).
Kill some unneeded variables and return stattement.
Rename linux32_from_stat() to better bsd_to_linux32_stat64().
Fix some types.
Add stat/lstat/fstat syscalls.
--
Add fstatfs syscall.
 1.38.4.1 20-Nov-2008  snj Pull up following revision(s) (requested by njoly in ticket #81):
sys/compat/linux/arch/mips/syscalls.master: revision 1.30
sys/compat/linux/arch/m68k/syscalls.master: revision 1.63
sys/compat/linux32/arch/amd64/syscalls.master: revision 1.39
sys/compat/linux/arch/alpha/syscalls.master: revision 1.63
sys/compat/linux/arch/powerpc/syscalls.master: revision 1.38
sys/compat/linux32/common/linux32_time.c: revision 1.22
sys/compat/linux/arch/amd64/syscalls.master: revision 1.25
sys/compat/linux/arch/i386/syscalls.master: revision 1.94
sys/compat/linux/arch/arm/syscalls.master: revision 1.36
sys/compat/linux/common/linux_time.c: revision 1.26
Fix nanosleep(2) on 64-bit archs. Do not call native nanosleep
syscall, but rather a modified version the will take care of `struct
timespec' conversions.
 1.38.2.2 03-Mar-2009  skrll Sync with HEAD.
 1.38.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.44.2.2 04-Jan-2009  christos use compat_50 syscalls where appropriate.
 1.44.2.1 12-Dec-2008  christos file syscalls.master was added on branch christos-time_t on 2009-01-04 01:58:39 +0000
 1.50.2.1 23-Jul-2009  jym Sync with HEAD.
 1.55.4.3 31-May-2011  rmind sync with head
 1.55.4.2 21-Apr-2011  rmind sync with head
 1.55.4.1 05-Mar-2011  rmind sync with head
 1.55.2.2 06-Nov-2010  uebayasi Sync with HEAD.
 1.55.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.57.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.59.4.4 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.59.4.3 30-Oct-2012  yamt sync with head
 1.59.4.2 23-May-2012  yamt sync with head.
 1.59.4.1 17-Apr-2012  yamt sync with head
 1.60.6.2 20-Jul-2012  riz Pull up following revision(s) (requested by christos in ticket #424):
sys/compat/linux32/arch/amd64/linux32_syscallargs.h: revision 1.67
sys/compat/linux32/arch/amd64/syscalls.master: revision 1.62
sys/compat/linux32/arch/amd64/linux32_syscall.h: revision 1.67
sys/compat/linux32/arch/amd64/linux32_sysent.c: revision 1.67
sys/compat/linux32/arch/amd64/linux32_syscalls.c: revision 1.67
add xattr stubs
regen
 1.60.6.1 19-May-2012  riz Pull up following revision(s) (requested by christos in ticket #263):
sys/compat/linux32/arch/amd64/linux32_syscallargs.h: revision 1.66
sys/compat/linux32/arch/amd64/syscalls.master: revision 1.61
sys/compat/linux32/common/linux32_signal.c: revision 1.16
sys/compat/linux32/arch/amd64/linux32_syscall.h: revision 1.66
sys/compat/linux32/arch/amd64/linux32_sysent.c: revision 1.66
sys/compat/linux32/arch/amd64/linux32_syscalls.c: revision 1.66
regen
Fix rt_sigtimedwait():
It is wishful thinking that:
1. declaring a 32 bit syscall with 64 bit pointers
2. passing a struct with 32 bit pointers to a 64 bit function
is going to work.
 1.60.4.1 02-Jun-2012  mrg sync to latest -current.
 1.62.4.1 18-May-2014  rmind sync with head
 1.62.2.2 03-Dec-2017  jdolecek update from HEAD
 1.62.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.65.2.1 10-Aug-2014  tls Rebase.
 1.68.2.1 06-Apr-2015  skrll Sync with HEAD
 1.69.18.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.71.2.3 03-Jan-2021  thorpej Add preadv(2) and pwritev(2).
 1.71.2.2 17-Dec-2020  thorpej Add POSIX timer and timerfd support to COMPAT_LINUX32.
 1.71.2.1 16-Dec-2020  thorpej Add eventfd glue to COMPAT_LINUX32.

RSS XML Feed