Home | History | Annotate | only in /src/sys/compat/linux/arch/amd64
History log of /src/sys/compat/linux/arch/amd64
RevisionDateAuthorComments
 1.5 01-Oct-2024  riastradh sys/compat/linux/arch: Nix trailing whitespace.

No functional change intended.
 1.4 29-May-2024  christos branches: 1.4.2;
should not be using .include <> but .include "" here.
 1.3 08-Apr-2014  njoly Do not include bsd.kinc.mk in each arch Makefile, it's already pulled
by bsd.syscall.mk (from Makefile.inc).
 1.2 11-Dec-2005  christos branches: 1.2.110; 1.2.120; 1.2.126; 1.2.136;
merge ktrace-lwp.
 1.1 03-May-2005  manu branches: 1.1.8;
First work on COMPAT_LINUX/amd64
Process startup and dynamiclinking work, but processes hang due to
Linux arch_prctl(2) not being really supported yet.
 1.1.8.2 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.1.8.1 03-May-2005  skrll file Makefile was added on branch ktrace-lwp on 2005-11-10 14:00:59 +0000
 1.2.136.1 10-Aug-2014  tls Rebase.
 1.2.126.1 18-May-2014  rmind sync with head
 1.2.120.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.110.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.4.2.1 02-Aug-2025  perseant Sync with HEAD
 1.4 23-Feb-2009  rmind Switch Linux futex emulation to native ucas_int(), remove unecessary
futex-specific assembler routines.

Fixes PR/40490. Reviewed by <ad>.
 1.3 26-Oct-2008  christos branches: 1.3.2; 1.3.4; 1.3.8;
catch up with i386 changes.
 1.2 11-Dec-2005  christos branches: 1.2.70; 1.2.80;
merge ktrace-lwp.
 1.1 03-May-2005  manu branches: 1.1.8;
First work on COMPAT_LINUX/amd64
Process startup and dynamiclinking work, but processes hang due to
Linux arch_prctl(2) not being really supported yet.
 1.1.8.2 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.1.8.1 03-May-2005  skrll file files.linux_amd64 was added on branch ktrace-lwp on 2005-11-10 14:00:59 +0000
 1.2.80.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.2.70.1 17-Jan-2009  mjf Sync with HEAD.
 1.3.8.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.3.4.1 26-Feb-2009  snj Pull up following revision(s) (requested by rmind in ticket #493):
sys/compat/linux/arch/amd64/files.linux_amd64: revision 1.4
sys/compat/linux/arch/amd64/linux_support.S: file removal
sys/compat/linux/common/linux_futex.c: revision 1.23
sys/compat/linux/arch/i386/linux_support.S: file removal
sys/compat/linux/arch/i386/files.linux_i386: revision 1.10
Switch Linux futex emulation to native ucas_int(), remove unecessary
futex-specific assembler routines.
Fixes PR/40490. Reviewed by <ad>.
 1.3.2.1 03-Mar-2009  skrll Sync with HEAD.
 1.13 12-Oct-2021  andvar fix various typos, mainly in comments.
 1.12 03-May-2020  thorpej Always clear FUTEX_PRIVATE_FLAG for Linux processes. NetBSD-native futexes
exist in different namespace depending on FUTEX_PRIVATE_FLAG. This appears
not to be the case in Linux, and some futex users will mix private and non-
private ops on the same futex object. Provide a convenience wrapper that
puts this logic in one place witn a comment explaining why.

While here, move the Linux futex wrapper out of its own file and plop
it in linux_misc.c, which is where it lives in the linux32 module.
 1.11 30-May-2011  alnsn Add fadvise64 and fadvise64_64 syscalls to compat_linux and compat_linux32.
 1.10 02-Mar-2010  pooka branches: 1.10.2; 1.10.4;
Nuke fs_lfs.h included for unknown reasons (if there was a reason
other than "accident", i hereby declare that reason invalid)
 1.9 19-Nov-2008  ad branches: 1.9.6;
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.8 17-Oct-2008  njoly branches: 1.8.2;
Remove unneeded linux_sigaction.c
 1.7 15-Aug-2007  ad branches: 1.7.22; 1.7.26; 1.7.28; 1.7.32;
Changes to make ktrace LKM friendly and reduce ifdef KTRACE. Proposed
on tech-kern.
 1.6 09-Feb-2007  ad branches: 1.6.6; 1.6.14; 1.6.18;
Merge newlock2 to head.
 1.5 09-Feb-2006  manu branches: 1.5.14;
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.4 11-Dec-2005  christos branches: 1.4.2; 1.4.4; 1.4.6;
merge ktrace-lwp.
 1.3 04-Nov-2005  manu branches: 1.3.2;
Implement Linux futex and gettid system calls for amd64
 1.2 31-Oct-2005  manu build fix
 1.1 03-May-2005  manu branches: 1.1.2; 1.1.4;
First work on COMPAT_LINUX/amd64
Process startup and dynamiclinking work, but processes hang due to
Linux arch_prctl(2) not being really supported yet.
 1.1.4.1 02-Nov-2005  yamt sync with head.
 1.1.2.3 03-Sep-2007  yamt sync with head.
 1.1.2.2 26-Feb-2007  yamt sync with head.
 1.1.2.1 21-Jun-2006  yamt sync with head.
 1.3.2.2 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.3.2.1 04-Nov-2005  skrll file linux_commons.c was added on branch ktrace-lwp on 2005-11-10 14:00:59 +0000
 1.4.6.1 22-Apr-2006  simonb Sync with head.
 1.4.4.1 09-Sep-2006  rpaulo sync with head
 1.4.2.1 18-Feb-2006  yamt sync with head.
 1.5.14.1 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.6.18.1 16-Aug-2007  jmcneill Sync with HEAD.
 1.6.14.1 03-Sep-2007  skrll Sync with HEAD.
 1.6.6.1 20-Aug-2007  ad Sync with HEAD.
 1.7.32.2 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.7.32.1 19-Oct-2008  haad Sync with HEAD.
 1.7.28.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.7.28.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.7.26.2 11-Mar-2010  yamt sync with head
 1.7.26.1 04-May-2009  yamt sync with head.
 1.7.22.1 17-Jan-2009  mjf Sync with HEAD.
 1.8.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.9.6.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.10.4.1 06-Jun-2011  jruoho Sync with HEAD.
 1.10.2.1 31-May-2011  rmind sync with head
 1.4 01-Oct-2024  riastradh sys/compat/linux/arch: Nix trailing whitespace.

No functional change intended.
 1.3 17-Dec-2013  njoly branches: 1.3.66;
Cleanup compat linux errnos by adding generic errnos in a single file.
Use it for all arches except alpha and mips.
Add a few missing native to linux errno conversions.
 1.2 11-Dec-2005  christos branches: 1.2.110; 1.2.120; 1.2.126;
merge ktrace-lwp.
 1.1 03-May-2005  manu branches: 1.1.8;
First work on COMPAT_LINUX/amd64
Process startup and dynamiclinking work, but processes hang due to
Linux arch_prctl(2) not being really supported yet.
 1.1.8.2 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.1.8.1 03-May-2005  skrll file linux_errno.h was added on branch ktrace-lwp on 2005-11-10 14:00:59 +0000
 1.2.126.1 18-May-2014  rmind sync with head
 1.2.120.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.110.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.3.66.1 02-Aug-2025  perseant Sync with HEAD
 1.7 01-Oct-2024  riastradh sys/compat/linux/arch: Nix trailing whitespace.

No functional change intended.
 1.6 26-Nov-2021  ryo branches: 1.6.10;
- 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.5 18-Nov-2013  chs implement AT_RANDOM.
 1.4 07-Aug-2006  manu branches: 1.4.94; 1.4.104; 1.4.110;
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.3 16-Dec-2005  christos branches: 1.3.4; 1.3.8;
PR/32303: Nicolas Joly: Fix -current amd64 kernel compilation failure with
options COMPAT_LINUX
 1.2 11-Dec-2005  christos merge ktrace-lwp.
 1.1 03-May-2005  manu branches: 1.1.2; 1.1.8;
First work on COMPAT_LINUX/amd64
Process startup and dynamiclinking work, but processes hang due to
Linux arch_prctl(2) not being really supported yet.
 1.1.8.2 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.1.8.1 03-May-2005  skrll file linux_exec.h was added on branch ktrace-lwp on 2005-11-10 14:00:59 +0000
 1.1.2.2 30-Dec-2006  yamt sync with head.
 1.1.2.1 21-Jun-2006  yamt sync with head.
 1.3.8.1 11-Aug-2006  yamt sync with head
 1.3.4.1 09-Sep-2006  rpaulo sync with head
 1.4.110.1 18-May-2014  rmind sync with head
 1.4.104.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.4.94.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.10.1 02-Aug-2025  perseant Sync with HEAD
 1.25 01-Oct-2024  riastradh sys/compat/linux/arch: Nix trailing whitespace.

No functional change intended.
 1.24 05-Sep-2020  riastradh branches: 1.24.26;
Round of uvm.h cleanup.

The poorly named uvm.h is generally supposed to be for uvm-internal
users only.

- Narrow it to files that actually need it -- mostly files that need
to query whether curlwp is the pagedaemon, which should maybe be
exposed by an external header.

- Use uvm_extern.h where feasible and uvm_*.h for things not exposed
by it. We should split up uvm_extern.h but this will serve for now
to reduce the uvm.h dependencies.

- Use uvm_stat.h and #ifdef UVMHIST uvm.h for files that use
UVMHIST(ubchist), since ubchist is declared in uvm.h but the
reference evaporates if UVMHIST is not defined, so we reduce header
file dependencies.

- Make uvm_device.h and uvm_swap.h independently includable while
here.

ok chs@
 1.23 12-Jan-2020  ad Tidy up the vnode locking around execve() on ELF images to acquire and
release the locks fewer times. Proposed on tech-kern a very long time go.
 1.22 23-Feb-2014  njoly branches: 1.22.30; 1.22.36;
Use cprng_strong32 for LINUX_AT_RANDOM on amd64 too.
 1.21 21-Feb-2014  maxv 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.20 18-Nov-2013  chs implement AT_RANDOM.
 1.19 03-Feb-2012  matt branches: 1.19.6; 1.19.10;
Add a hook for freeing an ep_emul_arg. Add a wrapper routine
(exec_free_emul_arg) to call the hook and then clear the ep_emul_arg
and ep_emul_arg_free members in the exec_package.
Change users/accessors to use these routines.
Approved by releng.
 1.18 07-Jul-2010  chs branches: 1.18.8; 1.18.12;
many changes for COMPAT_LINUX:
- update the linux syscall table for each platform.
- support new-style (NPTL) linux pthreads on all platforms.
clone() with CLONE_THREAD uses 1 process with many LWPs
instead of separate processes.
- move the contents of sys__lwp_setprivate() into a new
lwp_setprivate() and use that everywhere.
- update linux_release[] and linux32_release[] to "2.6.18".
- adjust placement of emul fork/exec/exit hooks as needed
and adjust other emul code to match.
- convert all struct emul definitions to use named initializers.
- change the pid allocator to allow multiple pids to refer to the same proc.
- remove a few fields from struct proc that are no longer needed.
- disable the non-functional "vdso" code in linux32/amd64,
glibc works fine without it.
- fix a race in the futex code where we could miss a wakeup after
a requeue operation.
- redo futex locking to be a little more efficient.
 1.17 09-Feb-2010  njoly branches: 1.17.2;
Small typo in comment.
 1.16 29-Mar-2009  mrg branches: 1.16.2;
- add new RLIMIT_AS (aka RLIMIT_VMEM) resource that limits the total
address space available to processes. this limit exists in most other
modern unix variants, and like most of them, our defaults are unlimited.
remove the old mmap / rlimit.datasize hack.

- adds the VMCMD_STACK flag to all the stack-creation vmcmd callers.
it is currently unused, but was added a few years ago.

- add a pair of new process size values to kinfo_proc2{}. one is the
total size of the process memory map, and the other is the total size
adjusted for unused stack space (since most processes have a lot of
this...)

- patch sh, and csh to notice RLIMIT_AS. (in some cases, the alias
RLIMIT_VMEM was already present and used if availble.)

- patch ps, top and systat to notice the new k_vm_vsize member of
kinfo_proc2{}.

- update irix, svr4, svr4_32, linux and osf1 emulations to support
this information. (freebsd could be done, but that it's best left
as part of the full-update of compat/freebsd.)


this addresses PR 7897. it also gives correct memory usage values,
which have never been entirely correct (since mmap), and have been
very incorrect since jemalloc() was enabled.

tested on i386 and sparc64, build tested on several other platforms.

thanks to many folks for feedback and testing but most espcially
chuq and yamt for critical suggestions that lead to this patch not
having a special ugliness i wasn't happy with anyway :-)
 1.15 15-Mar-2009  cegger ansify function definitions
 1.14 20-Nov-2008  ad branches: 1.14.4;
PR port-amd64/39964 modules/compat_linux: missing symbols on amd64
 1.13 28-Oct-2008  christos branches: 1.13.2;
populate init_thread_area.
 1.12 26-Oct-2008  christos branches: 1.12.2;
fix include order; machdep needs to be first for LINUX_NPTL to be defined.
 1.11 25-Oct-2008  christos Add preliminary tls support for i386. Does not work yet. From FreeBSD.
 1.10 19-Oct-2007  ad branches: 1.10.16; 1.10.20; 1.10.26;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.9 29-Jan-2007  hubertf branches: 1.9.6; 1.9.18; 1.9.20; 1.9.24;
Remove more duplicate headers.
Patch by Slava Semushin <slava.semushin@gmail.com>

Again, this was tested by comparing obj files from a pristine and a patched
source tree against an i386/ALL kernel, and also for src/sbin/fsck_ffs,
src/sbin/fsdb and src/usr.sbin/makefs. Only changes in assert() line numbers
were detected in 'objdump -d' output.
 1.8 23-Jul-2006  ad branches: 1.8.4;
Use the LWP cached credentials where sane.
 1.7 15-May-2006  yamt include kauth.h for kauth_cred_getgid.
 1.6 14-May-2006  elad integrate kauth.
 1.5 16-Dec-2005  christos branches: 1.5.4; 1.5.6; 1.5.8; 1.5.10; 1.5.12;
PR/32303: Nicolas Joly: Fix -current amd64 kernel compilation failure with
options COMPAT_LINUX
 1.4 14-Dec-2005  christos proc to lwp change
 1.3 11-Dec-2005  christos merge ktrace-lwp.
 1.2 20-May-2005  fvdl branches: 1.2.2; 1.2.8;
Define linux_usertrap function, and set it in struct emul. For all
but amd64, it just returns 0, doing nothing.

For amd64, it implements vsyscalls through cheating: if the faulting
address is in the vsyscall area (which is statically known on Linux/amd64),
and the intruction pointer is too, it must have been a vsyscall. In that
case, retrieve the return address from the user stack, fix up %rip and
%rsp, and just execute the normal system call. It will return as if
the vsyscall has been executed.
 1.1 03-May-2005  manu First work on COMPAT_LINUX/amd64
Process startup and dynamiclinking work, but processes hang due to
Linux arch_prctl(2) not being really supported yet.
 1.2.8.2 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.2.8.1 20-May-2005  skrll file linux_exec_machdep.c was added on branch ktrace-lwp on 2005-11-10 14:00:59 +0000
 1.2.2.4 27-Oct-2007  yamt sync with head.
 1.2.2.3 26-Feb-2007  yamt sync with head.
 1.2.2.2 30-Dec-2006  yamt sync with head.
 1.2.2.1 21-Jun-2006  yamt sync with head.
 1.5.12.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.5.10.1 08-Mar-2006  elad Adapt to kernel authorization KPI.
 1.5.8.2 11-Aug-2006  yamt sync with head
 1.5.8.1 24-May-2006  yamt sync with head.
 1.5.6.1 01-Jun-2006  kardel Sync with head.
 1.5.4.1 09-Sep-2006  rpaulo sync with head
 1.8.4.1 01-Feb-2007  ad Sync with head.
 1.9.24.1 25-Oct-2007  bouyer Sync with HEAD.
 1.9.20.1 06-Nov-2007  matt sync with HEAD
 1.9.18.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.9.6.1 23-Oct-2007  ad Sync with head.
 1.10.26.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.10.20.3 11-Aug-2010  yamt sync with head.
 1.10.20.2 11-Mar-2010  yamt sync with head
 1.10.20.1 04-May-2009  yamt sync with head.
 1.10.16.1 17-Jan-2009  mjf Sync with HEAD.
 1.12.2.2 28-Apr-2009  skrll Sync with HEAD.
 1.12.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.13.2.1 01-Apr-2009  snj Pull up following revision(s) (requested by mrg in ticket #622):
bin/csh/csh.1: revision 1.46
bin/csh/func.c: revision 1.37
bin/ps/print.c: revision 1.111
bin/ps/ps.c: revision 1.74
bin/sh/miscbltin.c: revision 1.38
bin/sh/sh.1: revision 1.92 via patch
external/bsd/top/dist/machine/m_netbsd.c: revision 1.7
lib/libkvm/kvm_proc.c: revision 1.82
sys/arch/mips/mips/cpu_exec.c: revision 1.55
sys/compat/darwin/darwin_exec.c: revision 1.57
sys/compat/ibcs2/ibcs2_exec.c: revision 1.73
sys/compat/irix/irix_resource.c: revision 1.15
sys/compat/linux/arch/amd64/linux_exec_machdep.c: revision 1.16
sys/compat/linux/arch/i386/linux_exec_machdep.c: revision 1.12
sys/compat/linux/common/linux_limit.h: revision 1.5
sys/compat/osf1/osf1_resource.c: revision 1.14
sys/compat/svr4/svr4_resource.c: revision 1.18
sys/compat/svr4_32/svr4_32_resource.c: revision 1.17
sys/kern/exec_subr.c: revision 1.62
sys/kern/init_sysctl.c: revision 1.160
sys/kern/kern_exec.c: revision 1.288
sys/kern/kern_resource.c: revision 1.151
sys/sys/param.h: patch
sys/sys/resource.h: revision 1.31
sys/sys/sysctl.h: revision 1.184
sys/uvm/uvm_extern.h: revision 1.153
sys/uvm/uvm_glue.c: revision 1.136
sys/uvm/uvm_mmap.c: revision 1.128
usr.bin/systat/ps.c: revision 1.32
- - add new RLIMIT_AS (aka RLIMIT_VMEM) resource that limits the total
address space available to processes. this limit exists in most other
modern unix variants, and like most of them, our defaults are unlimited.
remove the old mmap / rlimit.datasize hack.
- - adds the VMCMD_STACK flag to all the stack-creation vmcmd callers.
it is currently unused, but was added a few years ago.
- - add a pair of new process size values to kinfo_proc2{}. one is the
total size of the process memory map, and the other is the total size
adjusted for unused stack space (since most processes have a lot of
this...)
- - patch sh, and csh to notice RLIMIT_AS. (in some cases, the alias
RLIMIT_VMEM was already present and used if availble.)
- - patch ps, top and systat to notice the new k_vm_vsize member of
kinfo_proc2{}.
- - update irix, svr4, svr4_32, linux and osf1 emulations to support
this information. (freebsd could be done, but that it's best left
as part of the full-update of compat/freebsd.)
this addresses PR 7897. it also gives correct memory usage values,
which have never been entirely correct (since mmap), and have been
very incorrect since jemalloc() was enabled.
tested on i386 and sparc64, build tested on several other platforms.
thanks to many folks for feedback and testing but most espcially
chuq and yamt for critical suggestions that lead to this patch not
having a special ugliness i wasn't happy with anyway :-)
 1.14.4.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.16.2.2 17-Aug-2010  uebayasi Sync with HEAD.
 1.16.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.17.2.1 05-Mar-2011  rmind sync with head
 1.18.12.1 18-Feb-2012  mrg merge to -current.
 1.18.8.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.18.8.1 17-Apr-2012  yamt sync with head
 1.19.10.1 18-May-2014  rmind sync with head
 1.19.6.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.22.36.1 17-Jan-2020  ad Sync with head.
 1.22.30.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.24.26.1 02-Aug-2025  perseant Sync with HEAD
 1.6 01-Oct-2024  riastradh sys/compat/linux/arch: Nix trailing whitespace.

No functional change intended.
 1.5 25-Jun-2014  njoly branches: 1.5.64;
Add a few missing open(2) flags (LINUX_O_*). Fix alpha wrong values.
 1.4 02-Nov-2010  chs branches: 1.4.18; 1.4.32;
define LINUX_O_CLOEXEC.
sort definitions by value.
consistently use hex instead of octal for the values.
 1.3 21-Sep-2010  chs implement O_DIRECTORY as standardized in POSIX-2008,
for both native and linux emulations.
this fixes the rest of PR 43695.
 1.2 11-Dec-2005  christos branches: 1.2.74; 1.2.96; 1.2.98;
merge ktrace-lwp.
 1.1 03-May-2005  manu branches: 1.1.8;
First work on COMPAT_LINUX/amd64
Process startup and dynamiclinking work, but processes hang due to
Linux arch_prctl(2) not being really supported yet.
 1.1.8.2 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.1.8.1 03-May-2005  skrll file linux_fcntl.h was added on branch ktrace-lwp on 2005-11-10 14:00:59 +0000
 1.2.98.1 05-Mar-2011  rmind sync with head
 1.2.96.2 06-Nov-2010  uebayasi Sync with HEAD.
 1.2.96.1 22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.2.74.1 09-Oct-2010  yamt sync with head
 1.4.32.1 10-Aug-2014  tls Rebase.
 1.4.18.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.5.64.1 02-Aug-2025  perseant Sync with HEAD
 1.3 01-Oct-2024  riastradh sys/compat/linux/arch: Nix trailing whitespace.

No functional change intended.
 1.2 11-Dec-2005  christos branches: 1.2.200;
merge ktrace-lwp.
 1.1 03-May-2005  manu branches: 1.1.8;
First work on COMPAT_LINUX/amd64
Process startup and dynamiclinking work, but processes hang due to
Linux arch_prctl(2) not being really supported yet.
 1.1.8.2 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.1.8.1 03-May-2005  skrll file linux_ioctl.h was added on branch ktrace-lwp on 2005-11-10 14:00:59 +0000
 1.2.200.1 02-Aug-2025  perseant Sync with HEAD
 1.62 01-Oct-2024  riastradh sys/compat/linux/arch: Nix trailing whitespace.

No functional change intended.
 1.61 27-Oct-2021  thorpej branches: 1.61.10;
Use __SIGTRAMP_SIGCODE_VERSION rather than hard-coding 0.
 1.60 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.59 23-Aug-2019  maxv Remove printf.
 1.58 19-May-2019  maxv branches: 1.58.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.57 24-Mar-2019  maxv 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.
 1.56 01-Jan-2018  maxv branches: 1.56.4;
Use the default %cs, and mask the other segregs.
 1.55 21-Oct-2017  maxv Include opt_user_ldt.h when needed.
 1.54 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.53 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.52 14-Jul-2017  maxv Don't forget to clean l_md.md_flags, otherwise there may be MDL_COMPAT32,
in which case the kernel would always use iret (slower).
 1.51 13-Feb-2017  maxv branches: 1.51.4; 1.51.6;
Make sure %rip is in userland. This is harmless, since the return to
userland is made with iret instead of sysret in this path. While here, use
size_t.
 1.50 13-Feb-2017  maxv Don't let userland choose %rip. This is the Intel Sysret vulnerability
again.
 1.49 05-Feb-2017  maxv Missing pmap_ldt_cleanup.
 1.48 19-Feb-2014  dsl branches: 1.48.4; 1.48.6; 1.48.8; 1.48.10; 1.48.12; 1.48.14;
Don't rely on pcb.h including x86/include/sysarch.h
 1.47 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.46 11-Feb-2014  dsl Move sys/arch/amd64/amd64/fpu.c and sys/arch/amd64/include/fpu.h
into sys/arch/x86 in preparation for using the same code for i386.
 1.45 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.44 04-Jan-2014  dsl Remove __HAVE_PROCESS_XFPREGS and add the extra parameter for the size
of the fp save area to all the process_read_fpregs() and
process_write_fpregs() functions.
None of the functions have been modified to use the new parameters.
The size is set for all the writes, but some of the arch-specific reads
just pass NULL.
The amd64 (and i386) need variable sized fp register save areas in order
to support AVX and other enhanced register areas.
These functions are rarely called - so the extra argument won't matter.
 1.43 01-Dec-2013  christos revert fpu/pcu changes until we figure out what's wrong; they cause random
freezes
 1.42 18-Nov-2013  chs initialize %ds to something valid to help ptrace().
 1.41 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.40 08-Jul-2012  dsl branches: 1.40.2; 1.40.4;
The MDP_USEDFPU (amd64 and sh3) and MDP_SSTEP (sh3) are lwp flags not
process ones, rename to MDL_xxx.
 1.39 18-Nov-2011  christos branches: 1.39.6; 1.39.10; 1.39.12;
- add sigtimedwait support.
- merge the siginfo population code.
 1.38 07-Jul-2010  chs branches: 1.38.8;
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.37 23-Nov-2009  rmind branches: 1.37.2; 1.37.4;
Use lwp_getpcb() in compat code, clean from struct user.
 1.36 29-May-2009  njoly Add native to linux siginfo si_status translation, used on i386 and
amd64.
 1.35 18-Mar-2009  cegger bzero -> memset
 1.34 26-Oct-2008  christos branches: 1.34.2; 1.34.8;
catch up with i386 changes.
 1.33 19-Oct-2008  njoly 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.32 18-Sep-2008  christos Define a PSL_CLEARSIG macro for the psl flags to be cleared on signal delivery
and use it everywhere.
 1.31 01-Aug-2008  jmcneill linux_sys_rt_sigreturn: properly restore stack flags, pointed out by
Juan RP and modified by myself. ok christos@
 1.30 11-May-2008  jmcneill branches: 1.30.4;
Pull in machine/cpufunc.h for wrmsr definition.
 1.29 24-Apr-2008  ad branches: 1.29.2; 1.29.4;
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.28 05-Jan-2008  dsl branches: 1.28.6; 1.28.8;
Use the new names (_REG_RFLAGS and _REG_RSP) for the indexes of __gregs[]
which match the names of in the trapframe and .S code.
 1.27 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.26 08-Dec-2007  dsl branches: 1.26.4;
ANSIfy most of the function definitions in sys/compat (but not ndis).
All by the magic of sed ...
 1.25 19-Oct-2007  njoly branches: 1.25.2; 1.25.4;
Add compat_linux and exec_linux_elf lkm support for amd64:
- Add needed COMPAT_OSSAUDIO to GENERIC.
- Add missing includes needed by linux_syscallargs.h.
- Add lkm building.
 1.24 03-Oct-2007  ad branches: 1.24.2;
fxsave() is a function, don't re-use the name.
 1.23 24-May-2007  njoly branches: 1.23.6; 1.23.8; 1.23.10;
Fix restart of interrupted system calls.

- Make linux_sys_rt_sigreturn() return EJUSTRETURN on success.
- Add missing rax to linux_sigcontext structure; and save/restore
its value like other members in linux_sendsig()/linux_sys_rt_sigreturn().

With valuable help from manu.
 1.22 21-May-2007  christos rename si_sigval -> si_value to match POSIX RTS.
 1.21 14-Mar-2007  manu Add ptmx fakedevice hack for amd64
Fix a bug in ioctl handling
 1.20 05-Mar-2007  christos branches: 1.20.2; 1.20.4;
more caddr_t lossage.
 1.19 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.18 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.17 15-Feb-2007  ad branches: 1.17.2;
Fix Linux compat on amd64.
 1.16 09-Feb-2007  ad Merge newlock2 to head.
 1.15 20-Sep-2006  manu branches: 1.15.2;
Proprely convert devices on amd64
 1.14 23-Aug-2006  manu branches: 1.14.2; 1.14.4;
1) Complete Linux exit_group() emulation
Members of the thread group must die without reporting to the parent and
without going to zombie stage. We do that by reparenting to init before
catching a SIGKILL. The parent will not see the child death.

The thread group leader must report the exit status, even if it exits
because of another thread calling exit_group(). We do that by storing the
exit status in struct linux_emuldata_shared, and the exit hook has the
duty of setting struct proc's p_xstat for the thread group leader.

2) For exit/fork/exec hooks, move the NPTL specific code to separate functions
that are shared between COMPAT_LINUX and COMPAT_LINUX32

3) Fix LINUX_CLONE_PARENT_SETTID semantics
 1.13 16-Dec-2005  christos branches: 1.13.4; 1.13.8;
PR/32303: Nicolas Joly: Fix -current amd64 kernel compilation failure with
options COMPAT_LINUX
 1.12 11-Dec-2005  christos merge ktrace-lwp.
 1.11 05-Nov-2005  manu branches: 1.11.2;
Instead of ifdef'ing __amd64__ all the Linux NPTL stuff, introduce an
ifdef LINUX_NPTL.
Also implement SETTLS flag to Linux clone()
 1.10 04-Nov-2005  manu build fix
 1.9 24-Jun-2005  manu branches: 1.9.2;
More accurate SIGCHLD code and status for siginfo
 1.8 22-Jun-2005  manu Fix siginfo to return the right child's status.
 1.7 22-Jun-2005  manu Implent CLONE_PARENT_SETTID, CLONE_CHILD_CLEARTID, and CLONE_CHILD_SETTID
options to clone(). This makes fork() work on amd64.

clone() prototype has changed and the changes is probably revelant on some
other arches.
 1.6 22-May-2005  fvdl sigreturn doesn't take arguments. Instead, find out where the signal
frame is from the stack pointer in the frame frame.

Also, don't forget to copy %rip back in.
 1.5 22-May-2005  fvdl Use a modified buildcontext function for Linux signals. It doesn't set
the unused segment registers, it just uses the already used values.
 1.4 20-May-2005  fvdl Define linux_usertrap function, and set it in struct emul. For all
but amd64, it just returns 0, doing nothing.

For amd64, it implements vsyscalls through cheating: if the faulting
address is in the vsyscall area (which is statically known on Linux/amd64),
and the intruction pointer is too, it must have been a vsyscall. In that
case, retrieve the return address from the user stack, fix up %rip and
%rsp, and just execute the normal system call. It will return as if
the vsyscall has been executed.
 1.3 19-May-2005  manu Add support for Linux SA_RESTORER on amd64.
 1.2 15-May-2005  fvdl Make the arch_prctl system call use the saved %gs and %fs mechanism.
 1.1 03-May-2005  manu First work on COMPAT_LINUX/amd64
Process startup and dynamiclinking work, but processes hang due to
Linux arch_prctl(2) not being really supported yet.
 1.9.2.6 21-Jan-2008  yamt sync with head
 1.9.2.5 27-Oct-2007  yamt sync with head.
 1.9.2.4 03-Sep-2007  yamt sync with head.
 1.9.2.3 26-Feb-2007  yamt sync with head.
 1.9.2.2 30-Dec-2006  yamt sync with head.
 1.9.2.1 21-Jun-2006  yamt sync with head.
 1.11.2.2 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.11.2.1 05-Nov-2005  skrll file linux_machdep.c was added on branch ktrace-lwp on 2005-11-10 14:00:59 +0000
 1.13.8.1 03-Sep-2006  yamt sync with head.
 1.13.4.1 09-Sep-2006  rpaulo sync with head
 1.14.4.1 22-Oct-2006  yamt sync with head
 1.14.2.2 06-Feb-2007  ad More compat changes.

XXX compat_irix, compat_mach and compat_darwin need work.
 1.14.2.1 18-Nov-2006  ad Sync with head.
 1.15.2.2 30-May-2007  riz Pull up following revision(s) (requested by njoly in ticket #673):
sys/compat/linux/arch/amd64/linux_machdep.c: revision 1.23
sys/compat/linux/arch/amd64/linux_machdep.h: revision 1.9
Fix restart of interrupted system calls.
- Make linux_sys_rt_sigreturn() return EJUSTRETURN on success.
- Add missing rax to linux_sigcontext structure; and save/restore
its value like other members in linux_sendsig()/linux_sys_rt_sigreturn().
With valuable help from manu.
 1.15.2.1 13-May-2007  pavel branches: 1.15.2.1.2;
Pull up following revision(s) (requested by manu in ticket #637):
sys/compat/linux/arch/amd64/linux_machdep.c: revision 1.21
sys/compat/linux/arch/amd64/linux_machdep.h: revision 1.7
sys/compat/linux/common/linux_termios.c: revision 1.30
Add ptmx fakedevice hack for amd64
Fix a bug in ioctl handling
 1.15.2.1.2.1 04-Jun-2007  wrstuden Update to today's netbsd-4.
 1.17.2.3 24-Mar-2007  yamt sync with head.
 1.17.2.2 12-Mar-2007  rmind Sync with HEAD.
 1.17.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.20.4.1 11-Jul-2007  mjf Sync with head.
 1.20.2.3 09-Oct-2007  ad Sync with head.
 1.20.2.2 27-May-2007  ad Sync with head.
 1.20.2.1 10-Apr-2007  ad Sync with head.
 1.23.10.1 06-Oct-2007  yamt sync with head.
 1.23.8.2 09-Jan-2008  matt sync with HEAD
 1.23.8.1 06-Nov-2007  matt sync with HEAD
 1.23.6.3 09-Dec-2007  jmcneill Sync with HEAD.
 1.23.6.2 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.23.6.1 04-Oct-2007  joerg Sync with HEAD.
 1.24.2.1 25-Oct-2007  bouyer Sync with HEAD.
 1.25.4.1 26-Dec-2007  ad Sync with head.
 1.25.2.1 18-Feb-2008  mjf Sync with HEAD.
 1.26.4.2 08-Jan-2008  bouyer Sync with HEAD
 1.26.4.1 02-Jan-2008  bouyer Sync with HEAD
 1.28.8.1 18-May-2008  yamt sync with head.
 1.28.6.3 17-Jan-2009  mjf Sync with HEAD.
 1.28.6.2 28-Sep-2008  mjf Sync with HEAD.
 1.28.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.29.4.5 24-Sep-2008  wrstuden Merge in changes between wrstuden-revivesa-base-2 and
wrstuden-revivesa-base-3.
 1.29.4.4 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.29.4.3 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.29.4.2 14-May-2008  wrstuden Per discussion with ad at n dot o, revert signal mask handling
changes.

The l_sigstk changes are most likely totally un-needed as SA will
never use a signal stack - we send an upcall (or will as other
diffs are brought in).

The l_sigmask changes were too controvertial. In all honesty, I
think it's probably best to revert them. The main reason they were
there is the fact that in an SA process, we don't mask signals per
kernel thread, we mask them per user thread. In the kernel, we want
them all to get turned into upcalls. Thus the normal state of
l_sigmask in an SA process is for it to always be empty.

While we are in the process of delivering a signal, we want to
temporarily mask a signal (so we don't recursively exhaust our
upcall stacks). However signal delivery is rare (important, but
rare), and delivering back-to-back signals is even rarer. So rather
than cause every user of a signal mask to be prepared for this very
rare case, we will just add a second check later in the signal
delivery code. Said change is not in this diff.

This also un-compensates all of our compatability code for dealing
with SA. SA is a NetBSD-specific thing, so there's no need for
Irix, Linux, Solaris, SVR4 and so on to cope with it.

As previously, everything other than kern_sa.c compiles in i386
GENERIC as of this checkin. I will switch to ALL soon for compile
testing.
 1.29.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.29.2.5 11-Aug-2010  yamt sync with head.
 1.29.2.4 11-Mar-2010  yamt sync with head
 1.29.2.3 20-Jun-2009  yamt sync with head
 1.29.2.2 04-May-2009  yamt sync with head.
 1.29.2.1 16-May-2008  yamt sync with head.
 1.30.4.2 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.30.4.1 19-Oct-2008  haad Sync with HEAD.
 1.34.8.2 23-Jul-2009  jym Sync with HEAD.
 1.34.8.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.34.2.1 28-Apr-2009  skrll Sync with HEAD.
 1.37.4.1 05-Mar-2011  rmind sync with head
 1.37.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.38.8.3 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.38.8.2 30-Oct-2012  yamt sync with head
 1.38.8.1 17-Apr-2012  yamt sync with head
 1.39.12.1 14-Feb-2017  snj Pull up following revision(s) (requested by maxv in ticket #1433):
sys/compat/linux/arch/amd64/linux_machdep.c: 1.50, 1.51
Don't let userland choose %rip. This is the Intel Sysret vulnerability
again.
--
Make sure %rip is in userland. This is harmless, since the return to
userland is made with iret instead of sysret in this path. While here, use
size_t.
 1.39.10.1 14-Feb-2017  snj Pull up following revision(s) (requested by maxv in ticket #1433):
sys/compat/linux/arch/amd64/linux_machdep.c: 1.50, 1.51
Don't let userland choose %rip. This is the Intel Sysret vulnerability
again.
--
Make sure %rip is in userland. This is harmless, since the return to
userland is made with iret instead of sysret in this path. While here, use
size_t.
 1.39.6.1 14-Feb-2017  snj Pull up following revision(s) (requested by maxv in ticket #1433):
sys/compat/linux/arch/amd64/linux_machdep.c: 1.50, 1.51
Don't let userland choose %rip. This is the Intel Sysret vulnerability
again.
--
Make sure %rip is in userland. This is harmless, since the return to
userland is made with iret instead of sysret in this path. While here, use
size_t.
 1.40.4.1 18-May-2014  rmind sync with head
 1.40.2.2 03-Dec-2017  jdolecek update from HEAD
 1.40.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.48.14.1 21-Apr-2017  bouyer Sync with HEAD
 1.48.12.1 13-Mar-2017  skrll Sync with netbsd-7-1-RELEASE
 1.48.10.2 20-Mar-2017  pgoyette Sync with HEAD
 1.48.10.1 20-Jul-2016  pgoyette Adapt machine-independant code to the new {b,c}devsw reference-counting
(using localcount(9)). All callers of {b,c}devsw_lookup() now call
{b,c}devsw_lookup_acquire() which retains a reference on the 'struct
{b,c}devsw'. This reference must be released by the caller once it is
finished with the structure's content (or other data that would disappear
if the 'struct {b,c}devsw' were to disappear).
 1.48.8.1 14-Feb-2017  snj Pull up following revision(s) (requested by maxv in ticket #1359):
sys/compat/linux/arch/amd64/linux_machdep.c: 1.50, 1.51
Don't let userland choose %rip. This is the Intel Sysret vulnerability
again.
--
Make sure %rip is in userland. This is harmless, since the return to
userland is made with iret instead of sysret in this path. While here, use
size_t.
 1.48.6.1 28-Aug-2017  skrll Sync with HEAD
 1.48.4.2 21-Jan-2020  martin Pull up the following, requested by christos in ticket #1720:

sys/compat/common/kern_sig_43.c 1.36
sys/compat/linux/arch/amd64/linux_machdep.c 1.59
sys/compat/linux/common/linux_fcntl.h 1.18
sys/compat/linux/common/linux_file64.c 1.62
sys/compat/linux/common/linux_ipc.c 1.57
sys/compat/linux/common/linux_misc.c 1.243
sys/compat/linux/common/linux_signal.c 1.81
sys/compat/linux/common/linux_socket.c 1.149 (patch)
sys/compat/linux/common/linux_socket.h 1.24
sys/compat/linux/common/linux_statfs.h 1.7
sys/compat/linux/common/linux_termios.c 1.38
sys/compat/linux/common/linux_termios.h 1.22
sys/compat/linux32/common/linux32_dirent.c 1.20
sys/compat/linux32/common/linux32_ioctl.c 1.14
sys/compat/linux32/common/linux32_misc.c 1.27
sys/compat/linux32/common/linux32_signal.c 1.20
sys/compat/linux32/common/linux32_sysinfo.c 1.8
sys/compat/linux32/common/linux32_termios.c 1.15
sys/compat/linux32/common/linux32_utsname.c 1.10
sys/compat/netbsd32/netbsd32_compat_20.c 1.39
sys/compat/netbsd32/netbsd32_compat_43.c 1.59
sys/compat/netbsd32/netbsd32_compat_50.c 1.44
sys/compat/ossaudio/ossaudio.c 1.75
sys/kern/sysv_shm.c 1.138
sys/miscfs/procfs/procfs_linux.c 1.75 (patch)
sys/sys/shm.h 1.54 (patch)

Fix various info leaks, out of bound access, usage of uninitialized
values and direct access to userland variables from kernel space
and memory leaks in system calls implemented for the compatibility
subsystems.
 1.48.4.1 14-Feb-2017  snj branches: 1.48.4.1.2;
Pull up following revision(s) (requested by maxv in ticket #1359):
sys/compat/linux/arch/amd64/linux_machdep.c: revisions 1.50, 1.51
Don't let userland choose %rip. This is the Intel Sysret vulnerability
again.
--
Make sure %rip is in userland. This is harmless, since the return to
userland is made with iret instead of sysret in this path. While here, use
size_t.
 1.48.4.1.2.1 21-Jan-2020  martin Pull up the following, requested by christos in ticket #1720:

sys/compat/common/kern_sig_43.c 1.36
sys/compat/linux/arch/amd64/linux_machdep.c 1.59
sys/compat/linux/common/linux_fcntl.h 1.18
sys/compat/linux/common/linux_file64.c 1.62
sys/compat/linux/common/linux_ipc.c 1.57
sys/compat/linux/common/linux_misc.c 1.243
sys/compat/linux/common/linux_signal.c 1.81
sys/compat/linux/common/linux_socket.c 1.149 (patch)
sys/compat/linux/common/linux_socket.h 1.24
sys/compat/linux/common/linux_statfs.h 1.7
sys/compat/linux/common/linux_termios.c 1.38
sys/compat/linux/common/linux_termios.h 1.22
sys/compat/linux32/common/linux32_dirent.c 1.20
sys/compat/linux32/common/linux32_ioctl.c 1.14
sys/compat/linux32/common/linux32_misc.c 1.27
sys/compat/linux32/common/linux32_signal.c 1.20
sys/compat/linux32/common/linux32_sysinfo.c 1.8
sys/compat/linux32/common/linux32_termios.c 1.15
sys/compat/linux32/common/linux32_utsname.c 1.10
sys/compat/netbsd32/netbsd32_compat_20.c 1.39
sys/compat/netbsd32/netbsd32_compat_43.c 1.59
sys/compat/netbsd32/netbsd32_compat_50.c 1.44
sys/compat/ossaudio/ossaudio.c 1.75
sys/kern/sysv_shm.c 1.138
sys/miscfs/procfs/procfs_linux.c 1.75 (patch)
sys/sys/shm.h 1.54 (patch)

Fix various info leaks, out of bound access, usage of uninitialized
values and direct access to userland variables from kernel space
and memory leaks in system calls implemented for the compatibility
subsystems.
 1.51.6.4 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.51.6.3 21-Jan-2020  martin Pull up the following, requested by christos in ticket #1487:

sys/compat/common/kern_sig_43.c 1.36
sys/compat/linux/arch/amd64/linux_machdep.c 1.59
sys/compat/linux/common/linux_fcntl.h 1.18
sys/compat/linux/common/linux_file64.c 1.62
sys/compat/linux/common/linux_ipc.c 1.57
sys/compat/linux/common/linux_misc.c 1.243
sys/compat/linux/common/linux_signal.c 1.81
sys/compat/linux/common/linux_socket.c 1.149
sys/compat/linux/common/linux_socket.h 1.24
sys/compat/linux/common/linux_statfs.h 1.7
sys/compat/linux/common/linux_termios.c 1.38
sys/compat/linux/common/linux_termios.h 1.22
sys/compat/linux32/common/linux32_dirent.c 1.20
sys/compat/linux32/common/linux32_ioctl.c 1.14
sys/compat/linux32/common/linux32_misc.c 1.27
sys/compat/linux32/common/linux32_signal.c 1.20
sys/compat/linux32/common/linux32_sysinfo.c 1.8
sys/compat/linux32/common/linux32_termios.c 1.15
sys/compat/linux32/common/linux32_utsname.c 1.10
sys/compat/netbsd32/netbsd32_compat_20.c 1.39
sys/compat/netbsd32/netbsd32_compat_43.c 1.59
sys/compat/netbsd32/netbsd32_compat_50.c 1.44
sys/compat/ossaudio/ossaudio.c 1.75
sys/kern/sysv_shm.c 1.138
sys/miscfs/procfs/procfs_linux.c 1.75 (patch)
sys/sys/shm.h 1.54

Fix various info leaks, out of bound access, usage of uninitialized
values and direct access to userland variables from kernel space
and memory leaks in system calls implemented for the compatibility
subsystems.
 1.51.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.51.6.1 04-Sep-2017  snj Pull up following revision(s) (requested by maxv in ticket #257):
sys/compat/linux/arch/amd64/linux_machdep.c: 1.52
sys/arch/amd64/amd64/copy.S: 1.21-1.24
sys/arch/amd64/amd64/locore.S: 1.125
sys/arch/amd64/amd64/machdep.c: 1.256
Fix a bug in ucas_32 and ucas_64. There is a branch where they don't
initialize %rax.
--
style, reduces an incoming diff
00
Split comment, otherwise it is misleading. kcopy operates on kernel
memory, and must *not* be used with userland pages.
--
Move incq outside of the copy section. No functional change, reduces
my smap diff.
--
Remove dumb debug code and outdated comment.
--
Don't forget to clean l_md.md_flags, otherwise there may be MDL_COMPAT32,
in which case the kernel would always use iret (slower).
 1.51.4.1 27-Apr-2017  pgoyette Restore all work from the former pgoyette-localcount branch (which is
now abandoned doe to cvs merge botch).

The branch now builds, and installs via anita. There are still some
problems (cgd is non-functional and all atf tests time-out) but they
will get resolved soon.
 1.56.4.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.56.4.1 10-Jun-2019  christos Sync with HEAD
 1.58.2.2 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.58.2.1 13-Sep-2019  martin Pull up following revision(s) (requested by maxv in ticket #194):

sys/compat/linux/common/linux_socket.c: revision 1.146
sys/compat/linux/common/linux_socket.c: revision 1.147
sys/compat/linux/common/linux_socket.c: revision 1.148
sys/compat/linux/common/linux_socket.c: revision 1.149
sys/compat/linux/arch/amd64/linux_machdep.c: revision 1.59
sys/compat/linux32/common/linux32_sysinfo.c: revision 1.8
sys/kern/sysv_shm.c: revision 1.138
sys/compat/linux/common/linux_file64.c: revision 1.61
sys/compat/linux/common/linux_file64.c: revision 1.62
sys/compat/netbsd32/netbsd32_compat_43.c: revision 1.58
sys/compat/linux32/common/linux32_dirent.c: revision 1.20
sys/compat/linux32/common/linux32_utsname.c: revision 1.10
sys/compat/linux/common/linux_termios.h: revision 1.22
sys/compat/linux32/common/linux32_termios.c: revision 1.15
sys/compat/linux32/common/linux32_misc.c: revision 1.27
sys/compat/linux32/common/linux32_ioctl.c: revision 1.14
sys/compat/linux/common/linux_statfs.h: revision 1.7
sys/compat/linux/common/linux_ipc.c: revision 1.57
sys/compat/linux/common/linux_fcntl.h: revision 1.18
sys/compat/linux/common/linux_socket.h: revision 1.24
sys/sys/shm.h: revision 1.54
sys/compat/ossaudio/ossaudio.c: revision 1.75
sys/compat/linux32/common/linux32_signal.c: revision 1.20
sys/miscfs/procfs/procfs_linux.c: revision 1.75
sys/compat/linux/common/linux_signal.c: revision 1.81
sys/compat/linux/common/linux_termios.c: revision 1.38
sys/compat/linux/common/linux_misc.c: revision 1.241
sys/compat/linux/common/linux_misc.c: revision 1.242
sys/compat/linux/common/linux_misc.c: revision 1.243
sys/compat/linux/common/linux_misc.c: revision 1.244

Fix info leaks.

Fix stupid bugs in linux_sys_shmctl(): the index could be out of bound
(page fault) and there was no proper locking.
Maybe we should just remove LINUX_SHM_STAT, like compat_linux32.

Remove printf.

When dealing with an unknown value, set -1, to prevent (harmless)
uninitialized accesses later.

Add a default case, don't call sys_ioctl() with an uninitialized 'com'
argument.

Fix error handling, returns an errno, not -1.

Put the printf under DEBUG_LINUX.


Hum, don't forget the 'pid' argument, otherwise we're not gonna go very
far.

Don't read data from userland directly. This simply does not work on any
recent x86 CPU (thanks to SMAP) and all architectures that forbid direct
access to userland from the kernel. But I guess no one noticed because no
one ever uses compat_linux, right?

Hum, don't pass an mbuf to realloc(). Inspired from copyin32_msg_control().

Fix memory leak.

I don't see the point in having this useless printf, but add a '\n' to it,
so that it at least displays useless stuff correctly.

Hum, remove incorrect assignment. Userland could have passed a smaller
namelen, and the uninitialized bytes from sb_data were being used later in
the network stack.
 1.61.10.1 02-Aug-2025  perseant Sync with HEAD
 1.15 01-Oct-2024  riastradh sys/compat/linux/arch: Nix trailing whitespace.

No functional change intended.
 1.14 07-Feb-2014  dsl branches: 1.14.66;
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.13 07-Jul-2010  chs branches: 1.13.8; 1.13.18; 1.13.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.12 21-Apr-2008  njoly branches: 1.12.2; 1.12.22; 1.12.24;
Rename LINUX_SHMCTL_FORCEIPC64 define to LINUX_IPC_FORCE64.
 1.11 28-Jan-2008  njoly branches: 1.11.6; 1.11.8;
Make shmctl + {IPC,SHM}_STAT work an amd64, by forcing use of IPC_64.
Following the Linux kernel behaviour.
 1.10 04-Dec-2007  dsl Remove all the __P
 1.9 24-May-2007  njoly branches: 1.9.6; 1.9.8; 1.9.14; 1.9.16;
Fix restart of interrupted system calls.

- Make linux_sys_rt_sigreturn() return EJUSTRETURN on success.
- Add missing rax to linux_sigcontext structure; and save/restore
its value like other members in linux_sendsig()/linux_sys_rt_sigreturn().

With valuable help from manu.
 1.8 23-Apr-2007  manu Linux's uname should return x86_64 as machine_arch
 1.7 14-Mar-2007  manu Add ptmx fakedevice hack for amd64
Fix a bug in ioctl handling
 1.6 14-Mar-2007  njoly Fix compat linux statfs/fstatfs syscalls on amd64.
- Do not use statfs64/fstatfs64 as they have an extra size argument.
- Add full 64bit linux struct statfs support.

ok by manu
 1.5 23-Nov-2005  manu branches: 1.5.24; 1.5.26; 1.5.30; 1.5.32;
- Add Linux tkill and tgkill (partial emulation).
- Fix getrlimit on amd64
 1.4 05-Nov-2005  manu branches: 1.4.2; 1.4.4;
Instead of ifdef'ing __amd64__ all the Linux NPTL stuff, introduce an
ifdef LINUX_NPTL.
Also implement SETTLS flag to Linux clone()
 1.3 04-Nov-2005  manu Fix machine name returned by uname on Linux
 1.2 20-May-2005  fvdl branches: 1.2.2;
Define linux_usertrap function, and set it in struct emul. For all
but amd64, it just returns 0, doing nothing.

For amd64, it implements vsyscalls through cheating: if the faulting
address is in the vsyscall area (which is statically known on Linux/amd64),
and the intruction pointer is too, it must have been a vsyscall. In that
case, retrieve the return address from the user stack, fix up %rip and
%rsp, and just execute the normal system call. It will return as if
the vsyscall has been executed.
 1.1 03-May-2005  manu First work on COMPAT_LINUX/amd64
Process startup and dynamiclinking work, but processes hang due to
Linux arch_prctl(2) not being really supported yet.
 1.2.2.4 04-Feb-2008  yamt sync with head.
 1.2.2.3 07-Dec-2007  yamt sync with head
 1.2.2.2 03-Sep-2007  yamt sync with head.
 1.2.2.1 21-Jun-2006  yamt sync with head.
 1.4.4.1 29-Nov-2005  yamt sync with head.
 1.4.2.3 11-Dec-2005  christos Sync with head.
 1.4.2.2 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.4.2.1 05-Nov-2005  skrll file linux_machdep.h was added on branch ktrace-lwp on 2005-11-10 14:00:59 +0000
 1.5.32.1 11-Jul-2007  mjf Sync with head.
 1.5.30.2 27-May-2007  ad Sync with head.
 1.5.30.1 10-Apr-2007  ad Sync with head.
 1.5.26.2 07-May-2007  yamt sync with head.
 1.5.26.1 24-Mar-2007  yamt sync with head.
 1.5.24.4 30-May-2007  riz Pull up following revision(s) (requested by njoly in ticket #673):
sys/compat/linux/arch/amd64/linux_machdep.c: revision 1.23
sys/compat/linux/arch/amd64/linux_machdep.h: revision 1.9
Fix restart of interrupted system calls.
- Make linux_sys_rt_sigreturn() return EJUSTRETURN on success.
- Add missing rax to linux_sigcontext structure; and save/restore
its value like other members in linux_sendsig()/linux_sys_rt_sigreturn().
With valuable help from manu.
 1.5.24.3 13-May-2007  pavel branches: 1.5.24.3.2;
Pull up following revision(s) (requested by manu in ticket #637):
sys/compat/linux/arch/amd64/linux_machdep.c: revision 1.21
sys/compat/linux/arch/amd64/linux_machdep.h: revision 1.7
sys/compat/linux/common/linux_termios.c: revision 1.30
Add ptmx fakedevice hack for amd64
Fix a bug in ioctl handling
 1.5.24.2 29-Apr-2007  bouyer Pull up following revision(s) (requested by manu in ticket #596):
sys/compat/linux/arch/amd64/linux_machdep.h: revision 1.8
sys/compat/linux/common/linux_sysctl.c: revision 1.27
Linux's uname should return x86_64 as machine_arch
 1.5.24.1 20-Apr-2007  bouyer Pull up following revision(s) (requested by njoly in ticket #581):
sys/compat/linux/common/linux_misc.c: revision 1.168
sys/compat/linux/arch/amd64/syscalls.master: revision 1.18
sys/compat/linux/common/linux_types.h: revision 1.25
sys/compat/linux/arch/amd64/linux_machdep.h: revision 1.6
sys/compat/linux/common/linux_misc_notalpha.c: revision 1.87
Fix compat linux statfs/fstatfs syscalls on amd64.
- Do not use statfs64/fstatfs64 as they have an extra size argument.
- Add full 64bit linux struct statfs support.
 1.5.24.3.2.1 04-Jun-2007  wrstuden Update to today's netbsd-4.
 1.9.16.1 08-Dec-2007  ad Sync with head.
 1.9.14.2 18-Feb-2008  mjf Sync with HEAD.
 1.9.14.1 08-Dec-2007  mjf Sync with HEAD.
 1.9.8.2 23-Mar-2008  matt sync with HEAD
 1.9.8.1 09-Jan-2008  matt sync with HEAD
 1.9.6.1 09-Dec-2007  jmcneill Sync with HEAD.
 1.11.8.1 18-May-2008  yamt sync with head.
 1.11.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.12.24.1 05-Mar-2011  rmind sync with head
 1.12.22.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.12.2.1 11-Aug-2010  yamt sync with head.
 1.13.22.1 18-May-2014  rmind sync with head
 1.13.18.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.13.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.14.66.1 02-Aug-2025  perseant Sync with HEAD
 1.4 01-Oct-2024  riastradh sys/compat/linux/arch: Nix trailing whitespace.

No functional change intended.
 1.3 14-Mar-2015  njoly branches: 1.3.54;
Support Linux MAP_LOCKED mmap flag.
 1.2 11-Dec-2005  christos branches: 1.2.120; 1.2.140;
merge ktrace-lwp.
 1.1 03-May-2005  manu branches: 1.1.8;
First work on COMPAT_LINUX/amd64
Process startup and dynamiclinking work, but processes hang due to
Linux arch_prctl(2) not being really supported yet.
 1.1.8.2 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.1.8.1 03-May-2005  skrll file linux_mmap.h was added on branch ktrace-lwp on 2005-11-10 14:00:59 +0000
 1.2.140.1 06-Apr-2015  skrll Sync with HEAD
 1.2.120.1 03-Dec-2017  jdolecek update from HEAD
 1.3.54.1 02-Aug-2025  perseant Sync with HEAD
 1.3 01-Oct-2024  riastradh sys/compat/linux/arch: Nix trailing whitespace.

No functional change intended.
 1.2 11-Dec-2005  christos branches: 1.2.200;
merge ktrace-lwp.
 1.1 03-May-2005  manu branches: 1.1.8;
First work on COMPAT_LINUX/amd64
Process startup and dynamiclinking work, but processes hang due to
Linux arch_prctl(2) not being really supported yet.
 1.1.8.2 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.1.8.1 03-May-2005  skrll file linux_prctl.h was added on branch ktrace-lwp on 2005-11-10 14:00:59 +0000
 1.2.200.1 02-Aug-2025  perseant Sync with HEAD
 1.3 01-Oct-2024  riastradh sys/compat/linux/arch: Nix trailing whitespace.

No functional change intended.
 1.2 11-Dec-2005  christos branches: 1.2.200;
merge ktrace-lwp.
 1.1 19-May-2005  manu branches: 1.1.8;
Add support for Linux SA_RESTORER on amd64.
 1.1.8.2 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.1.8.1 19-May-2005  skrll file linux_sigarray.c was added on branch ktrace-lwp on 2005-11-10 14:00:59 +0000
 1.2.200.1 02-Aug-2025  perseant Sync with HEAD
 1.8 01-Oct-2024  riastradh sys/compat/linux/arch: Nix trailing whitespace.

No functional change intended.
 1.7 18-Nov-2011  christos branches: 1.7.88;
- add sigtimedwait support.
- merge the siginfo population code.
 1.6 08-Jun-2009  njoly branches: 1.6.12;
Various compat linux siginfo fixes.
- alpha: add missing _uid member to SIGCHLD structure.
- amd64: add missing typedef, and fix padding size.
- arm: add missing linux_siginfo definition.
 1.5 27-May-2009  njoly Use correct linux_clock_t type for _stime, not native clock_t.
 1.4 23-Nov-2008  njoly branches: 1.4.4;
Move si_code definitions from MD to MI linux_siginfo.h, all archs
(except mips for 3 values) are identical.
While here, remove unused/unneeded LINUX__SI_CODE macro. Only the
lower 16-bits are used for userland si_code.
 1.3 21-Oct-2008  njoly branches: 1.3.2;
Remove LINUX_SI_xxx from MI siginfo.h, that should not have been
committed. Rather add them to amd64 MD header.
Fix compilation failures on non x86 archs.
 1.2 11-Dec-2005  christos branches: 1.2.74; 1.2.80;
merge ktrace-lwp.
 1.1 03-May-2005  manu branches: 1.1.8;
First work on COMPAT_LINUX/amd64
Process startup and dynamiclinking work, but processes hang due to
Linux arch_prctl(2) not being really supported yet.
 1.1.8.2 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.1.8.1 03-May-2005  skrll file linux_siginfo.h was added on branch ktrace-lwp on 2005-11-10 14:00:59 +0000
 1.2.80.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.2.74.1 20-Jun-2009  yamt sync with head
 1.3.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.4.4.1 23-Jul-2009  jym Sync with HEAD.
 1.6.12.1 17-Apr-2012  yamt sync with head
 1.7.88.1 02-Aug-2025  perseant Sync with HEAD
 1.6 01-Oct-2024  riastradh sys/compat/linux/arch: Nix trailing whitespace.

No functional change intended.
 1.5 14-Nov-2015  christos branches: 1.5.54;
PR/50428: Rin Okuyama: support SA_RESTORER flag for rt_sigaction(2) in the
ports that support it.
 1.4 11-Dec-2005  christos branches: 1.4.120; 1.4.140;
merge ktrace-lwp.
 1.3 19-Sep-2005  christos branches: 1.3.6;
MINSIGSTKSZ on linux is different depending on the platform and usually
smaller than ours.
 1.2 19-May-2005  manu branches: 1.2.2;
Add support for Linux SA_RESTORER on amd64.
 1.1 03-May-2005  manu First work on COMPAT_LINUX/amd64
Process startup and dynamiclinking work, but processes hang due to
Linux arch_prctl(2) not being really supported yet.
 1.2.2.1 21-Jun-2006  yamt sync with head.
 1.3.6.2 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.3.6.1 19-Sep-2005  skrll file linux_signal.h was added on branch ktrace-lwp on 2005-11-10 14:00:59 +0000
 1.4.140.1 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.4.120.1 03-Dec-2017  jdolecek update from HEAD
 1.5.54.1 02-Aug-2025  perseant Sync with HEAD
 1.4 01-Oct-2024  riastradh sys/compat/linux/arch: Nix trailing whitespace.

No functional change intended.
 1.3 25-Jan-2014  njoly branches: 1.3.66;
Update linux socket socket options (SO_*). Add common version to its
own file (linux_socket_generic.h); use it for all but alpha and mips.
 1.2 11-Dec-2005  christos branches: 1.2.110; 1.2.120; 1.2.126;
merge ktrace-lwp.
 1.1 03-May-2005  manu branches: 1.1.8;
First work on COMPAT_LINUX/amd64
Process startup and dynamiclinking work, but processes hang due to
Linux arch_prctl(2) not being really supported yet.
 1.1.8.2 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.1.8.1 03-May-2005  skrll file linux_socket.h was added on branch ktrace-lwp on 2005-11-10 14:00:59 +0000
 1.2.126.1 18-May-2014  rmind sync with head
 1.2.120.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.110.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.3.66.1 02-Aug-2025  perseant Sync with HEAD
 1.3 23-Feb-2009  rmind Switch Linux futex emulation to native ucas_int(), remove unecessary
futex-specific assembler routines.

Fixes PR/40490. Reviewed by <ad>.
 1.2 20-Nov-2008  ad branches: 1.2.4; 1.2.6; 1.2.8;
PR port-amd64/39964 modules/compat_linux: missing symbols on amd64
 1.1 26-Oct-2008  christos branches: 1.1.2; 1.1.4;
catch up with i386 changes.
 1.1.4.1 26-Feb-2009  snj Pull up following revision(s) (requested by rmind in ticket #493):
sys/compat/linux/arch/amd64/files.linux_amd64: revision 1.4
sys/compat/linux/arch/amd64/linux_support.S: file removal
sys/compat/linux/common/linux_futex.c: revision 1.23
sys/compat/linux/arch/i386/linux_support.S: file removal
sys/compat/linux/arch/i386/files.linux_i386: revision 1.10
Switch Linux futex emulation to native ucas_int(), remove unecessary
futex-specific assembler routines.
Fixes PR/40490. Reviewed by <ad>.
 1.1.2.2 03-Mar-2009  skrll Sync with HEAD.
 1.1.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.2.8.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.2.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.2.6.1 20-Nov-2008  mjf file linux_support.S was added on branch mjf-devfs2 on 2009-01-17 13:28:43 +0000
 1.2.4.2 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.2.4.1 20-Nov-2008  haad file linux_support.S was added on branch haad-dm on 2008-12-13 01:13:53 +0000
 1.85 26-Oct-2025  christos regen
 1.84 28-Sep-2024  christos regen
 1.83 01-Jul-2024  christos regen
 1.82 29-Jun-2024  christos branches: 1.82.2;
regen
 1.81 19-Aug-2023  christos regen
 1.80 18-Aug-2023  christos regen
 1.79 29-Jul-2023  christos regen
 1.78 28-Jul-2023  christos regen
 1.77 10-Jul-2023  christos Regen
 1.76 02-Dec-2021  ryo regen
 1.75 20-Sep-2021  thorpej Regen for preadv(2) / pwritev(2).
 1.74 20-Sep-2021  thorpej Regen for eventfd.
 1.73 19-Sep-2021  thorpej Regen for timerfd.
 1.72 19-Sep-2021  thorpej Regen for POSIX timer syscalls.
 1.71 26-Apr-2020  thorpej branches: 1.71.2;
Regen for native futex calls.
 1.70 09-Nov-2019  jdolecek regen
 1.69 10-Aug-2018  pgoyette Regen
 1.68 10-May-2017  riastradh branches: 1.68.8; 1.68.10;
regen
 1.67 03-Feb-2017  christos branches: 1.67.4;
regen
 1.66 03-Feb-2017  christos add sendmmsg and recvmmsg
 1.65 02-Feb-2017  christos regen
 1.64 16-Jan-2017  christos regen all
 1.63 13-Jan-2017  christos branches: 1.63.2;
regen
 1.62 02-Jan-2017  martin Regen (something apparently went wrong in previous)
 1.61 02-Jan-2017  manu Regen
 1.60 24-Jul-2016  njoly Regen for readlink/readlinkat signatures.
 1.59 27-Oct-2015  njoly branches: 1.59.2;
Regen
 1.58 24-Sep-2015  christos regen
 1.57 31-May-2015  njoly Regen for write(2) size argument fix.
 1.56 07-Mar-2015  christos regen
 1.55 22-Nov-2014  njoly branches: 1.55.2;
Regen for ppoll signature fix
 1.54 31-May-2014  njoly branches: 1.54.2;
Regen for munmap(2) signature.
 1.53 29-May-2014  njoly Regen for utimes(2) change.
 1.52 20-May-2014  njoly Regen for getgroups/setgroups update.
 1.51 17-May-2014  njoly Regen for fadvise64 offset types changes.
 1.50 04-May-2014  njoly Regen for pread/pwrite 64bit offset argument.
 1.49 08-Apr-2014  njoly Regen.
 1.48 08-Dec-2013  njoly branches: 1.48.2;
Regen.
 1.47 18-Nov-2013  chs regen
 1.46 07-Nov-2013  njoly Regen for dup/dup2/dup3 argument types fix.
 1.45 24-Sep-2013  njoly Regen for utimensat(2).
 1.44 08-Apr-2013  pooka branches: 1.44.4;
regen for utimes
 1.43 19-Sep-2012  pooka regen for ppoll (and, apparently, SYCALL_ARG_PTR)
 1.42 18-Nov-2011  christos branches: 1.42.10;
- add sigtimedwait support.
- merge the siginfo population code.
 1.41 30-May-2011  alnsn branches: 1.41.4;
Regenerate files to pick up correct RCS Ids. Suggested by Chris Badura.
 1.40 30-May-2011  alnsn Add fadvise64 and fadvise64_64 syscalls to compat_linux and compat_linux32.
 1.39 10-Apr-2011  christos Regen: Argh:
cat: rumphdr.types: No such file or directory
rm: rumphdr.types: No such file or directory
*** Error code 1
 1.38 07-Jul-2010  chs branches: 1.38.2;
regen
 1.37 14-Dec-2009  matt branches: 1.37.2; 1.37.4;
Regen (new makesyscalls.sh)
 1.36 24-Nov-2009  njoly Regen for personality(2) update.
 1.35 30-Oct-2009  njoly Regen for struct linux_stat64 fix.
 1.34 17-Jun-2009  njoly Regen for sendmsg/recvmsg definitions update.
 1.33 08-Jun-2009  njoly Regen for rt_queueinfo(2) update.
 1.32 17-Jan-2009  njoly branches: 1.32.2;
Regen for wait4 update.
 1.31 15-Jan-2009  njoly Rengen for compat50 update.
 1.30 13-Jan-2009  pooka Regen to prove I didn't screw up the conversion: purely RCSID changes.
 1.29 13-Jan-2009  pooka regen for #include "opt_compat_netbsd.h"
 1.28 11-Jan-2009  christos merge christos-time_t
 1.27 19-Nov-2008  ad branches: 1.27.4;
Regen.
 1.26 19-Nov-2008  njoly Regen for futex timeout argument cleanup/fix.
 1.25 12-Nov-2008  njoly Regen for nanosleep(2) fix.
 1.24 26-Oct-2008  christos branches: 1.24.2; 1.24.4;
regen.
 1.23 04-Apr-2008  njoly branches: 1.23.4; 1.23.6; 1.23.10;
Regen for linux_sys_msync removal.
 1.22 24-Dec-2007  njoly branches: 1.22.6;
Regen for linux_sys_getpgid removal.
 1.21 21-Dec-2007  njoly Regen for getfsuid/setfsgid syscall exchange.
 1.20 20-Dec-2007  dsl regen
 1.19 16-Nov-2007  njoly branches: 1.19.2; 1.19.6;
Regen, for syscalls cleanup.
 1.18 14-Mar-2007  njoly branches: 1.18.10; 1.18.12; 1.18.16; 1.18.18;
Regen (statfs/fstatfs fixes).
 1.17 04-Mar-2007  christos branches: 1.17.2; 1.17.4;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.16 01-Sep-2006  matt branches: 1.16.6; 1.16.8;
Regen.
 1.15 30-Aug-2006  matt Regen
 1.14 24-Aug-2006  manu The return value for Linux shmat on amd64 does not suffer the same horrible
hack as on i386.
 1.13 25-Jun-2006  manu Regen
 1.12 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.11 10-Jun-2006  christos branches: 1.11.2;
regen
 1.10 09-Feb-2006  manu branches: 1.10.2; 1.10.8;
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.9 23-Nov-2005  manu branches: 1.9.2; 1.9.4; 1.9.6;
- Add Linux tkill and tgkill (partial emulation).
- Fix getrlimit on amd64
 1.8 05-Nov-2005  manu branches: 1.8.2; 1.8.4;
regen
 1.7 04-Nov-2005  manu regen
 1.6 18-Oct-2005  joerg Regen.
 1.5 22-Jun-2005  manu branches: 1.5.2;
Implent CLONE_PARENT_SETTID, CLONE_CHILD_CLEARTID, and CLONE_CHILD_SETTID
options to clone(). This makes fork() work on amd64.

clone() prototype has changed and the changes is probably revelant on some
other arches.
 1.4 22-May-2005  fvdl Regen after sigreturn argument change.
 1.3 16-May-2005  fvdl Regen.
 1.2 16-May-2005  fvdl Regen.
 1.1 03-May-2005  manu First work on COMPAT_LINUX/amd64
Process startup and dynamiclinking work, but processes hang due to
Linux arch_prctl(2) not being really supported yet.
 1.5.2.5 21-Jan-2008  yamt sync with head
 1.5.2.4 07-Dec-2007  yamt sync with head
 1.5.2.3 03-Sep-2007  yamt sync with head.
 1.5.2.2 30-Dec-2006  yamt sync with head.
 1.5.2.1 21-Jun-2006  yamt sync with head.
 1.8.4.1 29-Nov-2005  yamt sync with head.
 1.8.2.3 11-Dec-2005  christos Sync with head.
 1.8.2.2 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.8.2.1 05-Nov-2005  skrll file linux_syscall.h was added on branch ktrace-lwp on 2005-11-10 14:00:59 +0000
 1.9.6.1 22-Apr-2006  simonb Sync with head.
 1.9.4.1 09-Sep-2006  rpaulo sync with head
 1.9.2.1 18-Feb-2006  yamt sync with head.
 1.10.8.1 19-Jun-2006  chap Sync with head.
 1.10.2.2 03-Sep-2006  yamt sync with head.
 1.10.2.1 26-Jun-2006  yamt sync with head.
 1.11.2.1 13-Jul-2006  gdamore Merge from HEAD.
 1.16.8.2 24-Mar-2007  yamt sync with head.
 1.16.8.1 12-Mar-2007  rmind Sync with HEAD.
 1.16.6.1 20-Apr-2007  bouyer regen for ticket #581
 1.17.4.1 11-Jul-2007  mjf Sync with head.
 1.17.2.1 10-Apr-2007  ad Sync with head.
 1.18.18.2 27-Dec-2007  mjf Sync with HEAD.
 1.18.18.1 19-Nov-2007  mjf Sync with HEAD.
 1.18.16.1 18-Nov-2007  bouyer Sync with HEAD
 1.18.12.1 09-Jan-2008  matt sync with HEAD
 1.18.10.1 21-Nov-2007  joerg Sync with HEAD.
 1.19.6.1 02-Jan-2008  bouyer Sync with HEAD
 1.19.2.1 26-Dec-2007  ad Sync with head.
 1.22.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.22.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.23.10.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.23.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.23.4.4 11-Aug-2010  yamt sync with head.
 1.23.4.3 11-Mar-2010  yamt sync with head
 1.23.4.2 20-Jun-2009  yamt sync with head
 1.23.4.1 04-May-2009  yamt sync with head.
 1.24.4.1 20-Nov-2008  snj Regen for ticket 81.
 1.24.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.27.4.3 04-Jan-2009  christos need opt_compat_netbsd.h
 1.27.4.2 30-Dec-2008  christos time_t 64 changes.
 1.27.4.1 19-Nov-2008  christos file linux_syscall.h was added on branch christos-time_t on 2008-12-30 19:34:33 +0000
 1.32.2.1 23-Jul-2009  jym Sync with HEAD.
 1.37.4.3 31-May-2011  rmind sync with head
 1.37.4.2 21-Apr-2011  rmind sync with head
 1.37.4.1 05-Mar-2011  rmind sync with head
 1.37.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.38.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.41.4.3 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.41.4.2 30-Oct-2012  yamt sync with head
 1.41.4.1 17-Apr-2012  yamt sync with head
 1.42.10.4 03-Dec-2017  jdolecek update from HEAD
 1.42.10.3 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.42.10.2 23-Jun-2013  tls resync from head
 1.42.10.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.44.4.1 18-May-2014  rmind sync with head
 1.48.2.1 10-Aug-2014  tls Rebase.
 1.54.2.1 17-Apr-2017  snj regen for ticket 1354
 1.55.2.5 05-Feb-2017  skrll Sync with HEAD
 1.55.2.4 05-Oct-2016  skrll Sync with HEAD
 1.55.2.3 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.55.2.2 06-Jun-2015  skrll Sync with HEAD
 1.55.2.1 06-Apr-2015  skrll Sync with HEAD
 1.59.2.3 20-Mar-2017  pgoyette Sync with HEAD
 1.59.2.2 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.59.2.1 26-Jul-2016  pgoyette Sync with HEAD
 1.63.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.67.4.1 11-May-2017  pgoyette Sync with HEAD
 1.68.10.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.68.10.1 10-Jun-2019  christos Sync with HEAD
 1.68.8.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.71.2.2 17-Dec-2020  thorpej Regen for preadv(2) and pwritev(2).
 1.71.2.1 15-Dec-2020  thorpej Regen for eventfd, timerfd, POSIX timers.
 1.82.2.1 02-Aug-2025  perseant Sync with HEAD
 1.85 26-Oct-2025  christos regen
 1.84 28-Sep-2024  christos regen
 1.83 01-Jul-2024  christos regen
 1.82 29-Jun-2024  christos branches: 1.82.2;
regen
 1.81 19-Aug-2023  christos regen
 1.80 18-Aug-2023  christos regen
 1.79 29-Jul-2023  christos regen
 1.78 28-Jul-2023  christos regen
 1.77 10-Jul-2023  christos Regen
 1.76 02-Dec-2021  ryo regen
 1.75 20-Sep-2021  thorpej Regen for preadv(2) / pwritev(2).
 1.74 20-Sep-2021  thorpej Regen for eventfd.
 1.73 19-Sep-2021  thorpej Regen for timerfd.
 1.72 19-Sep-2021  thorpej Regen for POSIX timer syscalls.
 1.71 26-Apr-2020  thorpej branches: 1.71.2;
Regen for native futex calls.
 1.70 09-Nov-2019  jdolecek regen
 1.69 10-Aug-2018  pgoyette Regen
 1.68 10-May-2017  riastradh branches: 1.68.8; 1.68.10;
regen
 1.67 03-Feb-2017  christos branches: 1.67.4;
regen
 1.66 03-Feb-2017  christos add sendmmsg and recvmmsg
 1.65 02-Feb-2017  christos regen
 1.64 16-Jan-2017  christos regen all
 1.63 13-Jan-2017  christos branches: 1.63.2;
regen
 1.62 02-Jan-2017  martin Regen (something apparently went wrong in previous)
 1.61 02-Jan-2017  manu Regen
 1.60 24-Jul-2016  njoly Regen for readlink/readlinkat signatures.
 1.59 27-Oct-2015  njoly branches: 1.59.2;
Regen
 1.58 24-Sep-2015  christos regen
 1.57 31-May-2015  njoly Regen for write(2) size argument fix.
 1.56 07-Mar-2015  christos regen
 1.55 22-Nov-2014  njoly branches: 1.55.2;
Regen for ppoll signature fix
 1.54 31-May-2014  njoly branches: 1.54.2;
Regen for munmap(2) signature.
 1.53 29-May-2014  njoly Regen for utimes(2) change.
 1.52 20-May-2014  njoly Regen for getgroups/setgroups update.
 1.51 17-May-2014  njoly Regen for fadvise64 offset types changes.
 1.50 04-May-2014  njoly Regen for pread/pwrite 64bit offset argument.
 1.49 08-Apr-2014  njoly Regen.
 1.48 08-Dec-2013  njoly branches: 1.48.2;
Regen.
 1.47 18-Nov-2013  chs regen
 1.46 07-Nov-2013  njoly Regen for dup/dup2/dup3 argument types fix.
 1.45 24-Sep-2013  njoly Regen for utimensat(2).
 1.44 08-Apr-2013  pooka branches: 1.44.4;
regen for utimes
 1.43 19-Sep-2012  pooka regen for ppoll (and, apparently, SYCALL_ARG_PTR)
 1.42 18-Nov-2011  christos branches: 1.42.10;
- add sigtimedwait support.
- merge the siginfo population code.
 1.41 30-May-2011  alnsn branches: 1.41.4;
Regenerate files to pick up correct RCS Ids. Suggested by Chris Badura.
 1.40 30-May-2011  alnsn Add fadvise64 and fadvise64_64 syscalls to compat_linux and compat_linux32.
 1.39 10-Apr-2011  christos Regen: Argh:
cat: rumphdr.types: No such file or directory
rm: rumphdr.types: No such file or directory
*** Error code 1
 1.38 07-Jul-2010  chs branches: 1.38.2;
regen
 1.37 14-Dec-2009  matt branches: 1.37.2; 1.37.4;
Regen (new makesyscalls.sh)
 1.36 24-Nov-2009  njoly Regen for personality(2) update.
 1.35 30-Oct-2009  njoly Regen for struct linux_stat64 fix.
 1.34 17-Jun-2009  njoly Regen for sendmsg/recvmsg definitions update.
 1.33 08-Jun-2009  njoly Regen for rt_queueinfo(2) update.
 1.32 17-Jan-2009  njoly branches: 1.32.2;
Regen for wait4 update.
 1.31 15-Jan-2009  njoly Rengen for compat50 update.
 1.30 13-Jan-2009  pooka Regen to prove I didn't screw up the conversion: purely RCSID changes.
 1.29 13-Jan-2009  pooka regen for #include "opt_compat_netbsd.h"
 1.28 11-Jan-2009  christos merge christos-time_t
 1.27 19-Nov-2008  ad branches: 1.27.4;
Regen.
 1.26 19-Nov-2008  njoly Regen for futex timeout argument cleanup/fix.
 1.25 12-Nov-2008  njoly Regen for nanosleep(2) fix.
 1.24 26-Oct-2008  christos branches: 1.24.2; 1.24.4;
regen.
 1.23 04-Apr-2008  njoly branches: 1.23.4; 1.23.6; 1.23.10;
Regen for linux_sys_msync removal.
 1.22 24-Dec-2007  njoly branches: 1.22.6;
Regen for linux_sys_getpgid removal.
 1.21 21-Dec-2007  njoly Regen for getfsuid/setfsgid syscall exchange.
 1.20 20-Dec-2007  dsl regen
 1.19 16-Nov-2007  njoly branches: 1.19.2; 1.19.6;
Regen, for syscalls cleanup.
 1.18 14-Mar-2007  njoly branches: 1.18.10; 1.18.12; 1.18.16; 1.18.18;
Regen (statfs/fstatfs fixes).
 1.17 04-Mar-2007  christos branches: 1.17.2; 1.17.4;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.16 01-Sep-2006  matt branches: 1.16.6; 1.16.8;
Regen.
 1.15 30-Aug-2006  matt Regen
 1.14 24-Aug-2006  manu The return value for Linux shmat on amd64 does not suffer the same horrible
hack as on i386.
 1.13 25-Jun-2006  manu Regen
 1.12 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.11 10-Jun-2006  christos branches: 1.11.2;
regen
 1.10 09-Feb-2006  manu branches: 1.10.2; 1.10.8;
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.9 23-Nov-2005  manu branches: 1.9.2; 1.9.4; 1.9.6;
- Add Linux tkill and tgkill (partial emulation).
- Fix getrlimit on amd64
 1.8 05-Nov-2005  manu branches: 1.8.2; 1.8.4;
regen
 1.7 04-Nov-2005  manu regen
 1.6 18-Oct-2005  joerg Regen.
 1.5 22-Jun-2005  manu branches: 1.5.2;
Implent CLONE_PARENT_SETTID, CLONE_CHILD_CLEARTID, and CLONE_CHILD_SETTID
options to clone(). This makes fork() work on amd64.

clone() prototype has changed and the changes is probably revelant on some
other arches.
 1.4 22-May-2005  fvdl Regen after sigreturn argument change.
 1.3 16-May-2005  fvdl Regen.
 1.2 16-May-2005  fvdl Regen.
 1.1 03-May-2005  manu First work on COMPAT_LINUX/amd64
Process startup and dynamiclinking work, but processes hang due to
Linux arch_prctl(2) not being really supported yet.
 1.5.2.5 21-Jan-2008  yamt sync with head
 1.5.2.4 07-Dec-2007  yamt sync with head
 1.5.2.3 03-Sep-2007  yamt sync with head.
 1.5.2.2 30-Dec-2006  yamt sync with head.
 1.5.2.1 21-Jun-2006  yamt sync with head.
 1.8.4.1 29-Nov-2005  yamt sync with head.
 1.8.2.3 11-Dec-2005  christos Sync with head.
 1.8.2.2 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.8.2.1 05-Nov-2005  skrll file linux_syscallargs.h was added on branch ktrace-lwp on 2005-11-10 14:00:59 +0000
 1.9.6.1 22-Apr-2006  simonb Sync with head.
 1.9.4.1 09-Sep-2006  rpaulo sync with head
 1.9.2.1 18-Feb-2006  yamt sync with head.
 1.10.8.1 19-Jun-2006  chap Sync with head.
 1.10.2.2 03-Sep-2006  yamt sync with head.
 1.10.2.1 26-Jun-2006  yamt sync with head.
 1.11.2.1 13-Jul-2006  gdamore Merge from HEAD.
 1.16.8.2 24-Mar-2007  yamt sync with head.
 1.16.8.1 12-Mar-2007  rmind Sync with HEAD.
 1.16.6.1 20-Apr-2007  bouyer regen for ticket #581
 1.17.4.1 11-Jul-2007  mjf Sync with head.
 1.17.2.1 10-Apr-2007  ad Sync with head.
 1.18.18.2 27-Dec-2007  mjf Sync with HEAD.
 1.18.18.1 19-Nov-2007  mjf Sync with HEAD.
 1.18.16.1 18-Nov-2007  bouyer Sync with HEAD
 1.18.12.1 09-Jan-2008  matt sync with HEAD
 1.18.10.1 21-Nov-2007  joerg Sync with HEAD.
 1.19.6.1 02-Jan-2008  bouyer Sync with HEAD
 1.19.2.1 26-Dec-2007  ad Sync with head.
 1.22.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.22.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.23.10.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.23.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.23.4.4 11-Aug-2010  yamt sync with head.
 1.23.4.3 11-Mar-2010  yamt sync with head
 1.23.4.2 20-Jun-2009  yamt sync with head
 1.23.4.1 04-May-2009  yamt sync with head.
 1.24.4.1 20-Nov-2008  snj Regen for ticket 81.
 1.24.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.27.4.3 04-Jan-2009  christos need opt_compat_netbsd.h
 1.27.4.2 30-Dec-2008  christos time_t 64 changes.
 1.27.4.1 19-Nov-2008  christos file linux_syscallargs.h was added on branch christos-time_t on 2008-12-30 19:34:33 +0000
 1.32.2.1 23-Jul-2009  jym Sync with HEAD.
 1.37.4.3 31-May-2011  rmind sync with head
 1.37.4.2 21-Apr-2011  rmind sync with head
 1.37.4.1 05-Mar-2011  rmind sync with head
 1.37.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.38.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.41.4.3 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.41.4.2 30-Oct-2012  yamt sync with head
 1.41.4.1 17-Apr-2012  yamt sync with head
 1.42.10.4 03-Dec-2017  jdolecek update from HEAD
 1.42.10.3 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.42.10.2 23-Jun-2013  tls resync from head
 1.42.10.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.44.4.1 18-May-2014  rmind sync with head
 1.48.2.1 10-Aug-2014  tls Rebase.
 1.54.2.1 17-Apr-2017  snj regen for ticket 1354
 1.55.2.6 28-Aug-2017  skrll Sync with HEAD
 1.55.2.5 05-Feb-2017  skrll Sync with HEAD
 1.55.2.4 05-Oct-2016  skrll Sync with HEAD
 1.55.2.3 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.55.2.2 06-Jun-2015  skrll Sync with HEAD
 1.55.2.1 06-Apr-2015  skrll Sync with HEAD
 1.59.2.3 20-Mar-2017  pgoyette Sync with HEAD
 1.59.2.2 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.59.2.1 26-Jul-2016  pgoyette Sync with HEAD
 1.63.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.67.4.1 11-May-2017  pgoyette Sync with HEAD
 1.68.10.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.68.10.1 10-Jun-2019  christos Sync with HEAD
 1.68.8.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.71.2.2 17-Dec-2020  thorpej Regen for preadv(2) and pwritev(2).
 1.71.2.1 15-Dec-2020  thorpej Regen for eventfd, timerfd, POSIX timers.
 1.82.2.1 02-Aug-2025  perseant Sync with HEAD
 1.85 26-Oct-2025  christos regen
 1.84 28-Sep-2024  christos regen
 1.83 01-Jul-2024  christos regen
 1.82 29-Jun-2024  christos branches: 1.82.2;
regen
 1.81 19-Aug-2023  christos regen
 1.80 18-Aug-2023  christos regen
 1.79 29-Jul-2023  christos regen
 1.78 28-Jul-2023  christos regen
 1.77 10-Jul-2023  christos Regen
 1.76 02-Dec-2021  ryo regen
 1.75 20-Sep-2021  thorpej Regen for preadv(2) / pwritev(2).
 1.74 20-Sep-2021  thorpej Regen for eventfd.
 1.73 19-Sep-2021  thorpej Regen for timerfd.
 1.72 19-Sep-2021  thorpej Regen for POSIX timer syscalls.
 1.71 26-Apr-2020  thorpej branches: 1.71.2;
Regen for native futex calls.
 1.70 09-Nov-2019  jdolecek regen
 1.69 10-Aug-2018  pgoyette Regen
 1.68 10-May-2017  riastradh branches: 1.68.8; 1.68.10;
regen
 1.67 03-Feb-2017  christos branches: 1.67.4;
regen
 1.66 03-Feb-2017  christos add sendmmsg and recvmmsg
 1.65 02-Feb-2017  christos regen
 1.64 16-Jan-2017  christos regen all
 1.63 13-Jan-2017  christos branches: 1.63.2;
regen
 1.62 02-Jan-2017  martin Regen (something apparently went wrong in previous)
 1.61 02-Jan-2017  manu Regen
 1.60 24-Jul-2016  njoly Regen for readlink/readlinkat signatures.
 1.59 27-Oct-2015  njoly branches: 1.59.2;
Regen
 1.58 24-Sep-2015  christos regen
 1.57 31-May-2015  njoly Regen for write(2) size argument fix.
 1.56 07-Mar-2015  christos regen
 1.55 22-Nov-2014  njoly branches: 1.55.2;
Regen for ppoll signature fix
 1.54 31-May-2014  njoly branches: 1.54.2;
Regen for munmap(2) signature.
 1.53 29-May-2014  njoly Regen for utimes(2) change.
 1.52 20-May-2014  njoly Regen for getgroups/setgroups update.
 1.51 17-May-2014  njoly Regen for fadvise64 offset types changes.
 1.50 04-May-2014  njoly Regen for pread/pwrite 64bit offset argument.
 1.49 08-Apr-2014  njoly Regen.
 1.48 08-Dec-2013  njoly branches: 1.48.2;
Regen.
 1.47 18-Nov-2013  chs regen
 1.46 07-Nov-2013  njoly Regen for dup/dup2/dup3 argument types fix.
 1.45 24-Sep-2013  njoly Regen for utimensat(2).
 1.44 08-Apr-2013  pooka branches: 1.44.4;
regen for utimes
 1.43 19-Sep-2012  pooka regen for ppoll (and, apparently, SYCALL_ARG_PTR)
 1.42 18-Nov-2011  christos branches: 1.42.10;
- add sigtimedwait support.
- merge the siginfo population code.
 1.41 30-May-2011  alnsn branches: 1.41.4;
Regenerate files to pick up correct RCS Ids. Suggested by Chris Badura.
 1.40 30-May-2011  alnsn Add fadvise64 and fadvise64_64 syscalls to compat_linux and compat_linux32.
 1.39 10-Apr-2011  christos Regen: Argh:
cat: rumphdr.types: No such file or directory
rm: rumphdr.types: No such file or directory
*** Error code 1
 1.38 07-Jul-2010  chs branches: 1.38.2;
regen
 1.37 14-Dec-2009  matt branches: 1.37.2; 1.37.4;
Regen (new makesyscalls.sh)
 1.36 24-Nov-2009  njoly Regen for personality(2) update.
 1.35 30-Oct-2009  njoly Regen for struct linux_stat64 fix.
 1.34 17-Jun-2009  njoly Regen for sendmsg/recvmsg definitions update.
 1.33 08-Jun-2009  njoly Regen for rt_queueinfo(2) update.
 1.32 17-Jan-2009  njoly branches: 1.32.2;
Regen for wait4 update.
 1.31 15-Jan-2009  njoly Rengen for compat50 update.
 1.30 13-Jan-2009  pooka Regen to prove I didn't screw up the conversion: purely RCSID changes.
 1.29 13-Jan-2009  pooka regen for #include "opt_compat_netbsd.h"
 1.28 11-Jan-2009  christos merge christos-time_t
 1.27 19-Nov-2008  ad branches: 1.27.4;
Regen.
 1.26 19-Nov-2008  njoly Regen for futex timeout argument cleanup/fix.
 1.25 12-Nov-2008  njoly Regen for nanosleep(2) fix.
 1.24 26-Oct-2008  christos branches: 1.24.2; 1.24.4;
regen.
 1.23 04-Apr-2008  njoly branches: 1.23.4; 1.23.6; 1.23.10;
Regen for linux_sys_msync removal.
 1.22 24-Dec-2007  njoly branches: 1.22.6;
Regen for linux_sys_getpgid removal.
 1.21 21-Dec-2007  njoly Regen for getfsuid/setfsgid syscall exchange.
 1.20 20-Dec-2007  dsl regen
 1.19 16-Nov-2007  njoly branches: 1.19.2; 1.19.6;
Regen, for syscalls cleanup.
 1.18 14-Mar-2007  njoly branches: 1.18.10; 1.18.12; 1.18.16; 1.18.18;
Regen (statfs/fstatfs fixes).
 1.17 09-Feb-2007  ad branches: 1.17.2; 1.17.6; 1.17.8;
Merge newlock2 to head.
 1.16 01-Sep-2006  matt branches: 1.16.2; 1.16.6;
Regen.
 1.15 30-Aug-2006  matt Regen
 1.14 24-Aug-2006  manu The return value for Linux shmat on amd64 does not suffer the same horrible
hack as on i386.
 1.13 25-Jun-2006  manu Regen
 1.12 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.11 10-Jun-2006  christos branches: 1.11.2;
regen
 1.10 09-Feb-2006  manu branches: 1.10.2; 1.10.8;
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.9 23-Nov-2005  manu branches: 1.9.2; 1.9.4; 1.9.6;
- Add Linux tkill and tgkill (partial emulation).
- Fix getrlimit on amd64
 1.8 05-Nov-2005  manu branches: 1.8.2; 1.8.4;
regen
 1.7 04-Nov-2005  manu regen
 1.6 18-Oct-2005  joerg Regen.
 1.5 22-Jun-2005  manu branches: 1.5.2;
Implent CLONE_PARENT_SETTID, CLONE_CHILD_CLEARTID, and CLONE_CHILD_SETTID
options to clone(). This makes fork() work on amd64.

clone() prototype has changed and the changes is probably revelant on some
other arches.
 1.4 22-May-2005  fvdl Regen after sigreturn argument change.
 1.3 16-May-2005  fvdl Regen.
 1.2 16-May-2005  fvdl Regen.
 1.1 03-May-2005  manu First work on COMPAT_LINUX/amd64
Process startup and dynamiclinking work, but processes hang due to
Linux arch_prctl(2) not being really supported yet.
 1.5.2.6 21-Jan-2008  yamt sync with head
 1.5.2.5 07-Dec-2007  yamt sync with head
 1.5.2.4 03-Sep-2007  yamt sync with head.
 1.5.2.3 26-Feb-2007  yamt sync with head.
 1.5.2.2 30-Dec-2006  yamt sync with head.
 1.5.2.1 21-Jun-2006  yamt sync with head.
 1.8.4.1 29-Nov-2005  yamt sync with head.
 1.8.2.3 11-Dec-2005  christos Sync with head.
 1.8.2.2 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.8.2.1 05-Nov-2005  skrll file linux_syscalls.c was added on branch ktrace-lwp on 2005-11-10 14:00:59 +0000
 1.9.6.1 22-Apr-2006  simonb Sync with head.
 1.9.4.1 09-Sep-2006  rpaulo sync with head
 1.9.2.1 18-Feb-2006  yamt sync with head.
 1.10.8.1 19-Jun-2006  chap Sync with head.
 1.10.2.2 03-Sep-2006  yamt sync with head.
 1.10.2.1 26-Jun-2006  yamt sync with head.
 1.11.2.1 13-Jul-2006  gdamore Merge from HEAD.
 1.16.6.1 20-Apr-2007  bouyer regen for ticket #581
 1.16.2.1 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.17.8.1 11-Jul-2007  mjf Sync with head.
 1.17.6.1 10-Apr-2007  ad Sync with head.
 1.17.2.1 24-Mar-2007  yamt sync with head.
 1.18.18.2 27-Dec-2007  mjf Sync with HEAD.
 1.18.18.1 19-Nov-2007  mjf Sync with HEAD.
 1.18.16.1 18-Nov-2007  bouyer Sync with HEAD
 1.18.12.1 09-Jan-2008  matt sync with HEAD
 1.18.10.1 21-Nov-2007  joerg Sync with HEAD.
 1.19.6.1 02-Jan-2008  bouyer Sync with HEAD
 1.19.2.1 26-Dec-2007  ad Sync with head.
 1.22.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.22.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.23.10.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.23.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.23.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.23.4.4 11-Aug-2010  yamt sync with head.
 1.23.4.3 11-Mar-2010  yamt sync with head
 1.23.4.2 20-Jun-2009  yamt sync with head
 1.23.4.1 04-May-2009  yamt sync with head.
 1.24.4.1 20-Nov-2008  snj Regen for ticket 81.
 1.24.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.27.4.3 04-Jan-2009  christos need opt_compat_netbsd.h
 1.27.4.2 30-Dec-2008  christos time_t 64 changes.
 1.27.4.1 19-Nov-2008  christos file linux_syscalls.c was added on branch christos-time_t on 2008-12-30 19:34:33 +0000
 1.32.2.1 23-Jul-2009  jym Sync with HEAD.
 1.37.4.3 31-May-2011  rmind sync with head
 1.37.4.2 21-Apr-2011  rmind sync with head
 1.37.4.1 05-Mar-2011  rmind sync with head
 1.37.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.38.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.41.4.3 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.41.4.2 30-Oct-2012  yamt sync with head
 1.41.4.1 17-Apr-2012  yamt sync with head
 1.42.10.4 03-Dec-2017  jdolecek update from HEAD
 1.42.10.3 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.42.10.2 23-Jun-2013  tls resync from head
 1.42.10.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.44.4.1 18-May-2014  rmind sync with head
 1.48.2.1 10-Aug-2014  tls Rebase.
 1.54.2.1 17-Apr-2017  snj regen for ticket 1354
 1.55.2.5 05-Feb-2017  skrll Sync with HEAD
 1.55.2.4 05-Oct-2016  skrll Sync with HEAD
 1.55.2.3 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.55.2.2 06-Jun-2015  skrll Sync with HEAD
 1.55.2.1 06-Apr-2015  skrll Sync with HEAD
 1.59.2.3 20-Mar-2017  pgoyette Sync with HEAD
 1.59.2.2 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.59.2.1 26-Jul-2016  pgoyette Sync with HEAD
 1.63.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.67.4.1 11-May-2017  pgoyette Sync with HEAD
 1.68.10.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.68.10.1 10-Jun-2019  christos Sync with HEAD
 1.68.8.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.71.2.2 17-Dec-2020  thorpej Regen for preadv(2) and pwritev(2).
 1.71.2.1 15-Dec-2020  thorpej Regen for eventfd, timerfd, POSIX timers.
 1.82.2.1 02-Aug-2025  perseant Sync with HEAD
 1.85 26-Oct-2025  christos regen
 1.84 28-Sep-2024  christos regen
 1.83 01-Jul-2024  christos regen
 1.82 29-Jun-2024  christos branches: 1.82.2;
regen
 1.81 19-Aug-2023  christos regen
 1.80 18-Aug-2023  christos regen
 1.79 29-Jul-2023  christos regen
 1.78 28-Jul-2023  christos regen
 1.77 10-Jul-2023  christos Regen
 1.76 02-Dec-2021  ryo regen
 1.75 20-Sep-2021  thorpej Regen for preadv(2) / pwritev(2).
 1.74 20-Sep-2021  thorpej Regen for eventfd.
 1.73 19-Sep-2021  thorpej Regen for timerfd.
 1.72 19-Sep-2021  thorpej Regen for POSIX timer syscalls.
 1.71 26-Apr-2020  thorpej branches: 1.71.2;
Regen for native futex calls.
 1.70 09-Nov-2019  jdolecek regen
 1.69 10-Aug-2018  pgoyette Regen
 1.68 10-May-2017  riastradh branches: 1.68.8; 1.68.10;
regen
 1.67 03-Feb-2017  christos branches: 1.67.4;
regen
 1.66 03-Feb-2017  christos add sendmmsg and recvmmsg
 1.65 02-Feb-2017  christos regen
 1.64 16-Jan-2017  christos regen all
 1.63 13-Jan-2017  christos branches: 1.63.2;
regen
 1.62 02-Jan-2017  martin Regen (something apparently went wrong in previous)
 1.61 02-Jan-2017  manu Regen
 1.60 24-Jul-2016  njoly Regen for readlink/readlinkat signatures.
 1.59 27-Oct-2015  njoly branches: 1.59.2;
Regen
 1.58 24-Sep-2015  christos regen
 1.57 31-May-2015  njoly Regen for write(2) size argument fix.
 1.56 07-Mar-2015  christos regen
 1.55 22-Nov-2014  njoly branches: 1.55.2;
Regen for ppoll signature fix
 1.54 31-May-2014  njoly branches: 1.54.2;
Regen for munmap(2) signature.
 1.53 29-May-2014  njoly Regen for utimes(2) change.
 1.52 20-May-2014  njoly Regen for getgroups/setgroups update.
 1.51 17-May-2014  njoly Regen for fadvise64 offset types changes.
 1.50 04-May-2014  njoly Regen for pread/pwrite 64bit offset argument.
 1.49 08-Apr-2014  njoly Regen.
 1.48 08-Dec-2013  njoly branches: 1.48.2;
Regen.
 1.47 18-Nov-2013  chs regen
 1.46 07-Nov-2013  njoly Regen for dup/dup2/dup3 argument types fix.
 1.45 24-Sep-2013  njoly Regen for utimensat(2).
 1.44 08-Apr-2013  pooka branches: 1.44.4;
regen for utimes
 1.43 19-Sep-2012  pooka regen for ppoll (and, apparently, SYCALL_ARG_PTR)
 1.42 18-Nov-2011  christos branches: 1.42.10;
- add sigtimedwait support.
- merge the siginfo population code.
 1.41 30-May-2011  alnsn branches: 1.41.4;
Regenerate files to pick up correct RCS Ids. Suggested by Chris Badura.
 1.40 30-May-2011  alnsn Add fadvise64 and fadvise64_64 syscalls to compat_linux and compat_linux32.
 1.39 10-Apr-2011  christos Regen: Argh:
cat: rumphdr.types: No such file or directory
rm: rumphdr.types: No such file or directory
*** Error code 1
 1.38 07-Jul-2010  chs branches: 1.38.2;
regen
 1.37 14-Dec-2009  matt branches: 1.37.2; 1.37.4;
Regen (new makesyscalls.sh)
 1.36 24-Nov-2009  njoly Regen for personality(2) update.
 1.35 30-Oct-2009  njoly Regen for struct linux_stat64 fix.
 1.34 17-Jun-2009  njoly Regen for sendmsg/recvmsg definitions update.
 1.33 08-Jun-2009  njoly Regen for rt_queueinfo(2) update.
 1.32 17-Jan-2009  njoly branches: 1.32.2;
Regen for wait4 update.
 1.31 15-Jan-2009  njoly Rengen for compat50 update.
 1.30 13-Jan-2009  pooka Regen to prove I didn't screw up the conversion: purely RCSID changes.
 1.29 13-Jan-2009  pooka regen for #include "opt_compat_netbsd.h"
 1.28 11-Jan-2009  christos merge christos-time_t
 1.27 19-Nov-2008  ad branches: 1.27.4;
Regen.
 1.26 19-Nov-2008  njoly Regen for futex timeout argument cleanup/fix.
 1.25 12-Nov-2008  njoly Regen for nanosleep(2) fix.
 1.24 26-Oct-2008  christos branches: 1.24.2; 1.24.4;
regen.
 1.23 04-Apr-2008  njoly branches: 1.23.4; 1.23.6; 1.23.10;
Regen for linux_sys_msync removal.
 1.22 24-Dec-2007  njoly branches: 1.22.6;
Regen for linux_sys_getpgid removal.
 1.21 21-Dec-2007  njoly Regen for getfsuid/setfsgid syscall exchange.
 1.20 20-Dec-2007  dsl regen
 1.19 16-Nov-2007  njoly branches: 1.19.2; 1.19.6;
Regen, for syscalls cleanup.
 1.18 14-Mar-2007  njoly branches: 1.18.10; 1.18.12; 1.18.16; 1.18.18;
Regen (statfs/fstatfs fixes).
 1.17 09-Feb-2007  ad branches: 1.17.2; 1.17.6; 1.17.8;
Merge newlock2 to head.
 1.16 01-Sep-2006  matt branches: 1.16.2; 1.16.6;
Regen.
 1.15 30-Aug-2006  matt Regen
 1.14 24-Aug-2006  manu The return value for Linux shmat on amd64 does not suffer the same horrible
hack as on i386.
 1.13 25-Jun-2006  manu Regen
 1.12 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.11 10-Jun-2006  christos branches: 1.11.2;
regen
 1.10 09-Feb-2006  manu branches: 1.10.2; 1.10.8;
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.9 23-Nov-2005  manu branches: 1.9.2; 1.9.4; 1.9.6;
- Add Linux tkill and tgkill (partial emulation).
- Fix getrlimit on amd64
 1.8 05-Nov-2005  manu branches: 1.8.2; 1.8.4;
regen
 1.7 04-Nov-2005  manu regen
 1.6 18-Oct-2005  joerg Regen.
 1.5 22-Jun-2005  manu branches: 1.5.2;
Implent CLONE_PARENT_SETTID, CLONE_CHILD_CLEARTID, and CLONE_CHILD_SETTID
options to clone(). This makes fork() work on amd64.

clone() prototype has changed and the changes is probably revelant on some
other arches.
 1.4 22-May-2005  fvdl Regen after sigreturn argument change.
 1.3 16-May-2005  fvdl Regen.
 1.2 16-May-2005  fvdl Regen.
 1.1 03-May-2005  manu First work on COMPAT_LINUX/amd64
Process startup and dynamiclinking work, but processes hang due to
Linux arch_prctl(2) not being really supported yet.
 1.5.2.6 21-Jan-2008  yamt sync with head
 1.5.2.5 07-Dec-2007  yamt sync with head
 1.5.2.4 03-Sep-2007  yamt sync with head.
 1.5.2.3 26-Feb-2007  yamt sync with head.
 1.5.2.2 30-Dec-2006  yamt sync with head.
 1.5.2.1 21-Jun-2006  yamt sync with head.
 1.8.4.1 29-Nov-2005  yamt sync with head.
 1.8.2.3 11-Dec-2005  christos Sync with head.
 1.8.2.2 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.8.2.1 05-Nov-2005  skrll file linux_sysent.c was added on branch ktrace-lwp on 2005-11-10 14:00:59 +0000
 1.9.6.1 22-Apr-2006  simonb Sync with head.
 1.9.4.1 09-Sep-2006  rpaulo sync with head
 1.9.2.1 18-Feb-2006  yamt sync with head.
 1.10.8.1 19-Jun-2006  chap Sync with head.
 1.10.2.2 03-Sep-2006  yamt sync with head.
 1.10.2.1 26-Jun-2006  yamt sync with head.
 1.11.2.1 13-Jul-2006  gdamore Merge from HEAD.
 1.16.6.1 20-Apr-2007  bouyer regen for ticket #581
 1.16.2.1 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.17.8.1 11-Jul-2007  mjf Sync with head.
 1.17.6.1 10-Apr-2007  ad Sync with head.
 1.17.2.1 24-Mar-2007  yamt sync with head.
 1.18.18.2 27-Dec-2007  mjf Sync with HEAD.
 1.18.18.1 19-Nov-2007  mjf Sync with HEAD.
 1.18.16.1 18-Nov-2007  bouyer Sync with HEAD
 1.18.12.1 09-Jan-2008  matt sync with HEAD
 1.18.10.1 21-Nov-2007  joerg Sync with HEAD.
 1.19.6.1 02-Jan-2008  bouyer Sync with HEAD
 1.19.2.1 26-Dec-2007  ad Sync with head.
 1.22.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.22.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.23.10.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.23.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.23.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.23.4.4 11-Aug-2010  yamt sync with head.
 1.23.4.3 11-Mar-2010  yamt sync with head
 1.23.4.2 20-Jun-2009  yamt sync with head
 1.23.4.1 04-May-2009  yamt sync with head.
 1.24.4.1 20-Nov-2008  snj Regen for ticket 81.
 1.24.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.27.4.3 04-Jan-2009  christos need opt_compat_netbsd.h
 1.27.4.2 30-Dec-2008  christos time_t 64 changes.
 1.27.4.1 19-Nov-2008  christos file linux_sysent.c was added on branch christos-time_t on 2008-12-30 19:34:33 +0000
 1.32.2.1 23-Jul-2009  jym Sync with HEAD.
 1.37.4.3 31-May-2011  rmind sync with head
 1.37.4.2 21-Apr-2011  rmind sync with head
 1.37.4.1 05-Mar-2011  rmind sync with head
 1.37.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.38.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.41.4.3 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.41.4.2 30-Oct-2012  yamt sync with head
 1.41.4.1 17-Apr-2012  yamt sync with head
 1.42.10.4 03-Dec-2017  jdolecek update from HEAD
 1.42.10.3 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.42.10.2 23-Jun-2013  tls resync from head
 1.42.10.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.44.4.1 18-May-2014  rmind sync with head
 1.48.2.1 10-Aug-2014  tls Rebase.
 1.54.2.1 17-Apr-2017  snj regen for ticket 1354
 1.55.2.5 05-Feb-2017  skrll Sync with HEAD
 1.55.2.4 05-Oct-2016  skrll Sync with HEAD
 1.55.2.3 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.55.2.2 06-Jun-2015  skrll Sync with HEAD
 1.55.2.1 06-Apr-2015  skrll Sync with HEAD
 1.59.2.3 20-Mar-2017  pgoyette Sync with HEAD
 1.59.2.2 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.59.2.1 26-Jul-2016  pgoyette Sync with HEAD
 1.63.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.67.4.1 11-May-2017  pgoyette Sync with HEAD
 1.68.10.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.68.10.1 10-Jun-2019  christos Sync with HEAD
 1.68.8.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.71.2.2 17-Dec-2020  thorpej Regen for preadv(2) and pwritev(2).
 1.71.2.1 15-Dec-2020  thorpej Regen for eventfd, timerfd, POSIX timers.
 1.82.2.1 02-Aug-2025  perseant Sync with HEAD
 1.29 26-Oct-2025  christos regen
 1.28 28-Sep-2024  christos regen
 1.27 01-Jul-2024  christos regen
 1.26 29-Jun-2024  christos branches: 1.26.2;
regen
 1.25 19-Aug-2023  christos regen
 1.24 18-Aug-2023  christos regen
 1.23 29-Jul-2023  christos regen
 1.22 28-Jul-2023  christos regen
 1.21 10-Jul-2023  christos Regen
 1.20 02-Dec-2021  ryo regen
 1.19 20-Sep-2021  thorpej Regen for preadv(2) / pwritev(2).
 1.18 20-Sep-2021  thorpej Regen for eventfd.
 1.17 19-Sep-2021  thorpej Regen for timerfd.
 1.16 19-Sep-2021  thorpej Regen for POSIX timer syscalls.
 1.15 26-Apr-2020  thorpej branches: 1.15.2;
Regen for native futex calls.
 1.14 09-Nov-2019  jdolecek regen
 1.13 10-Aug-2018  pgoyette Regen
 1.12 10-May-2017  riastradh branches: 1.12.8; 1.12.10; 1.12.12;
regen
 1.11 03-Feb-2017  christos branches: 1.11.4;
regen
 1.10 03-Feb-2017  christos add sendmmsg and recvmmsg
 1.9 02-Feb-2017  christos regen
 1.8 16-Jan-2017  christos regen all
 1.7 13-Jan-2017  christos branches: 1.7.2;
regen
 1.6 02-Jan-2017  martin Regen (something apparently went wrong in previous)
 1.5 24-Jul-2016  njoly Regen for readlink/readlinkat signatures.
 1.4 27-Oct-2015  njoly branches: 1.4.2;
Regen
 1.3 24-Sep-2015  christos regen
 1.2 31-May-2015  njoly Regen for write(2) size argument fix.
 1.1 07-Mar-2015  christos branches: 1.1.2;
regen
 1.1.2.6 05-Feb-2017  skrll Sync with HEAD
 1.1.2.5 05-Oct-2016  skrll Sync with HEAD
 1.1.2.4 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.1.2.3 06-Jun-2015  skrll Sync with HEAD
 1.1.2.2 06-Apr-2015  skrll Sync with HEAD
 1.1.2.1 07-Mar-2015  skrll file linux_systrace_args.c was added on branch nick-nhusb on 2015-04-06 15:18:05 +0000
 1.4.2.3 20-Mar-2017  pgoyette Sync with HEAD
 1.4.2.2 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.4.2.1 26-Jul-2016  pgoyette Sync with HEAD
 1.7.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.11.4.1 11-May-2017  pgoyette Sync with HEAD
 1.12.12.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.12.12.1 10-Jun-2019  christos Sync with HEAD
 1.12.10.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.12.8.2 03-Dec-2017  jdolecek update from HEAD
 1.12.8.1 10-May-2017  jdolecek file linux_systrace_args.c was added on branch tls-maxphys on 2017-12-03 11:36:53 +0000
 1.15.2.2 17-Dec-2020  thorpej Regen for preadv(2) and pwritev(2).
 1.15.2.1 15-Dec-2020  thorpej Regen for eventfd, timerfd, POSIX timers.
 1.26.2.1 02-Aug-2025  perseant Sync with HEAD
 1.4 01-Oct-2024  riastradh sys/compat/linux/arch: Nix trailing whitespace.

No functional change intended.
 1.3 29-Jun-2008  njoly branches: 1.3.120;
Move amd64 MD termois types definitions from linux_termios.h to linux_types.h
following other archs.
 1.2 11-Dec-2005  christos branches: 1.2.70; 1.2.74; 1.2.76; 1.2.78;
merge ktrace-lwp.
 1.1 03-May-2005  manu branches: 1.1.8;
First work on COMPAT_LINUX/amd64
Process startup and dynamiclinking work, but processes hang due to
Linux arch_prctl(2) not being really supported yet.
 1.1.8.2 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.1.8.1 03-May-2005  skrll file linux_termios.h was added on branch ktrace-lwp on 2005-11-10 14:00:59 +0000
 1.2.78.1 03-Jul-2008  simonb Sync with head.
 1.2.76.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.2.74.1 04-May-2009  yamt sync with head.
 1.2.70.1 29-Jun-2008  mjf Sync with HEAD.
 1.3.120.1 02-Aug-2025  perseant Sync with HEAD
 1.7 01-Oct-2024  riastradh sys/compat/linux/arch: Nix trailing whitespace.

No functional change intended.
 1.6 11-Jan-2009  christos branches: 1.6.102;
merge christos-time_t
 1.5 29-Jun-2008  njoly branches: 1.5.4; 1.5.10;
Move amd64 MD termois types definitions from linux_termios.h to linux_types.h
following other archs.
 1.4 25-Dec-2007  perry branches: 1.4.6; 1.4.10; 1.4.12; 1.4.14;
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 11-Dec-2005  christos branches: 1.2.26; 1.2.30; 1.2.32;
merge ktrace-lwp.
 1.1 03-May-2005  manu branches: 1.1.2; 1.1.8;
First work on COMPAT_LINUX/amd64
Process startup and dynamiclinking work, but processes hang due to
Linux arch_prctl(2) not being really supported yet.
 1.1.8.2 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.1.8.1 03-May-2005  skrll file linux_types.h was added on branch ktrace-lwp on 2005-11-10 14:00:59 +0000
 1.1.2.2 21-Jan-2008  yamt sync with head
 1.1.2.1 03-Sep-2007  yamt sync with head.
 1.2.32.1 11-Jul-2007  mjf Sync with head.
 1.2.30.1 10-Apr-2007  ad Sync with head.
 1.2.26.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.14.1 03-Jul-2008  simonb Sync with head.
 1.4.12.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.4.10.1 04-May-2009  yamt sync with head.
 1.4.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.4.6.1 29-Jun-2008  mjf Sync with HEAD.
 1.5.10.2 30-Dec-2008  christos time_t 64 changes.
 1.5.10.1 29-Jun-2008  christos file linux_types.h was added on branch christos-time_t on 2008-12-30 19:34:33 +0000
 1.5.4.1 19-Jan-2009  skrll Sync with HEAD.
 1.6.102.1 02-Aug-2025  perseant Sync with HEAD
 1.3 07-Mar-2015  christos Add systrace output file
 1.2 11-Dec-2005  christos branches: 1.2.120; 1.2.140;
merge ktrace-lwp.
 1.1 03-May-2005  manu branches: 1.1.8;
First work on COMPAT_LINUX/amd64
Process startup and dynamiclinking work, but processes hang due to
Linux arch_prctl(2) not being really supported yet.
 1.1.8.2 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.1.8.1 03-May-2005  skrll file syscalls.conf was added on branch ktrace-lwp on 2005-11-10 14:00:59 +0000
 1.2.140.1 06-Apr-2015  skrll Sync with HEAD
 1.2.120.1 03-Dec-2017  jdolecek update from HEAD
 1.76 26-Oct-2025  christos PR/59722: Ricardo Branco: linux: Add support for semtimedop(2)
 1.75 28-Sep-2024  christos Linux GSoC-2024: renameat2, clone3, sync_file_range, syncfs (Shivraj Jamgade)
 1.74 01-Jul-2024  christos Add linux POSIX message queue support (Ricardo Branco)
 1.73 29-Jun-2024  christos branches: 1.73.2;
From gsoc 2024: Implement faccessat2 and getcpu (Shivraz)
 1.72 19-Aug-2023  christos Add inotify* syscalls GSoC 2023 (Theodore Preduta)
 1.71 18-Aug-2023  christos Add linux waitid(2) from GSoC 2023 (Theodore Preduta)
 1.70 29-Jul-2023  christos Add/fix statx, readahead, close_range. From GSoC 2023 by Theodore Preduta
 1.69 28-Jul-2023  christos Add epoll(2) from Theodore Preduta as part of GSoC 2023
 1.68 10-Jul-2023  christos Add memfd_create(2) from GSoC 2023 by Theodore Preduta
 1.67 02-Dec-2021  ryo add prlimit64(2) syscall to COMPAT_LINUX and COMPAT_LINUX32
 1.66 20-Sep-2021  thorpej Add preadv(2) and pwritev(2) system calls to COMPAT_LINUX and COMPAT_LINUX32.
 1.65 20-Sep-2021  thorpej Add the eventfd system calls to COMPAT_LINUX and COMPAT_LINUX32.
 1.64 19-Sep-2021  thorpej Add the timerfd syscalls to COMPAT_LINUX and COMPAT_LINUX32.
 1.63 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.62 26-Apr-2020  thorpej branches: 1.62.2;
Add a NetBSD native futex implementation, mostly written by riastradh@.
Map the COMPAT_LINUX futex calls to the native ones.
 1.61 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.60 03-Feb-2017  christos branches: 1.60.14;
add sendmmsg and recvmmsg
 1.59 02-Feb-2017  christos implement accept4
XXX: mips looks busted (the syscalls file has lots of NOARGS syscalls that
should be STD).
 1.58 02-Jan-2017  manu branches: 1.58.2;
Add pselect6 Linux system call.
This lets Matlab R2016A run on NetBSD/amd64
 1.57 24-Jul-2016  njoly Small cleanup. Adjust readlink/readlinkat signatures to reduce diffs with
native.
 1.56 27-Oct-2015  njoly branches: 1.56.2;
Fix setuid/setgid return type (void -> int) to match native.
 1.55 31-May-2015  njoly Fix write(2) size argument (int -> size_t).
 1.54 07-Mar-2015  christos fix inconsistent names
 1.53 22-Nov-2014  njoly branches: 1.53.2;
Fix ppoll signature (int ->u_int)
 1.52 31-May-2014  njoly branches: 1.52.2;
Fix munmap(2) signature.
 1.51 29-May-2014  njoly For utimes(2), use compat_50_sys_utimes() instead of local version.
 1.50 20-May-2014  njoly Fix getgroups/setgroups signature.
 1.49 17-May-2014  njoly Fix fadvise64 syscalls to use 64bit offset types.
 1.48 04-May-2014  njoly Fix pread/pwrite syscalls which need a 64bit offset argument.
 1.47 08-Apr-2014  njoly Adjust read/write/readv/writev signature to match native versions.
 1.46 08-Dec-2013  njoly branches: 1.46.2;
Sprinkle a few more linux_umode_t where appropriate.
Reduce diffs between archs.
 1.45 18-Nov-2013  chs implement the *at() syscalls.
bring the unimplemented syscall list up to date.
 1.44 07-Nov-2013  njoly Fix dup/dup2/dup3 argument types (u_int -> int).
 1.43 24-Sep-2013  njoly Add utimensat(2) for compat linux.
 1.42 08-Apr-2013  pooka branches: 1.42.4;
support utimes on non-alpha linux platforms
 1.41 19-Sep-2012  pooka emulate ppoll which is essentially our pollts
 1.40 18-Nov-2011  christos branches: 1.40.10;
add sigtimedwait
 1.39 09-Jul-2011  christos branches: 1.39.2;
revert accidental commit from unrelated change. no custom linux fork.
 1.38 09-Jul-2011  christos the first argument of {g,s}etitimer() is int not u_int.
 1.37 30-May-2011  alnsn Add fadvise64 and fadvise64_64 syscalls to compat_linux and compat_linux32.
 1.36 10-Apr-2011  christos add pipe2 and dup3
 1.35 07-Jul-2010  chs branches: 1.35.2;
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.34 24-Nov-2009  njoly branches: 1.34.2; 1.34.4;
Update personality(2) to match Linux definition where the argument is an
unsigned long.
 1.33 30-Oct-2009  njoly stat64 syscalls require struct linux_stat64.
 1.32 17-Jun-2009  njoly Add a new linux_msghdr structure, as its size differs on 64bit archs.
Do the needed conversions in sendmsg/recvmsg syscalls, and adjust
their definitions accordingly.
 1.31 08-Jun-2009  njoly Update rt_queueinfo(2) definition, and kill a corresponding comment.
 1.30 17-Jan-2009  njoly branches: 1.30.2;
Convert linux/linux32 wait(4) to use a compat50 rusage structure.
 1.29 15-Jan-2009  njoly Update some syscalls/arguments to use the new compat50 equivalents.
 1.28 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.27 11-Jan-2009  christos merge christos-time_t
 1.26 19-Nov-2008  njoly branches: 1.26.4;
futex(2) timeout argument cleanup/fix.
- Use `struct linux_timespec', converted to native structure.
- Ensure that provided values are correct.
- Replace timeval+tvtohz by tstohz.
 1.25 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.24 26-Oct-2008  christos branches: 1.24.2; 1.24.4;
catch up with i386 changes.
 1.23 04-Apr-2008  njoly branches: 1.23.4; 1.23.6; 1.23.10;
Cleanup. Kill linux_sys_msync and use sys___msync13 instead.
No functional changes expected.
 1.22 24-Dec-2007  njoly branches: 1.22.6;
Kill unneeded linux_sys_getpgid and use native sys_getpgid instead.
 1.21 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.20 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.19 16-Nov-2007  njoly branches: 1.19.2; 1.19.6;
Cleanup. Remove a few linux syscalls definitions, now identical to
native ones (with stackgap and ALT_CHECK_xxx removal). No functional
changes expected.
 1.18 14-Mar-2007  njoly branches: 1.18.10; 1.18.12; 1.18.16; 1.18.18;
Fix compat linux statfs/fstatfs syscalls on amd64.
- Do not use statfs64/fstatfs64 as they have an extra size argument.
- Add full 64bit linux struct statfs support.

ok by manu
 1.17 04-Mar-2007  christos branches: 1.17.2; 1.17.4;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.16 09-Feb-2007  ad branches: 1.16.2;
Merge newlock2 to head.
 1.15 01-Sep-2006  matt branches: 1.15.2; 1.15.6;
Don't conditionalize *sys_ptrace. The lack of sys_ptrace will be dealt
with differently.
 1.14 30-Aug-2006  matt Update to deal with options PTRACE
 1.13 24-Aug-2006  manu The return value for Linux shmat on amd64 does not suffer the same horrible
hack as on i386.
 1.12 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.11 10-Jun-2006  christos branches: 1.11.2;
linux getpriority is off-by-20 so use our own function.
From PR/33671: Nicolas Joly
 1.10 09-Feb-2006  manu branches: 1.10.2; 1.10.8;
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.9 23-Nov-2005  manu branches: 1.9.2; 1.9.4; 1.9.6;
- Add Linux tkill and tgkill (partial emulation).
- Fix getrlimit on amd64
 1.8 05-Nov-2005  manu branches: 1.8.2; 1.8.4;
Implement Linux sched_{set|get}affinity
 1.7 04-Nov-2005  manu Implement Linux futex and gettid system calls for amd64
 1.6 18-Oct-2005  joerg sys_uselib is needed by COMPAT_LINUX for EXEC_AOUT. Since it doesn't get
build when EXEC_AOUT is not defined, the syscalls.master entry has to be
conditionalized. Alpha did so already, so let the other archs catch up
with it.

Go-on: christos
 1.5 22-Jun-2005  manu branches: 1.5.2;
Implent CLONE_PARENT_SETTID, CLONE_CHILD_CLEARTID, and CLONE_CHILD_SETTID
options to clone(). This makes fork() work on amd64.

clone() prototype has changed and the changes is probably revelant on some
other arches.
 1.4 22-May-2005  fvdl Change sigreturn to have no arguments.
 1.3 16-May-2005  fvdl Add clock_* POSIX functions.
 1.2 16-May-2005  fvdl Add *xattr functions (they all return EOPNOTSUPP).
 1.1 03-May-2005  manu First work on COMPAT_LINUX/amd64
Process startup and dynamiclinking work, but processes hang due to
Linux arch_prctl(2) not being really supported yet.
 1.5.2.6 21-Jan-2008  yamt sync with head
 1.5.2.5 07-Dec-2007  yamt sync with head
 1.5.2.4 03-Sep-2007  yamt sync with head.
 1.5.2.3 26-Feb-2007  yamt sync with head.
 1.5.2.2 30-Dec-2006  yamt sync with head.
 1.5.2.1 21-Jun-2006  yamt sync with head.
 1.8.4.1 29-Nov-2005  yamt sync with head.
 1.8.2.3 11-Dec-2005  christos Sync with head.
 1.8.2.2 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.8.2.1 05-Nov-2005  skrll file syscalls.master was added on branch ktrace-lwp on 2005-11-10 14:00:59 +0000
 1.9.6.1 22-Apr-2006  simonb Sync with head.
 1.9.4.1 09-Sep-2006  rpaulo sync with head
 1.9.2.1 18-Feb-2006  yamt sync with head.
 1.10.8.1 19-Jun-2006  chap Sync with head.
 1.10.2.2 03-Sep-2006  yamt sync with head.
 1.10.2.1 26-Jun-2006  yamt sync with head.
 1.11.2.1 13-Jul-2006  gdamore Merge from HEAD.
 1.15.6.1 20-Apr-2007  bouyer Pull up following revision(s) (requested by njoly in ticket #581):
sys/compat/linux/common/linux_misc.c: revision 1.168
sys/compat/linux/arch/amd64/syscalls.master: revision 1.18
sys/compat/linux/common/linux_types.h: revision 1.25
sys/compat/linux/arch/amd64/linux_machdep.h: revision 1.6
sys/compat/linux/common/linux_misc_notalpha.c: revision 1.87
Fix compat linux statfs/fstatfs syscalls on amd64.
- Do not use statfs64/fstatfs64 as they have an extra size argument.
- Add full 64bit linux struct statfs support.
 1.15.2.1 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.16.2.2 24-Mar-2007  yamt sync with head.
 1.16.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.17.4.1 11-Jul-2007  mjf Sync with head.
 1.17.2.1 10-Apr-2007  ad Sync with head.
 1.18.18.2 27-Dec-2007  mjf Sync with HEAD.
 1.18.18.1 19-Nov-2007  mjf Sync with HEAD.
 1.18.16.1 18-Nov-2007  bouyer Sync with HEAD
 1.18.12.1 09-Jan-2008  matt sync with HEAD
 1.18.10.1 21-Nov-2007  joerg Sync with HEAD.
 1.19.6.1 02-Jan-2008  bouyer Sync with HEAD
 1.19.2.1 26-Dec-2007  ad Sync with head.
 1.22.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.22.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.23.10.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.23.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.23.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.23.4.4 11-Aug-2010  yamt sync with head.
 1.23.4.3 11-Mar-2010  yamt sync with head
 1.23.4.2 20-Jun-2009  yamt sync with head
 1.23.4.1 04-May-2009  yamt sync with head.
 1.24.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.24.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.26.4.3 04-Jan-2009  christos need opt_compat_netbsd.h
 1.26.4.2 30-Dec-2008  christos time_t 64 changes.
 1.26.4.1 19-Nov-2008  christos file syscalls.master was added on branch christos-time_t on 2008-12-30 19:34:34 +0000
 1.30.2.1 23-Jul-2009  jym Sync with HEAD.
 1.34.4.3 31-May-2011  rmind sync with head
 1.34.4.2 21-Apr-2011  rmind sync with head
 1.34.4.1 05-Mar-2011  rmind sync with head
 1.34.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.35.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.39.2.3 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.39.2.2 30-Oct-2012  yamt sync with head
 1.39.2.1 17-Apr-2012  yamt sync with head
 1.40.10.4 03-Dec-2017  jdolecek update from HEAD
 1.40.10.3 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.40.10.2 23-Jun-2013  tls resync from head
 1.40.10.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.42.4.1 18-May-2014  rmind sync with head
 1.46.2.1 10-Aug-2014  tls Rebase.
 1.52.2.1 17-Apr-2017  snj Pull up following revision(s) (requested by manu in ticket #1354):
sys/compat/linux/arch/alpha/syscalls.master: revision 1.92 via patch
sys/compat/linux/arch/amd64/syscalls.master: revision 1.58 via patch
sys/compat/linux/arch/arm/syscalls.master: revision 1.65 via patch
sys/compat/linux/arch/i386/syscalls.master: revision 1.122 via patch
sys/compat/linux/arch/m68k/syscalls.master: revision 1.91 via patch
sys/compat/linux/arch/mips/syscalls.master: revision 1.61 via patch
sys/compat/linux/arch/powerpc/syscalls.master: revision 1.70 via patch
sys/compat/linux/common/linux_misc.c: revision 1.234
sys/compat/linux/common/linux_signal.h: revision 1.31
Add pselect6 Linux system call.
This lets Matlab R2016A run on NetBSD/amd64
 1.53.2.5 05-Feb-2017  skrll Sync with HEAD
 1.53.2.4 05-Oct-2016  skrll Sync with HEAD
 1.53.2.3 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.53.2.2 06-Jun-2015  skrll Sync with HEAD
 1.53.2.1 06-Apr-2015  skrll Sync with HEAD
 1.56.2.3 20-Mar-2017  pgoyette Sync with HEAD
 1.56.2.2 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.56.2.1 26-Jul-2016  pgoyette Sync with HEAD
 1.58.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.60.14.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.62.2.2 17-Dec-2020  thorpej Add suppport for Linux preadv(2) and pwritev(2). Same as native, except
for the silly way that the offset argument is passed in.
 1.62.2.1 15-Dec-2020  thorpej Add Linux eventfd, timerfd, and POSIX timer calls.
 1.73.2.1 02-Aug-2025  perseant Sync with HEAD

RSS XML Feed