Home | History | Annotate | only in /src/sys/compat/linux/arch
History log of /src/sys/compat/linux/arch
RevisionDateAuthorComments
 1.3 24-Nov-2021  ryo add missing SUBDIR aarch64
 1.2 09-Nov-2019  jdolecek don't descend to sparc and sparc64, they don't have syscalls.master
so it just errors out
 1.1 16-Jan-2017  christos branches: 1.1.2; 1.1.4; 1.1.8; 1.1.18; 1.1.22;
add Makefile struct
 1.1.22.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.1.18.2 03-Dec-2017  jdolecek update from HEAD
 1.1.18.1 16-Jan-2017  jdolecek file Makefile was added on branch tls-maxphys on 2017-12-03 11:36:53 +0000
 1.1.8.2 21-Apr-2017  bouyer Sync with HEAD
 1.1.8.1 16-Jan-2017  bouyer file Makefile was added on branch bouyer-socketcan on 2017-04-21 16:53:41 +0000
 1.1.4.2 20-Mar-2017  pgoyette Sync with HEAD
 1.1.4.1 16-Jan-2017  pgoyette file Makefile was added on branch pgoyette-localcount on 2017-03-20 06:57:24 +0000
 1.1.2.2 05-Feb-2017  skrll Sync with HEAD
 1.1.2.1 16-Jan-2017  skrll file Makefile was added on branch nick-nhusb on 2017-02-05 13:40:24 +0000
 1.2 29-May-2024  christos should not be using .include <> but .include "" here.
 1.1 23-Sep-2021  ryo add support COMPAT_LINUX for aarch64
 1.1 23-Sep-2021  ryo add support COMPAT_LINUX for aarch64
 1.3 25-Nov-2021  ryo add support COMPAT_LINUX32 for aarch64
 1.2 12-Oct-2021  andvar fix various typos, mainly in comments.
 1.1 23-Sep-2021  ryo add support COMPAT_LINUX for aarch64
 1.1 23-Sep-2021  ryo add support COMPAT_LINUX for aarch64
 1.3 26-Nov-2021  ryo The internal architecture name of golang is "arm" or "arm64", which has
different naming conventions from netbsd's machine[] or machine_arch[]
("earmv7", "aarch64", etc.) and cannot be used as is.
Instead, use define LINUX_GO_RT0_SIGNATURE_ARCH{32,64}.
 1.2 26-Nov-2021  ryo - LINUX_GO_RT0_SIGNATURE for compat_linux is no longer enabled by default.
it is now defined in each arch same as the other *_SIGNATURE definitions.
- add new LINUX32_GO_RT0_SIGNATURE for compat_linux32, and is defined in amd64 and aarch64.
 1.1 23-Sep-2021  ryo add support COMPAT_LINUX for aarch64
 1.1 23-Sep-2021  ryo add support COMPAT_LINUX for aarch64
 1.4 07-Feb-2024  msaitoh Remove ryo@'s mail addresses.
 1.3 01-Nov-2021  thorpej Use "stack_t" instead of "struct sigaltstack", as the former is the
newer standardized name. NFC.
 1.2 09-Oct-2021  ryo Modularize compat_linux(8) for aarch64.
 1.1 23-Sep-2021  ryo add support COMPAT_LINUX for aarch64
 1.3 30-Nov-2021  ryo - uname should return "aarch64" or "aarch64_be" instead of "evbarm".
- define LINUX_LARGEFILE64 to use rlimit instead of orlimit.
 1.2 25-Nov-2021  ryo add support COMPAT_LINUX32 for aarch64
 1.1 23-Sep-2021  ryo add support COMPAT_LINUX for aarch64
 1.1 23-Sep-2021  ryo add support COMPAT_LINUX for aarch64
 1.1 23-Sep-2021  ryo add support COMPAT_LINUX for aarch64
 1.1 23-Sep-2021  ryo add support COMPAT_LINUX for aarch64
 1.1 23-Sep-2021  ryo add support COMPAT_LINUX for aarch64
 1.1 23-Sep-2021  ryo add support COMPAT_LINUX for aarch64
 1.1 23-Sep-2021  ryo add support COMPAT_LINUX for aarch64
 1.13 28-Sep-2024  christos regen
 1.12 01-Jul-2024  christos regen
 1.11 29-Jun-2024  christos branches: 1.11.2;
regen
 1.10 19-Aug-2023  christos regen
 1.9 18-Aug-2023  christos regen
 1.8 29-Jul-2023  christos regen
 1.7 29-Jul-2023  rin linux/aarch64: Regen for syscalls.master,v 1.8
 1.6 28-Jul-2023  christos regen
 1.5 10-Jul-2023  christos regen
 1.4 02-Dec-2021  ryo regen
 1.3 25-Nov-2021  ryo regen
 1.2 24-Nov-2021  ryo regen
 1.1 23-Sep-2021  ryo add support COMPAT_LINUX for aarch64
 1.11.2.1 02-Aug-2025  perseant Sync with HEAD
 1.13 28-Sep-2024  christos regen
 1.12 01-Jul-2024  christos regen
 1.11 29-Jun-2024  christos branches: 1.11.2;
regen
 1.10 19-Aug-2023  christos regen
 1.9 18-Aug-2023  christos regen
 1.8 29-Jul-2023  christos regen
 1.7 29-Jul-2023  rin linux/aarch64: Regen for syscalls.master,v 1.8
 1.6 28-Jul-2023  christos regen
 1.5 10-Jul-2023  christos regen
 1.4 02-Dec-2021  ryo regen
 1.3 25-Nov-2021  ryo regen
 1.2 24-Nov-2021  ryo regen
 1.1 23-Sep-2021  ryo add support COMPAT_LINUX for aarch64
 1.11.2.1 02-Aug-2025  perseant Sync with HEAD
 1.13 28-Sep-2024  christos regen
 1.12 01-Jul-2024  christos regen
 1.11 29-Jun-2024  christos branches: 1.11.2;
regen
 1.10 19-Aug-2023  christos regen
 1.9 18-Aug-2023  christos regen
 1.8 29-Jul-2023  christos regen
 1.7 29-Jul-2023  rin linux/aarch64: Regen for syscalls.master,v 1.8
 1.6 28-Jul-2023  christos regen
 1.5 10-Jul-2023  christos regen
 1.4 02-Dec-2021  ryo regen
 1.3 25-Nov-2021  ryo regen
 1.2 24-Nov-2021  ryo regen
 1.1 23-Sep-2021  ryo add support COMPAT_LINUX for aarch64
 1.11.2.1 02-Aug-2025  perseant Sync with HEAD
 1.13 28-Sep-2024  christos regen
 1.12 01-Jul-2024  christos regen
 1.11 29-Jun-2024  christos branches: 1.11.2;
regen
 1.10 19-Aug-2023  christos regen
 1.9 18-Aug-2023  christos regen
 1.8 29-Jul-2023  christos regen
 1.7 29-Jul-2023  rin linux/aarch64: Regen for syscalls.master,v 1.8
 1.6 28-Jul-2023  christos regen
 1.5 10-Jul-2023  christos regen
 1.4 02-Dec-2021  ryo regen
 1.3 25-Nov-2021  ryo regen
 1.2 24-Nov-2021  ryo regen
 1.1 23-Sep-2021  ryo add support COMPAT_LINUX for aarch64
 1.11.2.1 02-Aug-2025  perseant Sync with HEAD
 1.13 28-Sep-2024  christos regen
 1.12 01-Jul-2024  christos regen
 1.11 29-Jun-2024  christos branches: 1.11.2;
regen
 1.10 19-Aug-2023  christos regen
 1.9 18-Aug-2023  christos regen
 1.8 29-Jul-2023  christos regen
 1.7 29-Jul-2023  rin linux/aarch64: Regen for syscalls.master,v 1.8
 1.6 28-Jul-2023  christos regen
 1.5 10-Jul-2023  christos regen
 1.4 02-Dec-2021  ryo regen
 1.3 25-Nov-2021  ryo regen
 1.2 24-Nov-2021  ryo regen
 1.1 23-Sep-2021  ryo add support COMPAT_LINUX for aarch64
 1.11.2.1 02-Aug-2025  perseant Sync with HEAD
 1.1 23-Sep-2021  ryo add support COMPAT_LINUX for aarch64
 1.1 23-Sep-2021  ryo add support COMPAT_LINUX for aarch64
 1.1 23-Sep-2021  ryo add support COMPAT_LINUX for aarch64
 1.14 28-Sep-2024  christos Linux GSoC-2024: renameat2, clone3, sync_file_range, syncfs (Shivraj Jamgade)
 1.13 01-Jul-2024  christos Add linux POSIX message queue support (Ricardo Branco)
 1.12 29-Jun-2024  christos branches: 1.12.2;
From gsoc 2024: Implement faccessat2 and getcpu (Shivraz)
 1.11 19-Aug-2023  christos Add inotify* syscalls GSoC 2023 (Theodore Preduta)
 1.10 18-Aug-2023  christos Add linux waitid(2) from GSoC 2023 (Theodore Preduta)
 1.9 29-Jul-2023  christos Add/fix statx, readahead, close_range. From GSoC 2023 by Theodore Preduta
 1.8 29-Jul-2023  rin linux/aarch64/syscalls.master: Dedup and sort headers. NFC.
 1.7 29-Jul-2023  rin linux/aarch64/syscalls.master: Include linux_misc.h.
 1.6 28-Jul-2023  christos add epoll syscalls
 1.5 10-Jul-2023  christos add memfd_create
 1.4 02-Dec-2021  ryo add prlimit64(2) syscall to COMPAT_LINUX and COMPAT_LINUX32
 1.3 25-Nov-2021  ryo add statx(2) syscall entry
 1.2 24-Nov-2021  ryo add getrandom(2) syscall entry
 1.1 23-Sep-2021  ryo add support COMPAT_LINUX for aarch64
 1.12.2.1 02-Aug-2025  perseant Sync with HEAD
 1.4 29-May-2024  christos 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 03-Oct-1998  christos branches: 1.2.184; 1.2.194; 1.2.200; 1.2.210;
Attempt to fix the mess.
 1.1 30-Sep-1998  erh Initial support for linux compat on the alpha. Not quite working.
 1.2.210.1 10-Aug-2014  tls Rebase.
 1.2.200.1 18-May-2014  rmind sync with head
 1.2.194.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.184.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.11 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.10 24-Mar-2019  maxv Remove Alpha's compat_linux dependency on compat_osf1. Each function is
copied as-is from compat_osf1 with no functional change. Discussed on
tech-kern@, ok @thorpej.
 1.9 31-May-2011  njoly branches: 1.9.56;
Add needed linux_fadvise64.c
 1.8 07-Jul-2010  chs branches: 1.8.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.7 13-Nov-2002  jdolecek branches: 1.7.108; 1.7.130; 1.7.132;
add generic linux compat ELF copyargs function

this gives:
* linux sysconf(_SC_CLK_TCK) gives correct value for linux binaries (hz)
even if hz != 100
* glibc gets proper information on real/effective uid and enables
secure mode for suid binaries

g/c LINUX_COPYARGS_FUNCTION, replaced by linux ELF copyargs function
g/c alpha-specific linux ELF copyargs function and linux ELF defines
 1.6 13-May-2002  matt Make COMPAT_LINUX compile again on Alpha. linux_getdents64 moved but
files.linux_alpha wasn't updated. common/linux_file64.c contains a lot
of syscalls which aren't on Linux/alpha so #ifdef them for alpha.
 1.5 31-Mar-2002  christos bring the reverse signal mapping array into linux_signo.c
 1.4 17-Nov-2000  erh branches: 1.4.2; 1.4.4;
Make the linux compatibilty code work on the alpha. (horay!) (at last!)
Two main changes:
Create a linux_elf64_copyargs that uses the linux specific LinuxAuxInfo
structure. This is only used on the alpha. i386 and m68k use the
standard elf copyargs function.

Since linux's approach to binary compatibilty is to look as much
like osf1 as possible, add all the osf1 syscalls that we have
implemented to the linux syscall table. This includes get/setsysinfo,
ported from FreeBSD.

In order for linux compat to work you must have COMPAT_OSF1, COMPAT_43,
COMPAT_09, COMPAT_12 and COMPAT_13 on also.
 1.3 07-Oct-1998  erh branches: 1.3.12;
Add the sigaction call.
 1.2 07-Oct-1998  erh Files moved. Change the paths here.
 1.1 30-Sep-1998  erh Initial support for linux compat on the alpha. Not quite working.
 1.3.12.1 22-Nov-2000  bouyer Sync with HEAD.
 1.4.4.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.4.2.3 11-Dec-2002  thorpej Sync with HEAD.
 1.4.2.2 20-Jun-2002  nathanw Catch up to -current.
 1.4.2.1 17-Apr-2002  nathanw Catch up to -current.
 1.7.132.2 12-Jun-2011  rmind sync with head
 1.7.132.1 05-Mar-2011  rmind sync with head
 1.7.130.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.7.108.1 11-Aug-2010  yamt sync with head.
 1.8.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.9.56.1 10-Jun-2019  christos Sync with HEAD
 1.8 17-Dec-2013  njoly 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.7 28-Apr-2008  martin branches: 1.7.34; 1.7.44; 1.7.50;
Remove clause 3 and 4 from TNF licenses
 1.6 31-Oct-2006  cbiere branches: 1.6.48; 1.6.50; 1.6.52;
Changed error message of ENOPROTOOPT to "Protocol option not available".
 1.5 11-Dec-2005  christos branches: 1.5.20; 1.5.22;
merge ktrace-lwp.
 1.4 26-Feb-2005  perry branches: 1.4.4;
nuke trailing whitespace
 1.3 12-Feb-2001  manu branches: 1.3.24; 1.3.32; 1.3.34;
Clarified comments about the LINUX_SCERR_SIGN macro
 1.2 11-Feb-2001  manu Moved the fix for negative errno returned to userland on the PowerPC to a
more machine independent fashion
 1.1 30-Sep-1998  erh branches: 1.1.12;
New header files for Linux compat on the Alpha.
 1.1.12.1 12-Mar-2001  bouyer Sync with HEAD.
 1.3.34.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.3.32.1 29-Apr-2005  kent sync with -current
 1.3.24.1 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.4.4.1 30-Dec-2006  yamt sync with head.
 1.5.22.1 10-Dec-2006  yamt sync with head.
 1.5.20.1 18-Nov-2006  ad Sync with head.
 1.6.52.1 16-May-2008  yamt sync with head.
 1.6.50.1 18-May-2008  yamt sync with head.
 1.6.48.1 02-Jun-2008  mjf Sync with HEAD.
 1.7.50.1 18-May-2014  rmind sync with head
 1.7.44.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.7.34.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.13 12-Feb-2017  chs es_arglen is now in units of bytes, update the emulations accordingly.
 1.12 09-Feb-2014  chs branches: 1.12.6; 1.12.10; 1.12.14;
account for the 16 bytes of AT_RANDOM data in the stack setup. fixes PR 48518.
use cprng_strong32() instead of random(). add AT_RANDOM support for linux32.
 1.11 28-Apr-2008  martin branches: 1.11.34; 1.11.44; 1.11.50;
Remove clause 3 and 4 from TNF licenses
 1.10 11-Dec-2005  christos branches: 1.10.70; 1.10.72; 1.10.74;
merge ktrace-lwp.
 1.9 14-Aug-2003  christos remove the args from the macro.
 1.8 08-Aug-2003  christos - GC all the setup_stack functions
- add one for linux/i386
 1.7 13-Nov-2002  jdolecek branches: 1.7.6;
add generic linux compat ELF copyargs function

this gives:
* linux sysconf(_SC_CLK_TCK) gives correct value for linux binaries (hz)
even if hz != 100
* glibc gets proper information on real/effective uid and enables
secure mode for suid binaries

g/c LINUX_COPYARGS_FUNCTION, replaced by linux ELF copyargs function
g/c alpha-specific linux ELF copyargs function and linux ELF defines
 1.6 26-Aug-2002  christos Implement passing AT_{E,R}{U,G}ID in the elf aux vector, like solaris.
- pass struct proc to copyargs.
- eliminate svr4_copyargs, since it is the same as ours now.
 1.5 30-Sep-2001  simonb branches: 1.5.10;
Define LINUX_ATEXIT_SIGNATURE to enable the atexit_signature test; needed
to run Linux/Alpha binaries.
 1.4 29-Jul-2001  christos branches: 1.4.2;
Adjust to the new copyargs() footprint.
 1.3 22-Jun-2001  simonb branches: 1.3.2;
Include <sys/exec_elf.h> as the other arch's linux_exec.h file do.
New linux_trap.c compiles now.
 1.2 17-Nov-2000  erh branches: 1.2.2;
Make the linux compatibilty code work on the alpha. (horay!) (at last!)
Two main changes:
Create a linux_elf64_copyargs that uses the linux specific LinuxAuxInfo
structure. This is only used on the alpha. i386 and m68k use the
standard elf copyargs function.

Since linux's approach to binary compatibilty is to look as much
like osf1 as possible, add all the osf1 syscalls that we have
implemented to the linux syscall table. This includes get/setsysinfo,
ported from FreeBSD.

In order for linux compat to work you must have COMPAT_OSF1, COMPAT_43,
COMPAT_09, COMPAT_12 and COMPAT_13 on also.
 1.1 30-Sep-1998  erh branches: 1.1.12;
New header files for Linux compat on the Alpha.
 1.1.12.1 22-Nov-2000  bouyer Sync with HEAD.
 1.2.2.4 11-Dec-2002  thorpej Sync with HEAD.
 1.2.2.3 27-Aug-2002  nathanw Catch up to -current.
 1.2.2.2 08-Oct-2001  nathanw Catch up to -current.
 1.2.2.1 24-Aug-2001  nathanw Catch up with -current.
 1.3.2.3 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.3.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.3.2.1 03-Aug-2001  lukem update to -current
 1.4.2.1 01-Oct-2001  fvdl Catch up with -current.
 1.5.10.1 29-Aug-2002  gehenna catch up with -current.
 1.7.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.7.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.7.6.1 03-Aug-2004  skrll Sync with HEAD
 1.10.74.1 16-May-2008  yamt sync with head.
 1.10.72.1 18-May-2008  yamt sync with head.
 1.10.70.1 02-Jun-2008  mjf Sync with HEAD.
 1.11.50.1 18-May-2014  rmind sync with head
 1.11.44.2 03-Dec-2017  jdolecek update from HEAD
 1.11.44.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.11.34.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.12.14.1 21-Apr-2017  bouyer Sync with HEAD
 1.12.10.1 20-Mar-2017  pgoyette Sync with HEAD
 1.12.6.1 28-Aug-2017  skrll Sync with HEAD
 1.6 13-Nov-2002  jdolecek branches: 1.6.2;
add generic linux compat ELF copyargs function

this gives:
* linux sysconf(_SC_CLK_TCK) gives correct value for linux binaries (hz)
even if hz != 100
* glibc gets proper information on real/effective uid and enables
secure mode for suid binaries

g/c LINUX_COPYARGS_FUNCTION, replaced by linux ELF copyargs function
g/c alpha-specific linux ELF copyargs function and linux ELF defines
 1.5 26-Aug-2002  christos Implement passing AT_{E,R}{U,G}ID in the elf aux vector, like solaris.
- pass struct proc to copyargs.
- eliminate svr4_copyargs, since it is the same as ours now.
 1.4 13-Nov-2001  lukem branches: 1.4.8;
add RCSIDs (including regeneration of files as appropriate)
 1.3 29-Jul-2001  christos Adjust to the new copyargs() footprint.
 1.2 18-Jan-2001  tv branches: 1.2.2; 1.2.4;
No-op commit to force update to a non-"-kk" revision.
 1.1 17-Nov-2000  erh branches: 1.1.2;
Make the linux compatibilty code work on the alpha. (horay!) (at last!)
Two main changes:
Create a linux_elf64_copyargs that uses the linux specific LinuxAuxInfo
structure. This is only used on the alpha. i386 and m68k use the
standard elf copyargs function.

Since linux's approach to binary compatibilty is to look as much
like osf1 as possible, add all the osf1 syscalls that we have
implemented to the linux syscall table. This includes get/setsysinfo,
ported from FreeBSD.

In order for linux compat to work you must have COMPAT_OSF1, COMPAT_43,
COMPAT_09, COMPAT_12 and COMPAT_13 on also.
 1.1.2.3 11-Feb-2001  bouyer Sync with HEAD.
 1.1.2.2 22-Nov-2000  bouyer Sync with HEAD.
 1.1.2.1 17-Nov-2000  bouyer file linux_exec_alpha.c was added on branch thorpej_scsipi on 2000-11-22 16:02:35 +0000
 1.2.4.3 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.2.4.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2.4.1 03-Aug-2001  lukem update to -current
 1.2.2.4 11-Dec-2002  thorpej Sync with HEAD.
 1.2.2.3 27-Aug-2002  nathanw Catch up to -current.
 1.2.2.2 14-Nov-2001  nathanw Catch up to -current.
 1.2.2.1 24-Aug-2001  nathanw Catch up with -current.
 1.4.8.1 29-Aug-2002  gehenna catch up with -current.
 1.6.2.1 18-Dec-2002  gmcgarry Merge pcred and ucred, and poolify. TBD: check backward compatibility
and factor-out some higher-level functionality.
 1.5 25-Jun-2014  njoly 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 28-Apr-2008  martin branches: 1.2.20; 1.2.22;
Remove clause 3 and 4 from TNF licenses
 1.1 30-Sep-1998  erh branches: 1.1.144; 1.1.146; 1.1.148;
New header files for Linux compat on the Alpha.
 1.1.148.2 09-Oct-2010  yamt sync with head
 1.1.148.1 16-May-2008  yamt sync with head.
 1.1.146.1 18-May-2008  yamt sync with head.
 1.1.144.1 02-Jun-2008  mjf Sync with HEAD.
 1.2.22.1 05-Mar-2011  rmind sync with head
 1.2.20.2 06-Nov-2010  uebayasi Sync with HEAD.
 1.2.20.1 22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 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.3 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.2 10-Dec-2000  fvdl branches: 1.2.122; 1.2.124; 1.2.126;
The gist of the Linux _IOX definitions was the same for all platforms;
move it to the MI linux_ioctl.h and only leave the MD bits in the MD
header files.
 1.1 30-Sep-1998  erh branches: 1.1.12; 1.1.22;
New header files for Linux compat on the Alpha.
 1.1.22.1 30-Mar-2001  he Pull up revision 1.2 (requested by fvdl):
Add some required Linux emulation bits to support the Linux
version of VMware.
 1.1.12.1 13-Dec-2000  bouyer Sync with HEAD (for UBC fixes).
 1.2.126.1 16-May-2008  yamt sync with head.
 1.2.124.1 18-May-2008  yamt sync with head.
 1.2.122.1 02-Jun-2008  mjf Sync with HEAD.
 1.52 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.51 03-Sep-2020  thorpej The conversion of FPU tracking to PCU rendered the fpcurlwp variable
unmaintained, which broke FP status info in the COMPAT_LINUX sigcontext.
Use the new API, which will at least be closer to correct.
 1.50 09-Nov-2014  maxv branches: 1.50.12; 1.50.24;
Do not uselessly include <sys/malloc.h>.
 1.49 18-Nov-2011  christos branches: 1.49.10; 1.49.26;
- add sigtimedwait support.
- merge the siginfo population code.
 1.48 09-Jun-2011  matt branches: 1.48.2;
Adapt to change to PCU.
 1.47 04-Mar-2011  joerg branches: 1.47.2;
Refactor ps_strings access. Based on PK_32, write either the normal
version or the 32bit compat layout in execve1. Introduce a new function
copyin_psstrings for reading it back from userland and converting it to
the native layout. Refactor procfs to share most of the code with the
kern.proc_args sysctl handler.

This material is based upon work partially supported by
The NetBSD Foundation under a contract with Joerg Sonnenberger.
 1.46 07-Jul-2010  chs branches: 1.46.2; 1.46.4;
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.45 23-Nov-2009  rmind branches: 1.45.2; 1.45.4;
Use lwp_getpcb() in compat code, clean from struct user.
 1.44 18-Mar-2009  cegger bcopy -> memcpy
 1.43 28-Apr-2008  martin branches: 1.43.2; 1.43.8; 1.43.14;
Remove clause 3 and 4 from TNF licenses
 1.42 24-Apr-2008  ad branches: 1.42.2;
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.41 20-Dec-2007  dsl branches: 1.41.6; 1.41.8;
Convert all the system call entry points from:
int foo(struct lwp *l, void *v, register_t *retval)
to:
int foo(struct lwp *l, const struct foo_args *uap, register_t *retval)
Fixup compat code to not write into 'uap' and (in some cases) to actually
pass a correctly formatted 'uap' structure with the right name to the
next routine.
A few 'compat' routines that just call standard ones have been deleted.
All the 'compat' code compiles (along with the kernels required to test
build it).
98% done by automated scripts.
 1.40 08-Dec-2007  dsl branches: 1.40.4;
ANSIfy most of the function definitions in sys/compat (but not ndis).
All by the magic of sed ...
 1.39 08-Jul-2007  pooka branches: 1.39.6; 1.39.8; 1.39.16;
fix pasto: sigframe.sf_sc is of type linux_sigcontext
 1.38 04-Mar-2007  yamt branches: 1.38.2; 1.38.4;
fix fallout from caddr_t changes.
 1.37 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.36 09-Feb-2007  ad branches: 1.36.2;
Merge newlock2 to head.
 1.35 23-Jul-2006  ad branches: 1.35.4;
Use the LWP cached credentials where sane.
 1.34 15-May-2006  yamt include kauth.h for kauth_cred_geteuid.
 1.33 14-May-2006  elad integrate kauth.
 1.32 11-Dec-2005  christos branches: 1.32.4; 1.32.6; 1.32.8; 1.32.10; 1.32.12;
merge ktrace-lwp.
 1.31 20-May-2005  fvdl branches: 1.31.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.30 10-Oct-2003  matt Adapt to SIGINFO changes.
 1.29 26-Sep-2003  simonb Fix "constify sendsig/trapsignal" fallout for non-siginfo'd archs. Test
compiled on most architectures.
 1.28 29-Jun-2003  fvdl branches: 1.28.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.27 29-Jun-2003  simonb Fix 'struct lwp *' lossage.
 1.26 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.25 25-Sep-2002  thorpej Don't include <sys/map.h>.
 1.24 04-Jul-2002  thorpej Add kernel support for having userland provide the signal trampoline:

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

Changes to libc to use the new facility will be checked in later. Kernel
version not bumped; we will ride the 1.6C bump made recently.
 1.23 31-Mar-2002  christos branches: 1.23.2;
make signal array handling uniform, and put signal arrays in a separate
file. This is simular to errno array handling.
 1.22 23-Mar-2002  chs make this compile again (PS_STRINGS is gone).
 1.21 18-Feb-2002  christos Resolve alpha compile issues:
- bug with order in args in mask conversion md code.
- flags can be both int and long on the alpha. kludge around that, by not
passing pointers to the conversion function.
- something is wrong with the toolchain look at the void * cast in copyout().
- sa_restorer is in a different place on the aplha. Deal with that, by not
initializing it as before. XXX: this should be changed in the MD signal
definition.
 1.20 15-Feb-2002  christos - add a real linux_sys___sysctl because the mib numbers are different.
implement only the kernel version getting entries.
- make the signal conversion functions consistent; dest is arg 1.
- make linux_fakedev deal with block and char devices differently.
- add linux_sys_ugetrlimit, and flesh out the regular get/setrlimit so
that they work properly.
- add linux_mmap2 [untested].
- bump kernel to 2.4.18, and make the date be valentine's day :-)
- linux_sys_*stat64 family was totally busted. Fix it.

tested only on i386.

Status:
gdb, telnet, work
jdk-1.4.0 extractor works, jdk still coredumps.

christos
 1.19 13-Nov-2001  lukem add RCSIDs (including regeneration of files as appropriate)
 1.18 30-Sep-2001  simonb DEBUG kernels fill the registers with garbage on process startup and
Linux program don't like that. Explicitly zero out the registers for
DEBUG kernels.
 1.17 30-May-2001  mrg branches: 1.17.2; 1.17.4;
use _KERNEL_OPT.
 1.16 26-Apr-2001  ross o IEEE 754 floating-point completion code.
o Implement the architected FP_C "Floating Point Control Quadword"
 1.15 26-Jan-2001  manu branches: 1.15.2;
Moved include <sys/ioctl.h> so that we can build without WSCONS enabled.
 1.14 27-Dec-2000  sommerfeld Let COMPAT_LINUX build with DEBUG
 1.13 22-Dec-2000  jdolecek split off thread specific stuff from struct sigacts to struct sigctx, leaving
only signal handler array sharable between threads
move other random signal stuff from struct proc to struct sigctx

This addresses kern/10981 by Matthew Orgass.
 1.12 29-Nov-2000  jdolecek LKMify
 1.11 27-Nov-2000  jdolecek don't use linux_emuldata for now, so that this compiles after
rev 1.2 of compat/linux/common/linux_emuldata.h
 1.10 29-Jun-2000  mrg remove include of <vm/vm.h>
 1.9 30-Mar-2000  augustss Kill register declarations.
 1.8 18-Mar-2000  erh Add sigset_t parameter to restore_sigcontext, created by the sigreturn functions. linux_sigreturn still needs to use frame->extramask.
In setup_linux_rt_sigframe copy the signal mask to both possible locations.
 1.7 12-Sep-1999  chs branches: 1.7.2;
eliminate the PMAP_NEW option by making it required for all ports.
ports which previously had no support for PMAP_NEW now implement
the pmap_k* interfaces as wrappers around the non-k versions.
 1.6 24-Mar-1999  mrg completely remove Mach VM support. all that is left is the all the
header files as UVM still uses (most of) these.
 1.5 03-Jan-1999  erh Make consistent: si_ -> lsi_
 1.4 03-Jan-1999  erh Avoid name clash with standard si_{uid,pid} fields.
 1.3 08-Dec-1998  erh At least make this compile. Add linux compat version of auxillary data eventually to be used to make the emulation work correctly.
 1.2 03-Oct-1998  christos Attempt to fix the mess.
 1.1 01-Oct-1998  erh Alpha version of the linux compat machdep signal and machdep ioctl stuff.
 1.7.2.4 11-Feb-2001  bouyer Sync with HEAD.
 1.7.2.3 05-Jan-2001  bouyer Sync with HEAD
 1.7.2.2 08-Dec-2000  bouyer Sync with HEAD.
 1.7.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.15.2.12 18-Oct-2002  nathanw Catch up to -current.
 1.15.2.11 01-Aug-2002  nathanw Catch up to -current.
 1.15.2.10 24-Jun-2002  nathanw Curproc->curlwp renaming.

Change uses of "curproc->l_proc" back to "curproc", which is more like the
original use. Bare uses of "curproc" are now "curlwp".

"curproc" is now #defined in proc.h as ((curlwp) ? (curlwp)->l_proc) : NULL)
so that it is always safe to reference curproc (*de*referencing curproc
is another story, but that's always been true).
 1.15.2.9 29-May-2002  nathanw #include <sys/sa.h> before <sys/syscallargs.h>, to provide sa_upcall_t
now that <sys/param.h> doesn't include <sys/sa.h>.

(Behold the Power of Ed)
 1.15.2.8 17-Apr-2002  nathanw Catch up to -current.
 1.15.2.7 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.15.2.6 28-Feb-2002  nathanw Catch up to -current.
 1.15.2.5 14-Nov-2001  nathanw Catch up to -current.
 1.15.2.4 08-Oct-2001  nathanw Catch up to -current.
 1.15.2.3 13-Sep-2001  nathanw A couple more p => l->l_proc inside #ifdef DEBUG.
 1.15.2.2 30-Aug-2001  nathanw First cut at LWP and SA support on the alpha.
Doesn't break in ordinary multiuser mode; LWPs and SAs not yet tested.
 1.15.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.17.4.1 01-Oct-2001  fvdl Catch up with -current.
 1.17.2.5 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.17.2.4 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.17.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.17.2.2 16-Mar-2002  jdolecek Catch up with -current.
 1.17.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.23.2.1 15-Jul-2002  gehenna catch up with -current.
 1.28.2.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.28.2.4 21-Nov-2004  skrll Adapt to branch. Alpha kernels now compile.
 1.28.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.28.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.28.2.1 03-Aug-2004  skrll Sync with HEAD
 1.31.2.5 21-Jan-2008  yamt sync with head
 1.31.2.4 03-Sep-2007  yamt sync with head.
 1.31.2.3 26-Feb-2007  yamt sync with head.
 1.31.2.2 30-Dec-2006  yamt sync with head.
 1.31.2.1 21-Jun-2006  yamt sync with head.
 1.32.12.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.32.10.1 08-Mar-2006  elad Adapt to kernel authorization KPI.
 1.32.8.2 11-Aug-2006  yamt sync with head
 1.32.8.1 24-May-2006  yamt sync with head.
 1.32.6.1 01-Jun-2006  kardel Sync with head.
 1.32.4.1 09-Sep-2006  rpaulo sync with head
 1.35.4.3 06-Feb-2007  ad More compat changes.

XXX compat_irix, compat_mach and compat_darwin need work.
 1.35.4.2 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.35.4.1 11-Jan-2007  ad Checkpoint work in progress.
 1.36.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.38.4.1 11-Jul-2007  mjf Sync with head.
 1.38.2.1 15-Jul-2007  ad Sync with head.
 1.39.16.1 26-Dec-2007  ad Sync with head.
 1.39.8.1 09-Jan-2008  matt sync with HEAD
 1.39.6.1 09-Dec-2007  jmcneill Sync with HEAD.
 1.40.4.1 02-Jan-2008  bouyer Sync with HEAD
 1.41.8.1 18-May-2008  yamt sync with head.
 1.41.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.42.2.4 11-Aug-2010  yamt sync with head.
 1.42.2.3 11-Mar-2010  yamt sync with head
 1.42.2.2 04-May-2009  yamt sync with head.
 1.42.2.1 16-May-2008  yamt sync with head.
 1.43.14.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.43.8.1 28-Apr-2009  skrll Sync with HEAD.
 1.43.2.3 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.43.2.2 14-May-2008  wrstuden Per discussion with ad, remove most of the #include <sys/sa.h> lines
as they were including sa.h just for the type(s) needed for syscallargs.h.

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

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

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

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

Also, kern_sa.c has received partial cleanup. There's still more
to do, though.
 1.45.4.2 12-Jun-2011  rmind sync with head
 1.45.4.1 05-Mar-2011  rmind sync with head
 1.45.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.46.4.1 05-Mar-2011  bouyer Sync with HEAD
 1.46.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.47.2.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.48.2.1 17-Apr-2012  yamt sync with head
 1.49.26.1 17-Jan-2015  martin Pull up following revision(s) (requested by maxv in ticket #427):
sys/compat/svr4/svr4_schedctl.c: revision 1.8
sys/netinet/tcp_timer.c: revision 1.88
sys/miscfs/genfs/layer_vfsops.c: revision 1.45
sys/compat/svr4/svr4_ioctl.c: revision 1.37
sys/ufs/chfs/chfs_vfsops.c: revision 1.14
sys/miscfs/fdesc/fdesc_vfsops.c: revision 1.91
sys/compat/linux/arch/i386/linux_ptrace.c: revision 1.30
sys/compat/common/kern_time_50.c: revision 1.28
sys/netinet6/ip6_forward.c: revision 1.74
sys/miscfs/umapfs/umap_vnops.c: revision 1.57
sys/compat/svr4/svr4_fcntl.c: revision 1.74
distrib/sets/lists/comp/mi: revision 1.1931
sys/netinet6/udp6_output.c: revision 1.46
sys/fs/puffs/puffs_compat.c: revision 1.3
sys/fs/udf/udf_rename.c: revision 1.11
sys/compat/svr4/svr4_filio.c: revision 1.24
sys/fs/udf/udf_rename.c: revision 1.12
sys/netinet/tcp_usrreq.c: revision 1.202
sys/miscfs/umapfs/umap_subr.c: revision 1.29
sys/compat/linux/common/linux_fadvise64.c: revision 1.3
sys/netinet/if_atm.c: revision 1.34
sys/miscfs/procfs/procfs_subr.c: revision 1.106
sys/miscfs/genfs/layer_subr.c: revision 1.37
sys/netinet/tcp_sack.c: revision 1.30
sys/compat/freebsd/freebsd_misc.c: revision 1.33
sys/compat/freebsd/freebsd_file.c: revision 1.33
sys/ufs/chfs/chfs_vnode.c: revision 1.12
sys/compat/svr4/svr4_ttold.c: revision 1.34
sys/compat/linux/common/linux_file.c: revision 1.114
sys/compat/linux/arch/mips/linux_machdep.c: revision 1.43
sys/compat/linux/common/linux_signal.c: revision 1.76
sys/compat/common/compat_util.c: revision 1.46
sys/compat/linux/arch/arm/linux_ptrace.c: revision 1.18
sys/compat/svr4/svr4_sockio.c: revision 1.36
sys/compat/linux/arch/arm/linux_machdep.c: revision 1.32
sys/compat/svr4/svr4_signal.c: revision 1.66
sys/kern/kern_exec.c: revision 1.410
sys/fs/puffs/puffs_vfsops.c: revision 1.115
sys/compat/svr4/svr4_exec_elf64.c: revision 1.15
sys/compat/linux/arch/i386/linux_machdep.c: revision 1.159
sys/compat/linux/arch/alpha/linux_machdep.c: revision 1.50
sys/compat/linux32/common/linux32_misc.c: revision 1.24
sys/netinet/in_pcb.c: revision 1.153
sys/sys/malloc.h: revision 1.116
sys/compat/common/if_43.c: revision 1.9
share/man/man9/Makefile: revision 1.380
sys/netinet/tcp_vtw.c: revision 1.12
sys/miscfs/umapfs/umap_vfsops.c: revision 1.95
sys/ufs/ext2fs/ext2fs_vfsops.c: revision 1.186
sys/compat/common/uipc_syscalls_43.c: revision 1.46
sys/ufs/ext2fs/ext2fs_vnops.c: revision 1.115
sys/fs/puffs/puffs_msgif.c: revision 1.97
sys/compat/svr4/svr4_ipc.c: revision 1.27
sys/compat/linux/common/linux_exec.c: revision 1.117
sys/ufs/ext2fs/ext2fs_readwrite.c: revision 1.66
sys/netinet/tcp_output.c: revision 1.179
sys/compat/svr4/svr4_termios.c: revision 1.28
sys/fs/udf/udf_strat_bootstrap.c: revision 1.4
sys/fs/puffs/puffs_subr.c: revision 1.67
sys/fs/puffs/puffs_node.c: revision 1.36
sys/miscfs/overlay/overlay_vnops.c: revision 1.21
sys/fs/cd9660/cd9660_node.c: revision 1.34
sys/netinet/raw_ip.c: revision 1.146
sys/sys/mallocvar.h: revision 1.13
sys/miscfs/overlay/overlay_vfsops.c: revision 1.63
share/man/man9/malloc.9: revision 1.50
sys/netinet6/dest6.c: revision 1.18
sys/compat/linux/common/linux_uselib.c: revision 1.33
sys/compat/linux/common/linux_socket.c: revision 1.120
share/man/man9/malloc.9: revision 1.51
sys/netinet/tcp_subr.c: revision 1.257
sys/compat/linux/common/linux_socketcall.c: revision 1.45
sys/compat/linux/common/linux_fadvise64_64.c: revision 1.3
sys/compat/freebsd/freebsd_ipc.c: revision 1.17
sys/compat/linux/common/linux_misc_notalpha.c: revision 1.109
sys/compat/linux/arch/alpha/linux_pipe.c: revision 1.17
sys/netinet6/in6_pcb.c: revision 1.132
sys/netinet6/in6_ifattach.c: revision 1.94
sys/compat/svr4/svr4_exec_elf32.c: revision 1.15
sys/miscfs/nullfs/null_vfsops.c: revision 1.90
sys/fs/cd9660/cd9660_util.c: revision 1.12
sys/compat/linux/arch/powerpc/linux_machdep.c: revision 1.48
sys/compat/freebsd/freebsd_exec_elf32.c: revision 1.20
sys/miscfs/procfs/procfs_vfsops.c: revision 1.94
sys/compat/linux/arch/powerpc/linux_ptrace.c: revision 1.28
sys/compat/linux/common/linux_sched.c: revision 1.67
sys/compat/linux/common/linux_exec_aout.c: revision 1.67
sys/compat/linux/common/linux_pipe.c: revision 1.67
sys/compat/linux/common/linux_llseek.c: revision 1.34
sys/compat/linux/arch/mips/linux_ptrace.c: revision 1.10
Do not uselessly include <sys/malloc.h>.
Cleanup:
- remove struct kmembuckets (dead)
- correctly deadify MALLOC_XX
- remove MALLOC_DEFINE_LIMIT and MALLOC_JUSTDEFINE_LIMIT (dead)
- remove malloc_roundup(), malloc_type_setlimit(), MALLOC_DEFINE_LIMIT()
and MALLOC_JUSTDEFINE_LIMIT() from man 9 malloc
New sentence, new line. Bump date for previous.
Obsolete malloc_roundup(9), malloc_type_setlimit(9) and MALLOC_DEFINE_LIMIT(9)
man pages.
 1.49.10.1 03-Dec-2017  jdolecek update from HEAD
 1.50.24.1 03-Aug-2022  martin Pull up following revision(s), all via patch
(requested by riastradh in ticket #1487):

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

sys/compat: Memset zero before copyout.

Just in case of uninitialized padding which would lead to kernel
stack disclosure. If the compiler can prove the memset redundant
then it can optimize it away; otherwise better safe than sorry.
 1.50.12.1 21-Jun-2023  martin Pull up following revision(s) (requested by riastradh in ticket #1836):

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

sys/compat: Memset zero before copyout.

Just in case of uninitialized padding which would lead to kernel
stack disclosure. If the compiler can prove the memset redundant
then it can optimize it away; otherwise better safe than sorry.
 1.12 21-Nov-2011  njoly Adjust setup_linux_rt_sigframe/setup_linux_sigframe prototypes.
 1.11 28-Apr-2008  martin branches: 1.11.34;
Remove clause 3 and 4 from TNF licenses
 1.10 11-Nov-2005  chs branches: 1.10.72; 1.10.74; 1.10.76;
include additional headers that are now needed.
 1.9 10-Oct-2003  matt branches: 1.9.16;
Adapt to SIGINFO changes.
 1.8 26-Sep-2003  simonb Fix "constify sendsig/trapsignal" fallout for non-siginfo'd archs. Test
compiled on most architectures.
 1.7 18-Jan-2003  thorpej branches: 1.7.2;
Merge the nathanw_sa branch.
 1.6 15-Feb-2002  christos - add a real linux_sys___sysctl because the mib numbers are different.
implement only the kernel version getting entries.
- make the signal conversion functions consistent; dest is arg 1.
- make linux_fakedev deal with block and char devices differently.
- add linux_sys_ugetrlimit, and flesh out the regular get/setrlimit so
that they work properly.
- add linux_mmap2 [untested].
- bump kernel to 2.4.18, and make the date be valentine's day :-)
- linux_sys_*stat64 family was totally busted. Fix it.

tested only on i386.

Status:
gdb, telnet, work
jdk-1.4.0 extractor works, jdk still coredumps.

christos
 1.5 14-Dec-2000  mycroft branches: 1.5.2; 1.5.4;
Declare linux_syscall_intern().
 1.4 11-Dec-2000  mycroft Nuke LINUX_MACHDEP_PASS_PPID.
 1.3 01-Dec-2000  jdolecek if LINUX_MACHDEP_PASS_PPID_AND_EUID is defined for given arch, add
flags EMUL_GETPID_PASS_PPID|EMUL_GETID_PASS_EID to emul_linux
define this option for alpha
 1.2 18-Mar-2000  erh Pass a signal mask to restore_sigcontext.
 1.1 30-Sep-1998  erh branches: 1.1.12;
New header files for Linux compat on the Alpha.
 1.1.12.4 05-Jan-2001  bouyer Sync with HEAD
 1.1.12.3 13-Dec-2000  bouyer Sync with HEAD (for UBC fixes).
 1.1.12.2 08-Dec-2000  bouyer Sync with HEAD.
 1.1.12.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.5.4.1 16-Mar-2002  jdolecek Catch up with -current.
 1.5.2.2 28-Feb-2002  nathanw Catch up to -current.
 1.5.2.1 30-Aug-2001  nathanw First cut at LWP and SA support on the alpha.
Doesn't break in ordinary multiuser mode; LWPs and SAs not yet tested.
 1.7.2.4 11-Dec-2005  christos Sync with head.
 1.7.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.7.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.7.2.1 03-Aug-2004  skrll Sync with HEAD
 1.9.16.1 21-Jun-2006  yamt sync with head.
 1.10.76.1 16-May-2008  yamt sync with head.
 1.10.74.1 18-May-2008  yamt sync with head.
 1.10.72.1 02-Jun-2008  mjf Sync with HEAD.
 1.11.34.1 17-Apr-2012  yamt sync with head
 1.5 14-Mar-2015  njoly Support Linux MAP_LOCKED mmap flag.
 1.4 28-Apr-2008  martin branches: 1.4.44; 1.4.64;
Remove clause 3 and 4 from TNF licenses
 1.3 11-Dec-2005  christos branches: 1.3.70; 1.3.72; 1.3.74;
merge ktrace-lwp.
 1.2 28-Aug-2004  jdolecek g/c LINUX_MAP_IGNMASK define - it's not used anywhere
 1.1 30-Sep-1998  erh branches: 1.1.46;
New header files for Linux compat on the Alpha.
 1.1.46.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.46.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.46.1 03-Sep-2004  skrll Sync with HEAD
 1.3.74.1 16-May-2008  yamt sync with head.
 1.3.72.1 18-May-2008  yamt sync with head.
 1.3.70.1 02-Jun-2008  mjf Sync with HEAD.
 1.4.64.1 06-Apr-2015  skrll Sync with HEAD
 1.4.44.1 03-Dec-2017  jdolecek update from HEAD
 1.6 01-Oct-2024  riastradh sys/compat/linux/arch: Nix trailing whitespace.

No functional change intended.
 1.5 07-Sep-2021  riastradh branches: 1.5.10;
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.4 06-Oct-2020  christos make MAXTSIZ optional
 1.3 06-Apr-2019  thorpej branches: 1.3.4; 1.3.6;
Overhaul the API used to fetch and store individual memory cells in
userspace. The old fetch(9) and store(9) APIs (fubyte(), fuword(),
subyte(), suword(), etc.) are retired and replaced with new ufetch(9)
and ustore(9) APIs that can return proper error codes, etc. and are
implemented consistently across all platforms. The interrupt-safe
variants are no longer supported (and several of the existing attempts
at fuswintr(), etc. were buggy and not actually interrupt-safe).

Also augmement the ucas(9) API, making it consistently available on
all plaforms, supporting uniprocessor and multiprocessor systems, even
those that do not have CAS or LL/SC primitives.

Welcome to NetBSD 8.99.37.
 1.2 26-Mar-2019  christos make this compile again.
 1.1 24-Mar-2019  maxv Remove Alpha's compat_linux dependency on compat_osf1. Each function is
copied as-is from compat_osf1 with no functional change. Discussed on
tech-kern@, ok @thorpej.
 1.3.6.1 03-Aug-2022  martin Pull up following revision(s), all via patch
(requested by riastradh in ticket #1487):

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

sys/compat: Memset zero before copyout.

Just in case of uninitialized padding which would lead to kernel
stack disclosure. If the compiler can prove the memset redundant
then it can optimize it away; otherwise better safe than sorry.
 1.3.4.2 10-Jun-2019  christos Sync with HEAD
 1.3.4.1 06-Apr-2019  christos file linux_osf1.c was added on branch phil-wifi on 2019-06-10 22:06:59 +0000
 1.5.10.1 02-Aug-2025  perseant Sync with HEAD
 1.1 24-Mar-2019  maxv branches: 1.1.4;
Remove Alpha's compat_linux dependency on compat_osf1. Each function is
copied as-is from compat_osf1 with no functional change. Discussed on
tech-kern@, ok @thorpej.
 1.1.4.2 10-Jun-2019  christos Sync with HEAD
 1.1.4.1 24-Mar-2019  christos file linux_osf1.h was added on branch phil-wifi on 2019-06-10 22:06:59 +0000
 1.18 26-Dec-2017  kamil Refactor pipe1() and correct a bug in sys_pipe2() (SYS_pipe2)

sys_pipe2() returns two integers (values), the 2nd one is a copy of the 2nd
file descriptor that lands in fildes[2]. This is a side effect of reusing
the code for sys_pipe() (SYS_pipe) and not cleaning it up.

The first returned value is (on success) 0.

Introduced a small refactoring in pipe1() that it does not operate over
retval[], but on an array int[2]. A user sets retval[] for pipe() when
desired and needed.

This refactoring touches compat code: netbsd32, linux, linux32.

Before the changes on NetBSD/amd64:

$ ktruss -i ./a.out
[...]
15131 1 a.out pipe2(0x7f7fff2e62b8, 0) = 0, 4
[...]

After the changes:

$ ktruss -i ./a.out
[...]
782 1 a.out pipe2(0x7f7fff97e850, 0) = 0
[...]

There should not be a visible change for current users.

Sponsored by <The NetBSD Foundation>
 1.17 09-Nov-2014  maxv Do not uselessly include <sys/malloc.h>.
 1.16 01-Jun-2014  njoly branches: 1.16.2;
Cleanup pipe(2) flags, now that native handle them.
 1.15 14-Apr-2011  he branches: 1.15.14; 1.15.28;
Fix this so that it builds (missing "struct" keyword).
 1.14 14-Apr-2011  christos add the "special" pipe2.
 1.13 28-Apr-2008  martin branches: 1.13.2; 1.13.22; 1.13.28;
Remove clause 3 and 4 from TNF licenses
 1.12 20-Dec-2007  dsl branches: 1.12.6; 1.12.8; 1.12.10;
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.11 08-Dec-2007  dsl branches: 1.11.4;
ANSIfy most of the function definitions in sys/compat (but not ndis).
All by the magic of sed ...
 1.10 09-Feb-2007  ad branches: 1.10.18; 1.10.20; 1.10.28;
Merge newlock2 to head.
 1.9 11-Dec-2005  christos branches: 1.9.20;
merge ktrace-lwp.
 1.8 26-Feb-2005  perry branches: 1.8.4;
nuke trailing whitespace
 1.7 18-Jan-2003  thorpej branches: 1.7.2; 1.7.10; 1.7.12;
Merge the nathanw_sa branch.
 1.6 13-Nov-2001  lukem add RCSIDs (including regeneration of files as appropriate)
 1.5 16-Oct-2000  erh branches: 1.5.2; 1.5.4;
Add sys/proc.h so this compiles.
 1.4 29-Jun-2000  mrg remove include of <vm/vm.h>
 1.3 26-Jun-2000  mrg remove redundant vm includes.
 1.2 03-Oct-1998  christos branches: 1.2.12;
Attempt to fix the mess.
 1.1 01-Oct-1998  erh Alpha specific version of sys_pipe and signal translation array.
 1.2.12.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.5.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.5.2.4 12-Jul-2002  nathanw No longer need to pull in lwp.h; proc.h pulls it in for us.
 1.5.2.3 29-May-2002  nathanw #include <sys/sa.h> before <sys/syscallargs.h>, to provide sa_upcall_t
now that <sys/param.h> doesn't include <sys/sa.h>.

(Behold the Power of Ed)
 1.5.2.2 14-Nov-2001  nathanw Catch up to -current.
 1.5.2.1 30-Aug-2001  nathanw First cut at LWP and SA support on the alpha.
Doesn't break in ordinary multiuser mode; LWPs and SAs not yet tested.
 1.7.12.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.7.10.1 29-Apr-2005  kent sync with -current
 1.7.2.1 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.8.4.2 21-Jan-2008  yamt sync with head
 1.8.4.1 26-Feb-2007  yamt sync with head.
 1.9.20.1 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.10.28.1 26-Dec-2007  ad Sync with head.
 1.10.20.1 09-Jan-2008  matt sync with HEAD
 1.10.18.1 09-Dec-2007  jmcneill Sync with HEAD.
 1.11.4.1 02-Jan-2008  bouyer Sync with HEAD
 1.12.10.1 16-May-2008  yamt sync with head.
 1.12.8.1 18-May-2008  yamt sync with head.
 1.12.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.13.28.1 06-Jun-2011  jruoho Sync with HEAD.
 1.13.22.1 21-Apr-2011  rmind sync with head
 1.13.2.2 14-May-2008  wrstuden Per discussion with ad, remove most of the #include <sys/sa.h> lines
as they were including sa.h just for the type(s) needed for syscallargs.h.

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

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

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

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

Also, kern_sa.c has received partial cleanup. There's still more
to do, though.
 1.15.28.1 10-Aug-2014  tls Rebase.
 1.15.14.2 03-Dec-2017  jdolecek update from HEAD
 1.15.14.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.16.2.1 17-Jan-2015  martin Pull up following revision(s) (requested by maxv in ticket #427):
sys/compat/svr4/svr4_schedctl.c: revision 1.8
sys/netinet/tcp_timer.c: revision 1.88
sys/miscfs/genfs/layer_vfsops.c: revision 1.45
sys/compat/svr4/svr4_ioctl.c: revision 1.37
sys/ufs/chfs/chfs_vfsops.c: revision 1.14
sys/miscfs/fdesc/fdesc_vfsops.c: revision 1.91
sys/compat/linux/arch/i386/linux_ptrace.c: revision 1.30
sys/compat/common/kern_time_50.c: revision 1.28
sys/netinet6/ip6_forward.c: revision 1.74
sys/miscfs/umapfs/umap_vnops.c: revision 1.57
sys/compat/svr4/svr4_fcntl.c: revision 1.74
distrib/sets/lists/comp/mi: revision 1.1931
sys/netinet6/udp6_output.c: revision 1.46
sys/fs/puffs/puffs_compat.c: revision 1.3
sys/fs/udf/udf_rename.c: revision 1.11
sys/compat/svr4/svr4_filio.c: revision 1.24
sys/fs/udf/udf_rename.c: revision 1.12
sys/netinet/tcp_usrreq.c: revision 1.202
sys/miscfs/umapfs/umap_subr.c: revision 1.29
sys/compat/linux/common/linux_fadvise64.c: revision 1.3
sys/netinet/if_atm.c: revision 1.34
sys/miscfs/procfs/procfs_subr.c: revision 1.106
sys/miscfs/genfs/layer_subr.c: revision 1.37
sys/netinet/tcp_sack.c: revision 1.30
sys/compat/freebsd/freebsd_misc.c: revision 1.33
sys/compat/freebsd/freebsd_file.c: revision 1.33
sys/ufs/chfs/chfs_vnode.c: revision 1.12
sys/compat/svr4/svr4_ttold.c: revision 1.34
sys/compat/linux/common/linux_file.c: revision 1.114
sys/compat/linux/arch/mips/linux_machdep.c: revision 1.43
sys/compat/linux/common/linux_signal.c: revision 1.76
sys/compat/common/compat_util.c: revision 1.46
sys/compat/linux/arch/arm/linux_ptrace.c: revision 1.18
sys/compat/svr4/svr4_sockio.c: revision 1.36
sys/compat/linux/arch/arm/linux_machdep.c: revision 1.32
sys/compat/svr4/svr4_signal.c: revision 1.66
sys/kern/kern_exec.c: revision 1.410
sys/fs/puffs/puffs_vfsops.c: revision 1.115
sys/compat/svr4/svr4_exec_elf64.c: revision 1.15
sys/compat/linux/arch/i386/linux_machdep.c: revision 1.159
sys/compat/linux/arch/alpha/linux_machdep.c: revision 1.50
sys/compat/linux32/common/linux32_misc.c: revision 1.24
sys/netinet/in_pcb.c: revision 1.153
sys/sys/malloc.h: revision 1.116
sys/compat/common/if_43.c: revision 1.9
share/man/man9/Makefile: revision 1.380
sys/netinet/tcp_vtw.c: revision 1.12
sys/miscfs/umapfs/umap_vfsops.c: revision 1.95
sys/ufs/ext2fs/ext2fs_vfsops.c: revision 1.186
sys/compat/common/uipc_syscalls_43.c: revision 1.46
sys/ufs/ext2fs/ext2fs_vnops.c: revision 1.115
sys/fs/puffs/puffs_msgif.c: revision 1.97
sys/compat/svr4/svr4_ipc.c: revision 1.27
sys/compat/linux/common/linux_exec.c: revision 1.117
sys/ufs/ext2fs/ext2fs_readwrite.c: revision 1.66
sys/netinet/tcp_output.c: revision 1.179
sys/compat/svr4/svr4_termios.c: revision 1.28
sys/fs/udf/udf_strat_bootstrap.c: revision 1.4
sys/fs/puffs/puffs_subr.c: revision 1.67
sys/fs/puffs/puffs_node.c: revision 1.36
sys/miscfs/overlay/overlay_vnops.c: revision 1.21
sys/fs/cd9660/cd9660_node.c: revision 1.34
sys/netinet/raw_ip.c: revision 1.146
sys/sys/mallocvar.h: revision 1.13
sys/miscfs/overlay/overlay_vfsops.c: revision 1.63
share/man/man9/malloc.9: revision 1.50
sys/netinet6/dest6.c: revision 1.18
sys/compat/linux/common/linux_uselib.c: revision 1.33
sys/compat/linux/common/linux_socket.c: revision 1.120
share/man/man9/malloc.9: revision 1.51
sys/netinet/tcp_subr.c: revision 1.257
sys/compat/linux/common/linux_socketcall.c: revision 1.45
sys/compat/linux/common/linux_fadvise64_64.c: revision 1.3
sys/compat/freebsd/freebsd_ipc.c: revision 1.17
sys/compat/linux/common/linux_misc_notalpha.c: revision 1.109
sys/compat/linux/arch/alpha/linux_pipe.c: revision 1.17
sys/netinet6/in6_pcb.c: revision 1.132
sys/netinet6/in6_ifattach.c: revision 1.94
sys/compat/svr4/svr4_exec_elf32.c: revision 1.15
sys/miscfs/nullfs/null_vfsops.c: revision 1.90
sys/fs/cd9660/cd9660_util.c: revision 1.12
sys/compat/linux/arch/powerpc/linux_machdep.c: revision 1.48
sys/compat/freebsd/freebsd_exec_elf32.c: revision 1.20
sys/miscfs/procfs/procfs_vfsops.c: revision 1.94
sys/compat/linux/arch/powerpc/linux_ptrace.c: revision 1.28
sys/compat/linux/common/linux_sched.c: revision 1.67
sys/compat/linux/common/linux_exec_aout.c: revision 1.67
sys/compat/linux/common/linux_pipe.c: revision 1.67
sys/compat/linux/common/linux_llseek.c: revision 1.34
sys/compat/linux/arch/mips/linux_ptrace.c: revision 1.10
Do not uselessly include <sys/malloc.h>.
Cleanup:
- remove struct kmembuckets (dead)
- correctly deadify MALLOC_XX
- remove MALLOC_DEFINE_LIMIT and MALLOC_JUSTDEFINE_LIMIT (dead)
- remove malloc_roundup(), malloc_type_setlimit(), MALLOC_DEFINE_LIMIT()
and MALLOC_JUSTDEFINE_LIMIT() from man 9 malloc
New sentence, new line. Bump date for previous.
Obsolete malloc_roundup(9), malloc_type_setlimit(9) and MALLOC_DEFINE_LIMIT(9)
man pages.
 1.9 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.8 31-Mar-2002  christos branches: 1.8.108; 1.8.110; 1.8.112;
bring the reverse signal mapping array into linux_signo.c
 1.7 31-Mar-2002  christos make signal array handling uniform, and put signal arrays in a separate
file. This is simular to errno array handling.
 1.6 13-Nov-2001  lukem add RCSIDs (including regeneration of files as appropriate)
 1.5 18-Jan-2001  jdolecek branches: 1.5.2; 1.5.4;
constify
 1.4 04-Dec-1999  tron Correct signal array size.
 1.3 04-Dec-1999  tron Extend signal mapping array to 64 entries like in the i386 emulation.
 1.2 03-Oct-1998  christos branches: 1.2.12; 1.2.18;
Attempt to fix the mess.
 1.1 01-Oct-1998  erh Alpha specific version of sys_pipe and signal translation array.
 1.2.18.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.2.12.2 11-Feb-2001  bouyer Sync with HEAD.
 1.2.12.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.5.4.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.5.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.5.2.2 17-Apr-2002  nathanw Catch up to -current.
 1.5.2.1 14-Nov-2001  nathanw Catch up to -current.
 1.8.112.1 16-May-2008  yamt sync with head.
 1.8.110.1 18-May-2008  yamt sync with head.
 1.8.108.1 02-Jun-2008  mjf Sync with HEAD.
 1.7 18-Nov-2011  christos - 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 23-Nov-2008  njoly branches: 1.5.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.4 28-Apr-2008  martin branches: 1.4.6; 1.4.8;
Remove clause 3 and 4 from TNF licenses
 1.3 03-Jan-1999  erh branches: 1.3.140; 1.3.142; 1.3.144;
Make consistent: si_ -> lsi_
 1.2 03-Jan-1999  erh Avoid name clash with standard si_{uid,pid} fields.
 1.1 30-Sep-1998  erh New header files for Linux compat on the Alpha.
 1.3.144.3 20-Jun-2009  yamt sync with head
 1.3.144.2 04-May-2009  yamt sync with head.
 1.3.144.1 16-May-2008  yamt sync with head.
 1.3.142.1 18-May-2008  yamt sync with head.
 1.3.140.2 17-Jan-2009  mjf Sync with HEAD.
 1.3.140.1 02-Jun-2008  mjf Sync with HEAD.
 1.4.8.1 19-Jan-2009  skrll Sync with HEAD.
 1.4.6.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.5.4.1 23-Jul-2009  jym Sync with HEAD.
 1.6.12.1 17-Apr-2012  yamt sync with head
 1.10 14-Nov-2015  christos PR/50428: Rin Okuyama: support SA_RESTORER flag for rt_sigaction(2) in the
ports that support it.
 1.9 28-Apr-2008  martin branches: 1.9.44; 1.9.64;
Remove clause 3 and 4 from TNF licenses
 1.8 04-Dec-2007  dsl branches: 1.8.12; 1.8.14; 1.8.16;
Remove all the __P
 1.7 11-Dec-2005  christos branches: 1.7.44; 1.7.46; 1.7.52; 1.7.56;
merge ktrace-lwp.
 1.6 19-Sep-2005  christos MINSIGSTKSZ on linux is different depending on the platform and usually
smaller than ours.
 1.5 19-May-2005  manu branches: 1.5.2;
Add support for Linux SA_RESTORER on amd64.
 1.4 26-Nov-2002  christos branches: 1.4.6;
rename: s/sa_/<compat>sa/g
 1.3 19-Mar-2002  christos - Now that RT-signals fit, fix the array to deliver them. [i386 only].
- jdk-1.4 works perfectly now. :-)
 1.2 10-Dec-1998  erh branches: 1.2.22; 1.2.24;
Whoops, _NSIG->LINUX__NSIG.
 1.1 30-Sep-1998  erh New header files for Linux compat on the Alpha.
 1.2.24.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.2.22.2 11-Dec-2002  thorpej Sync with HEAD.
 1.2.22.1 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.4.6.1 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.5.2.2 07-Dec-2007  yamt sync with head
 1.5.2.1 21-Jun-2006  yamt sync with head.
 1.7.56.1 08-Dec-2007  ad Sync with head.
 1.7.52.1 08-Dec-2007  mjf Sync with HEAD.
 1.7.46.1 09-Jan-2008  matt sync with HEAD
 1.7.44.1 09-Dec-2007  jmcneill Sync with HEAD.
 1.8.16.1 16-May-2008  yamt sync with head.
 1.8.14.1 18-May-2008  yamt sync with head.
 1.8.12.1 02-Jun-2008  mjf Sync with HEAD.
 1.9.64.1 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.9.44.1 03-Dec-2017  jdolecek update from HEAD
 1.6 23-May-2014  njoly Add missing specific LINUX_SOCK_NONBLOCK value for alpha.
 1.5 25-Jan-2014  njoly branches: 1.5.2;
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.4 28-Apr-2008  martin branches: 1.4.34; 1.4.44; 1.4.50;
Remove clause 3 and 4 from TNF licenses
 1.3 11-Dec-2005  christos branches: 1.3.70; 1.3.72; 1.3.74;
merge ktrace-lwp.
 1.2 26-Jul-2003  jdolecek add LINUX_SO_PEERNAME, LINUX_SO_TIMESTAMP where it has been missing
fix value for LINUX_SO_DETACH_FILTER on couple places (unused anyway)

g/c LINUX_SCM_TIMESTAMP definition for some archs, it will be defined
in generic linux_socket.h
 1.1 30-Sep-1998  erh branches: 1.1.46;
New header files for Linux compat on the Alpha.
 1.1.46.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.46.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.46.1 03-Aug-2004  skrll Sync with HEAD
 1.3.74.1 16-May-2008  yamt sync with head.
 1.3.72.1 18-May-2008  yamt sync with head.
 1.3.70.1 02-Jun-2008  mjf Sync with HEAD.
 1.4.50.1 18-May-2014  rmind sync with head
 1.4.44.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.4.34.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.5.2.1 10-Aug-2014  tls Rebase.
 1.122 28-Sep-2024  christos regen
 1.121 01-Jul-2024  christos regen
 1.120 29-Jun-2024  christos branches: 1.120.2;
regen
 1.119 19-Aug-2023  christos regen
 1.118 18-Aug-2023  christos regen
 1.117 29-Jul-2023  christos regen
 1.116 28-Jul-2023  christos regen
 1.115 02-Dec-2021  ryo regen
 1.114 20-Sep-2021  thorpej Regen for preadv(2) / pwritev(2).
 1.113 20-Sep-2021  thorpej Regen for eventfd.
 1.112 19-Sep-2021  thorpej Regen for timerfd.
 1.111 19-Sep-2021  thorpej Regen for POSIX timer syscalls.
 1.110 26-Apr-2020  thorpej branches: 1.110.2;
Regen for native futex calls.
 1.109 09-Nov-2019  jdolecek regen
 1.108 24-Mar-2019  maxv regen
 1.107 10-Aug-2018  pgoyette Regen
 1.106 10-May-2017  riastradh branches: 1.106.8; 1.106.10;
regen
 1.105 03-Feb-2017  christos branches: 1.105.4;
regen
 1.104 03-Feb-2017  martin Regen for accept4
 1.103 16-Jan-2017  christos regen all
 1.102 13-Jan-2017  christos branches: 1.102.2;
regen
 1.101 02-Jan-2017  martin Regen (something apparently went wrong in previous)
 1.100 02-Jan-2017  manu Regen
 1.99 24-Jul-2016  njoly Regen for readlink/readlinkat signatures.
 1.98 25-Oct-2015  njoly branches: 1.98.2;
Regen for posix chown family cleanup.
 1.97 24-Sep-2015  christos regen
 1.96 07-Mar-2015  christos regen
 1.95 22-Nov-2014  njoly branches: 1.95.2;
Regen for ppoll signature fix
 1.94 29-May-2014  njoly branches: 1.94.2;
Regen for utimes(2) change.
 1.93 17-May-2014  njoly Regen for fadvise64 offset types changes.
 1.92 06-May-2014  njoly Regen for mknod device argument type change.
 1.91 04-May-2014  njoly Regen for pread/pwrite 64bit offset argument.
 1.90 08-Apr-2014  njoly Regen.
 1.89 13-Jan-2014  njoly branches: 1.89.2;
Regen.
 1.88 27-Dec-2013  njoly Regen.
 1.87 08-Dec-2013  njoly Regen.
 1.86 19-Nov-2013  chs regen
 1.85 24-Sep-2013  njoly Regen for utimensat(2).
 1.84 15-Sep-2013  njoly Regen.
 1.83 19-Sep-2012  pooka branches: 1.83.2;
regen for ppoll (and, apparently, SYCALL_ARG_PTR)
 1.82 18-Nov-2011  christos branches: 1.82.10;
- add sigtimedwait support.
- merge the siginfo population code.
 1.81 30-May-2011  alnsn branches: 1.81.4;
Regenerate files to pick up correct RCS Ids. Suggested by Chris Badura.
 1.80 30-May-2011  alnsn Add fadvise64 and fadvise64_64 syscalls to compat_linux and compat_linux32.
 1.79 15-Apr-2011  he Regenerate these files after adding pipe2() and dup3().
 1.78 07-Jul-2010  chs branches: 1.78.2;
regen
 1.77 14-Dec-2009  matt branches: 1.77.2; 1.77.4;
Regen (new makesyscalls.sh)
 1.76 24-Nov-2009  njoly Regen for personality(2) update.
 1.75 17-Jun-2009  njoly Regen for sendmsg/recvmsg definitions update.
 1.74 08-Jun-2009  njoly Regen for rt_queueinfo(2) update.
 1.73 17-Jan-2009  njoly branches: 1.73.2;
Regen for wait4 update.
 1.72 15-Jan-2009  njoly Rengen for compat50 update.
 1.71 13-Jan-2009  pooka Regen to prove I didn't screw up the conversion: purely RCSID changes.
 1.70 13-Jan-2009  pooka regen
 1.69 19-Nov-2008  ad Regen.
 1.68 12-Nov-2008  njoly Regen for nanosleep(2) fix.
 1.67 04-Apr-2008  njoly branches: 1.67.4; 1.67.6; 1.67.10; 1.67.12; 1.67.14;
Regen for linux_sys_msync removal.
 1.66 24-Dec-2007  njoly branches: 1.66.6;
Regen for linux_sys_getpgid removal.
 1.65 21-Dec-2007  njoly Regen for getfsuid/setfsgid syscall exchange.
 1.64 20-Dec-2007  dsl regen
 1.63 16-Nov-2007  njoly branches: 1.63.2; 1.63.6;
Regen, for syscalls cleanup.
 1.62 04-Mar-2007  christos branches: 1.62.14; 1.62.16; 1.62.20; 1.62.22;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.61 01-Sep-2006  matt branches: 1.61.8;
Regen.
 1.60 30-Aug-2006  matt Regen
 1.59 10-Jun-2006  christos regen
 1.58 11-Dec-2005  christos branches: 1.58.4; 1.58.8; 1.58.14;
merge ktrace-lwp.
 1.57 16-May-2005  fvdl branches: 1.57.2;
Regen.
 1.56 16-May-2005  fvdl Regen.
 1.55 26-Feb-2005  perry regen
 1.54 26-Feb-2005  perry regen
 1.53 05-Oct-2004  jdolecek branches: 1.53.4; 1.53.6;
regen: generate struct linux_sys_shmget_args for linux_sys_shmget(2)
 1.52 28-Sep-2004  jdolecek regen - now using wrapper for shmget(2)
 1.51 08-Sep-2004  jdolecek regen: add exit_group(2)
 1.50 01-Aug-2004  jdolecek regen - sync syscall lists with Linux kernel 2.6.7
 1.49 01-Aug-2004  jdolecek regen:

connect madvise(2) and mincore(2) - apparently the newer Linux libs
don't stub it anymore, so allow the application to take advantage
of them

the Linux calls appear to be compatible in the flag values and semantics,
so a wrapper is not necessary
 1.48 18-Jan-2003  thorpej branches: 1.48.2; 1.48.4;
Regen to get correct RCS ID.
 1.47 18-Jan-2003  thorpej Regen: Merge the nathanw_sa branch.
 1.46 10-Apr-2002  christos regen
 1.45 22-Mar-2002  christos regen.
 1.44 18-Feb-2002  christos regen
 1.43 18-Feb-2002  christos regen
 1.42 15-Feb-2002  christos - add a real linux_sys___sysctl because the mib numbers are different.
implement only the kernel version getting entries.
- make the signal conversion functions consistent; dest is arg 1.
- make linux_fakedev deal with block and char devices differently.
- add linux_sys_ugetrlimit, and flesh out the regular get/setrlimit so
that they work properly.
- add linux_mmap2 [untested].
- bump kernel to 2.4.18, and make the date be valentine's day :-)
- linux_sys_*stat64 family was totally busted. Fix it.

tested only on i386.

Status:
gdb, telnet, work
jdk-1.4.0 extractor works, jdk still coredumps.

christos
 1.41 13-Nov-2001  lukem add RCSIDs (including regeneration of files as appropriate)
 1.40 08-Sep-2001  manu Forgotten file in my last commit for removing PowerPC mmap hack in Linux
emulation
 1.39 04-Jul-2001  jdolecek branches: 1.39.2; 1.39.4;
Regen - modify to use linux_* wrappers for syscalls passing/fetching sockaddr
 1.38 30-May-2001  mrg use _KERNEL_OPT.
 1.37 30-Mar-2001  jdolecek regen - use linux_sys_nosys() instead sys_nosys()
 1.36 30-Mar-2001  jdolecek regen
 1.35 30-Mar-2001  jdolecek regen
 1.34 27-Jan-2001  thorpej branches: 1.34.2;
Regen; add sy_flags.
 1.33 29-Dec-2000  fvdl Regen.
 1.32 21-Dec-2000  thorpej Regen.
 1.31 14-Dec-2000  jdolecek regen
 1.30 14-Dec-2000  mycroft Regen.
 1.29 11-Dec-2000  mycroft Regen.
 1.28 11-Dec-2000  mycroft Regen.
 1.27 09-Dec-2000  jdolecek regen
 1.26 09-Dec-2000  mycroft Regen.
 1.25 02-Dec-2000  jdolecek regen after addition of linux_sys_swapoff()
 1.24 01-Dec-2000  jdolecek regen
 1.23 17-Nov-2000  erh Regen.
 1.22 08-Nov-2000  erh Update the names of some unimplemented syscalls to match what linux calls them. Match const in parameters to our sys_writev.
 1.21 01-Nov-2000  jdolecek regen
 1.20 18-Aug-2000  cgd update for changed makesyscalls.master
 1.19 18-Aug-2000  cgd update for new makesyscalls.sh, and also for correct ids for changed
syscalls.master files. (you need to regenerate after checking in
syscalls.master to get the correct ids.)
 1.18 20-Mar-2000  erh branches: 1.18.4;
Regen.
 1.17 18-Mar-2000  erh Regen.
 1.16 18-Mar-2000  erh Regen.
 1.15 18-Mar-2000  erh Regen.
 1.14 16-Dec-1999  tron Regen.
 1.13 05-Dec-1999  tron Regen.
 1.12 04-Oct-1999  tron branches: 1.12.2; 1.12.8;
Regen from "syscalls.master".
 1.11 14-May-1999  thorpej Regen.
 1.10 13-May-1999  thorpej Regen.
 1.9 30-Mar-1999  tron branches: 1.9.4;
Regen.
 1.8 27-Mar-1999  tron Regen.
 1.7 23-Mar-1999  thorpej Regen; pread(2) and pwrite(2).
 1.6 10-Dec-1998  christos Regen
 1.5 19-Oct-1998  tron Regen.
 1.4 07-Oct-1998  erh Regen.
 1.3 04-Oct-1998  fvdl Assign my copyright to TNF. Merge with others were appropriate.
Regen syscall files after script change.
 1.2 03-Oct-1998  christos Attempt to fix the mess.
 1.1 30-Sep-1998  erh Generate.
 1.9.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.12.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.12.2.6 21-Apr-2001  bouyer Sync with HEAD
 1.12.2.5 05-Jan-2001  bouyer Sync with HEAD
 1.12.2.4 13-Dec-2000  bouyer Sync with HEAD (for UBC fixes).
 1.12.2.3 08-Dec-2000  bouyer Sync with HEAD.
 1.12.2.2 22-Nov-2000  bouyer Sync with HEAD.
 1.12.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.18.4.2 01-May-2001  he Pull up regenerated files (requested by jdolecek):
Make it possible to use a different function for unimplemented
syscalls than sys_nosys(), so that the Linux emulation can avoid
posting SIGSYS and instead just return ENOSYS.
 1.18.4.1 30-Mar-2001  he Pull up regenerated files (requested by fvdl):
Add some required Linux emulation bits to support the Linux
version of VMware.
 1.34.2.10 29-May-2002  nathanw Regen.
 1.34.2.9 17-Apr-2002  nathanw Catch up to -current.
 1.34.2.8 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.34.2.7 28-Feb-2002  nathanw Catch up to -current.
 1.34.2.6 14-Nov-2001  nathanw Catch up to -current.
 1.34.2.5 21-Sep-2001  nathanw Catch up to -current.
 1.34.2.4 30-Aug-2001  nathanw First cut at LWP and SA support on the alpha.
Doesn't break in ordinary multiuser mode; LWPs and SAs not yet tested.
 1.34.2.3 24-Aug-2001  nathanw Catch up with -current.
 1.34.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.34.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.39.4.1 01-Oct-2001  fvdl Catch up with -current.
 1.39.2.4 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.39.2.3 16-Mar-2002  jdolecek Catch up with -current.
 1.39.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.39.2.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.48.4.2 08-Oct-2004  jmc Regen for ticket #884
 1.48.4.1 04-Oct-2004  jmc Regen
 1.48.2.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.48.2.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.48.2.4 19-Oct-2004  skrll Sync with HEAD
 1.48.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.48.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.48.2.1 03-Aug-2004  skrll Sync with HEAD
 1.53.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.53.4.1 29-Apr-2005  kent sync with -current
 1.57.2.5 21-Jan-2008  yamt sync with head
 1.57.2.4 07-Dec-2007  yamt sync with head
 1.57.2.3 03-Sep-2007  yamt sync with head.
 1.57.2.2 30-Dec-2006  yamt sync with head.
 1.57.2.1 21-Jun-2006  yamt sync with head.
 1.58.14.1 19-Jun-2006  chap Sync with head.
 1.58.8.2 03-Sep-2006  yamt sync with head.
 1.58.8.1 26-Jun-2006  yamt sync with head.
 1.58.4.1 09-Sep-2006  rpaulo sync with head
 1.61.8.1 12-Mar-2007  rmind Sync with HEAD.
 1.62.22.2 27-Dec-2007  mjf Sync with HEAD.
 1.62.22.1 19-Nov-2007  mjf Sync with HEAD.
 1.62.20.1 18-Nov-2007  bouyer Sync with HEAD
 1.62.16.1 09-Jan-2008  matt sync with HEAD
 1.62.14.1 21-Nov-2007  joerg Sync with HEAD.
 1.63.6.1 02-Jan-2008  bouyer Sync with HEAD
 1.63.2.1 26-Dec-2007  ad Sync with head.
 1.66.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.66.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.67.14.1 20-Nov-2008  snj Regen for ticket 81.
 1.67.12.1 19-Jan-2009  skrll Sync with HEAD.
 1.67.10.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.67.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.67.4.4 11-Aug-2010  yamt sync with head.
 1.67.4.3 11-Mar-2010  yamt sync with head
 1.67.4.2 20-Jun-2009  yamt sync with head
 1.67.4.1 04-May-2009  yamt sync with head.
 1.73.2.1 23-Jul-2009  jym Sync with HEAD.
 1.77.4.3 31-May-2011  rmind sync with head
 1.77.4.2 21-Apr-2011  rmind sync with head
 1.77.4.1 05-Mar-2011  rmind sync with head
 1.77.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.78.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.81.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.81.4.2 30-Oct-2012  yamt sync with head
 1.81.4.1 17-Apr-2012  yamt sync with head
 1.82.10.3 03-Dec-2017  jdolecek update from HEAD
 1.82.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.82.10.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.83.2.1 18-May-2014  rmind sync with head
 1.89.2.1 10-Aug-2014  tls Rebase.
 1.94.2.1 17-Apr-2017  snj regen for ticket 1354
 1.95.2.4 05-Feb-2017  skrll Sync with HEAD
 1.95.2.3 05-Oct-2016  skrll Sync with HEAD
 1.95.2.2 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.95.2.1 06-Apr-2015  skrll Sync with HEAD
 1.98.2.3 20-Mar-2017  pgoyette Sync with HEAD
 1.98.2.2 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.98.2.1 26-Jul-2016  pgoyette Sync with HEAD
 1.102.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.105.4.1 11-May-2017  pgoyette Sync with HEAD
 1.106.10.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.106.10.1 10-Jun-2019  christos Sync with HEAD
 1.106.8.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.110.2.2 17-Dec-2020  thorpej Regen for preadv(2) and pwritev(2).
 1.110.2.1 15-Dec-2020  thorpej Regen for eventfd, timerfd, POSIX timers.
 1.120.2.1 02-Aug-2025  perseant Sync with HEAD
 1.121 28-Sep-2024  christos regen
 1.120 01-Jul-2024  christos regen
 1.119 29-Jun-2024  christos branches: 1.119.2;
regen
 1.118 19-Aug-2023  christos regen
 1.117 18-Aug-2023  christos regen
 1.116 29-Jul-2023  christos regen
 1.115 28-Jul-2023  christos regen
 1.114 02-Dec-2021  ryo regen
 1.113 20-Sep-2021  thorpej Regen for preadv(2) / pwritev(2).
 1.112 20-Sep-2021  thorpej Regen for eventfd.
 1.111 19-Sep-2021  thorpej Regen for timerfd.
 1.110 19-Sep-2021  thorpej Regen for POSIX timer syscalls.
 1.109 26-Apr-2020  thorpej branches: 1.109.2;
Regen for native futex calls.
 1.108 09-Nov-2019  jdolecek regen
 1.107 24-Mar-2019  maxv regen
 1.106 10-Aug-2018  pgoyette Regen
 1.105 10-May-2017  riastradh branches: 1.105.8; 1.105.10;
regen
 1.104 03-Feb-2017  christos branches: 1.104.4;
regen
 1.103 03-Feb-2017  martin Regen for accept4
 1.102 16-Jan-2017  christos regen all
 1.101 13-Jan-2017  christos branches: 1.101.2;
regen
 1.100 02-Jan-2017  martin Regen (something apparently went wrong in previous)
 1.99 02-Jan-2017  manu Regen
 1.98 24-Jul-2016  njoly Regen for readlink/readlinkat signatures.
 1.97 25-Oct-2015  njoly branches: 1.97.2;
Regen for posix chown family cleanup.
 1.96 24-Sep-2015  christos regen
 1.95 07-Mar-2015  christos regen
 1.94 22-Nov-2014  njoly branches: 1.94.2;
Regen for ppoll signature fix
 1.93 29-May-2014  njoly branches: 1.93.2;
Regen for utimes(2) change.
 1.92 17-May-2014  njoly Regen for fadvise64 offset types changes.
 1.91 06-May-2014  njoly Regen for mknod device argument type change.
 1.90 04-May-2014  njoly Regen for pread/pwrite 64bit offset argument.
 1.89 08-Apr-2014  njoly Regen.
 1.88 13-Jan-2014  njoly branches: 1.88.2;
Regen.
 1.87 27-Dec-2013  njoly Regen.
 1.86 08-Dec-2013  njoly Regen.
 1.85 19-Nov-2013  chs regen
 1.84 24-Sep-2013  njoly Regen for utimensat(2).
 1.83 15-Sep-2013  njoly Regen.
 1.82 19-Sep-2012  pooka branches: 1.82.2;
regen for ppoll (and, apparently, SYCALL_ARG_PTR)
 1.81 18-Nov-2011  christos branches: 1.81.10;
- add sigtimedwait support.
- merge the siginfo population code.
 1.80 30-May-2011  alnsn branches: 1.80.4;
Regenerate files to pick up correct RCS Ids. Suggested by Chris Badura.
 1.79 30-May-2011  alnsn Add fadvise64 and fadvise64_64 syscalls to compat_linux and compat_linux32.
 1.78 15-Apr-2011  he Regenerate these files after adding pipe2() and dup3().
 1.77 07-Jul-2010  chs branches: 1.77.2;
regen
 1.76 14-Dec-2009  matt branches: 1.76.2; 1.76.4;
Regen (new makesyscalls.sh)
 1.75 24-Nov-2009  njoly Regen for personality(2) update.
 1.74 17-Jun-2009  njoly Regen for sendmsg/recvmsg definitions update.
 1.73 08-Jun-2009  njoly Regen for rt_queueinfo(2) update.
 1.72 17-Jan-2009  njoly branches: 1.72.2;
Regen for wait4 update.
 1.71 15-Jan-2009  njoly Rengen for compat50 update.
 1.70 13-Jan-2009  pooka Regen to prove I didn't screw up the conversion: purely RCSID changes.
 1.69 13-Jan-2009  pooka regen
 1.68 19-Nov-2008  ad Regen.
 1.67 12-Nov-2008  njoly Regen for nanosleep(2) fix.
 1.66 04-Apr-2008  njoly branches: 1.66.4; 1.66.6; 1.66.10; 1.66.12; 1.66.14;
Regen for linux_sys_msync removal.
 1.65 24-Dec-2007  njoly branches: 1.65.6;
Regen for linux_sys_getpgid removal.
 1.64 21-Dec-2007  njoly Regen for getfsuid/setfsgid syscall exchange.
 1.63 20-Dec-2007  dsl regen
 1.62 16-Nov-2007  njoly branches: 1.62.2; 1.62.6;
Regen, for syscalls cleanup.
 1.61 04-Mar-2007  christos branches: 1.61.14; 1.61.16; 1.61.20; 1.61.22;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.60 01-Sep-2006  matt branches: 1.60.8;
Regen.
 1.59 30-Aug-2006  matt Regen
 1.58 10-Jun-2006  christos regen
 1.57 11-Dec-2005  christos branches: 1.57.4; 1.57.8; 1.57.14;
merge ktrace-lwp.
 1.56 16-May-2005  fvdl branches: 1.56.2;
Regen.
 1.55 16-May-2005  fvdl Regen.
 1.54 26-Feb-2005  perry regen
 1.53 26-Feb-2005  perry regen
 1.52 05-Oct-2004  jdolecek branches: 1.52.4; 1.52.6;
regen: generate struct linux_sys_shmget_args for linux_sys_shmget(2)
 1.51 28-Sep-2004  jdolecek regen - now using wrapper for shmget(2)
 1.50 08-Sep-2004  jdolecek regen: add exit_group(2)
 1.49 01-Aug-2004  jdolecek regen - sync syscall lists with Linux kernel 2.6.7
 1.48 01-Aug-2004  jdolecek regen:

connect madvise(2) and mincore(2) - apparently the newer Linux libs
don't stub it anymore, so allow the application to take advantage
of them

the Linux calls appear to be compatible in the flag values and semantics,
so a wrapper is not necessary
 1.47 18-Jan-2003  thorpej branches: 1.47.2; 1.47.4;
Regen to get correct RCS ID.
 1.46 18-Jan-2003  thorpej Regen: Merge the nathanw_sa branch.
 1.45 10-Apr-2002  christos regen
 1.44 22-Mar-2002  christos regen.
 1.43 18-Feb-2002  christos regen
 1.42 18-Feb-2002  christos regen
 1.41 15-Feb-2002  christos - add a real linux_sys___sysctl because the mib numbers are different.
implement only the kernel version getting entries.
- make the signal conversion functions consistent; dest is arg 1.
- make linux_fakedev deal with block and char devices differently.
- add linux_sys_ugetrlimit, and flesh out the regular get/setrlimit so
that they work properly.
- add linux_mmap2 [untested].
- bump kernel to 2.4.18, and make the date be valentine's day :-)
- linux_sys_*stat64 family was totally busted. Fix it.

tested only on i386.

Status:
gdb, telnet, work
jdk-1.4.0 extractor works, jdk still coredumps.

christos
 1.40 13-Nov-2001  lukem add RCSIDs (including regeneration of files as appropriate)
 1.39 04-Jul-2001  jdolecek branches: 1.39.2;
Regen - modify to use linux_* wrappers for syscalls passing/fetching sockaddr
 1.38 30-May-2001  mrg use _KERNEL_OPT.
 1.37 30-Mar-2001  jdolecek regen - use linux_sys_nosys() instead sys_nosys()
 1.36 30-Mar-2001  jdolecek regen
 1.35 30-Mar-2001  jdolecek regen
 1.34 27-Jan-2001  thorpej branches: 1.34.2;
Regen; add sy_flags.
 1.33 29-Dec-2000  fvdl Regen.
 1.32 21-Dec-2000  thorpej Regen.
 1.31 14-Dec-2000  jdolecek regen
 1.30 14-Dec-2000  mycroft Regen.
 1.29 11-Dec-2000  mycroft Regen.
 1.28 11-Dec-2000  mycroft Regen.
 1.27 09-Dec-2000  jdolecek regen
 1.26 09-Dec-2000  mycroft Regen.
 1.25 02-Dec-2000  jdolecek regen after addition of linux_sys_swapoff()
 1.24 01-Dec-2000  jdolecek regen
 1.23 17-Nov-2000  erh Regen.
 1.22 08-Nov-2000  erh Update the names of some unimplemented syscalls to match what linux calls them. Match const in parameters to our sys_writev.
 1.21 01-Nov-2000  jdolecek regen
 1.20 18-Aug-2000  cgd update for changed makesyscalls.master
 1.19 18-Aug-2000  cgd update for new makesyscalls.sh, and also for correct ids for changed
syscalls.master files. (you need to regenerate after checking in
syscalls.master to get the correct ids.)
 1.18 20-Mar-2000  erh branches: 1.18.4;
Regen.
 1.17 18-Mar-2000  erh Regen.
 1.16 18-Mar-2000  erh Regen.
 1.15 18-Mar-2000  erh Regen.
 1.14 16-Dec-1999  tron Regen.
 1.13 05-Dec-1999  tron Regen.
 1.12 04-Oct-1999  tron branches: 1.12.2; 1.12.8;
Regen from "syscalls.master".
 1.11 14-May-1999  thorpej Regen.
 1.10 13-May-1999  thorpej Regen.
 1.9 30-Mar-1999  tron branches: 1.9.4;
Regen.
 1.8 27-Mar-1999  tron Regen.
 1.7 23-Mar-1999  thorpej Regen; pread(2) and pwrite(2).
 1.6 10-Dec-1998  christos Regen
 1.5 19-Oct-1998  tron Regen.
 1.4 07-Oct-1998  erh Regen.
 1.3 04-Oct-1998  fvdl Assign my copyright to TNF. Merge with others were appropriate.
Regen syscall files after script change.
 1.2 03-Oct-1998  christos Attempt to fix the mess.
 1.1 30-Sep-1998  erh Generate.
 1.9.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.12.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.12.2.6 21-Apr-2001  bouyer Sync with HEAD
 1.12.2.5 05-Jan-2001  bouyer Sync with HEAD
 1.12.2.4 13-Dec-2000  bouyer Sync with HEAD (for UBC fixes).
 1.12.2.3 08-Dec-2000  bouyer Sync with HEAD.
 1.12.2.2 22-Nov-2000  bouyer Sync with HEAD.
 1.12.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.18.4.2 01-May-2001  he Pull up regenerated files (requested by jdolecek):
Make it possible to use a different function for unimplemented
syscalls than sys_nosys(), so that the Linux emulation can avoid
posting SIGSYS and instead just return ENOSYS.
 1.18.4.1 30-Mar-2001  he Pull up regenerated files (requested by fvdl):
Add some required Linux emulation bits to support the Linux
version of VMware.
 1.34.2.9 29-May-2002  nathanw Regen.
 1.34.2.8 17-Apr-2002  nathanw Catch up to -current.
 1.34.2.7 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.34.2.6 28-Feb-2002  nathanw Catch up to -current.
 1.34.2.5 14-Nov-2001  nathanw Catch up to -current.
 1.34.2.4 30-Aug-2001  nathanw First cut at LWP and SA support on the alpha.
Doesn't break in ordinary multiuser mode; LWPs and SAs not yet tested.
 1.34.2.3 24-Aug-2001  nathanw Catch up with -current.
 1.34.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.34.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.39.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.39.2.2 16-Mar-2002  jdolecek Catch up with -current.
 1.39.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.47.4.2 08-Oct-2004  jmc Regen for ticket #884
 1.47.4.1 04-Oct-2004  jmc Regen
 1.47.2.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.47.2.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.47.2.4 19-Oct-2004  skrll Sync with HEAD
 1.47.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.47.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.47.2.1 03-Aug-2004  skrll Sync with HEAD
 1.52.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.52.4.1 29-Apr-2005  kent sync with -current
 1.56.2.5 21-Jan-2008  yamt sync with head
 1.56.2.4 07-Dec-2007  yamt sync with head
 1.56.2.3 03-Sep-2007  yamt sync with head.
 1.56.2.2 30-Dec-2006  yamt sync with head.
 1.56.2.1 21-Jun-2006  yamt sync with head.
 1.57.14.1 19-Jun-2006  chap Sync with head.
 1.57.8.2 03-Sep-2006  yamt sync with head.
 1.57.8.1 26-Jun-2006  yamt sync with head.
 1.57.4.1 09-Sep-2006  rpaulo sync with head
 1.60.8.1 12-Mar-2007  rmind Sync with HEAD.
 1.61.22.2 27-Dec-2007  mjf Sync with HEAD.
 1.61.22.1 19-Nov-2007  mjf Sync with HEAD.
 1.61.20.1 18-Nov-2007  bouyer Sync with HEAD
 1.61.16.1 09-Jan-2008  matt sync with HEAD
 1.61.14.1 21-Nov-2007  joerg Sync with HEAD.
 1.62.6.1 02-Jan-2008  bouyer Sync with HEAD
 1.62.2.1 26-Dec-2007  ad Sync with head.
 1.65.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.65.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.66.14.1 20-Nov-2008  snj Regen for ticket 81.
 1.66.12.1 19-Jan-2009  skrll Sync with HEAD.
 1.66.10.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.66.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.66.4.4 11-Aug-2010  yamt sync with head.
 1.66.4.3 11-Mar-2010  yamt sync with head
 1.66.4.2 20-Jun-2009  yamt sync with head
 1.66.4.1 04-May-2009  yamt sync with head.
 1.72.2.1 23-Jul-2009  jym Sync with HEAD.
 1.76.4.3 31-May-2011  rmind sync with head
 1.76.4.2 21-Apr-2011  rmind sync with head
 1.76.4.1 05-Mar-2011  rmind sync with head
 1.76.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.77.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.80.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.80.4.2 30-Oct-2012  yamt sync with head
 1.80.4.1 17-Apr-2012  yamt sync with head
 1.81.10.3 03-Dec-2017  jdolecek update from HEAD
 1.81.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.81.10.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.82.2.1 18-May-2014  rmind sync with head
 1.88.2.1 10-Aug-2014  tls Rebase.
 1.93.2.1 17-Apr-2017  snj regen for ticket 1354
 1.94.2.5 28-Aug-2017  skrll Sync with HEAD
 1.94.2.4 05-Feb-2017  skrll Sync with HEAD
 1.94.2.3 05-Oct-2016  skrll Sync with HEAD
 1.94.2.2 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.94.2.1 06-Apr-2015  skrll Sync with HEAD
 1.97.2.3 20-Mar-2017  pgoyette Sync with HEAD
 1.97.2.2 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.97.2.1 26-Jul-2016  pgoyette Sync with HEAD
 1.101.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.104.4.1 11-May-2017  pgoyette Sync with HEAD
 1.105.10.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.105.10.1 10-Jun-2019  christos Sync with HEAD
 1.105.8.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.109.2.2 17-Dec-2020  thorpej Regen for preadv(2) and pwritev(2).
 1.109.2.1 15-Dec-2020  thorpej Regen for eventfd, timerfd, POSIX timers.
 1.119.2.1 02-Aug-2025  perseant Sync with HEAD
 1.123 28-Sep-2024  christos regen
 1.122 01-Jul-2024  christos regen
 1.121 29-Jun-2024  christos branches: 1.121.2;
regen
 1.120 19-Aug-2023  christos regen
 1.119 18-Aug-2023  christos regen
 1.118 29-Jul-2023  christos regen
 1.117 28-Jul-2023  christos regen
 1.116 02-Dec-2021  ryo regen
 1.115 20-Sep-2021  thorpej Regen for preadv(2) / pwritev(2).
 1.114 20-Sep-2021  thorpej Regen for eventfd.
 1.113 19-Sep-2021  thorpej Regen for timerfd.
 1.112 19-Sep-2021  thorpej Regen for POSIX timer syscalls.
 1.111 26-Apr-2020  thorpej branches: 1.111.2;
Regen for native futex calls.
 1.110 09-Nov-2019  jdolecek regen
 1.109 24-Mar-2019  maxv regen
 1.108 10-Aug-2018  pgoyette Regen
 1.107 10-May-2017  riastradh branches: 1.107.8; 1.107.10;
regen
 1.106 03-Feb-2017  christos branches: 1.106.4;
regen
 1.105 03-Feb-2017  martin Regen for accept4
 1.104 16-Jan-2017  christos regen all
 1.103 13-Jan-2017  christos branches: 1.103.2;
regen
 1.102 02-Jan-2017  martin Regen (something apparently went wrong in previous)
 1.101 02-Jan-2017  manu Regen
 1.100 24-Jul-2016  njoly Regen for readlink/readlinkat signatures.
 1.99 25-Oct-2015  njoly branches: 1.99.2;
Regen for posix chown family cleanup.
 1.98 24-Sep-2015  christos regen
 1.97 07-Mar-2015  christos regen
 1.96 22-Nov-2014  njoly branches: 1.96.2;
Regen for ppoll signature fix
 1.95 29-May-2014  njoly branches: 1.95.2;
Regen for utimes(2) change.
 1.94 17-May-2014  njoly Regen for fadvise64 offset types changes.
 1.93 06-May-2014  njoly Regen for mknod device argument type change.
 1.92 04-May-2014  njoly Regen for pread/pwrite 64bit offset argument.
 1.91 08-Apr-2014  njoly Regen.
 1.90 13-Jan-2014  njoly branches: 1.90.2;
Regen.
 1.89 27-Dec-2013  njoly Regen.
 1.88 08-Dec-2013  njoly Regen.
 1.87 19-Nov-2013  chs regen
 1.86 24-Sep-2013  njoly Regen for utimensat(2).
 1.85 15-Sep-2013  njoly Regen.
 1.84 19-Sep-2012  pooka branches: 1.84.2;
regen for ppoll (and, apparently, SYCALL_ARG_PTR)
 1.83 18-Nov-2011  christos branches: 1.83.10;
- add sigtimedwait support.
- merge the siginfo population code.
 1.82 30-May-2011  alnsn branches: 1.82.4;
Regenerate files to pick up correct RCS Ids. Suggested by Chris Badura.
 1.81 30-May-2011  alnsn Add fadvise64 and fadvise64_64 syscalls to compat_linux and compat_linux32.
 1.80 15-Apr-2011  he Regenerate these files after adding pipe2() and dup3().
 1.79 07-Jul-2010  chs branches: 1.79.2;
regen
 1.78 14-Dec-2009  matt branches: 1.78.2; 1.78.4;
Regen (new makesyscalls.sh)
 1.77 24-Nov-2009  njoly Regen for personality(2) update.
 1.76 17-Jun-2009  njoly Regen for sendmsg/recvmsg definitions update.
 1.75 08-Jun-2009  njoly Regen for rt_queueinfo(2) update.
 1.74 17-Jan-2009  njoly branches: 1.74.2;
Regen for wait4 update.
 1.73 15-Jan-2009  njoly Rengen for compat50 update.
 1.72 13-Jan-2009  pooka Regen to prove I didn't screw up the conversion: purely RCSID changes.
 1.71 13-Jan-2009  pooka regen
 1.70 19-Nov-2008  ad Regen.
 1.69 12-Nov-2008  njoly Regen for nanosleep(2) fix.
 1.68 04-Apr-2008  njoly branches: 1.68.4; 1.68.6; 1.68.10; 1.68.12; 1.68.14;
Regen for linux_sys_msync removal.
 1.67 24-Dec-2007  njoly branches: 1.67.6;
Regen for linux_sys_getpgid removal.
 1.66 21-Dec-2007  njoly Regen for getfsuid/setfsgid syscall exchange.
 1.65 20-Dec-2007  dsl regen
 1.64 16-Nov-2007  njoly branches: 1.64.2; 1.64.6;
Regen, for syscalls cleanup.
 1.63 09-Feb-2007  ad branches: 1.63.18; 1.63.20; 1.63.24; 1.63.26;
Merge newlock2 to head.
 1.62 01-Sep-2006  matt branches: 1.62.2;
Regen.
 1.61 30-Aug-2006  matt Regen
 1.60 10-Jun-2006  christos regen
 1.59 11-Dec-2005  christos branches: 1.59.4; 1.59.8; 1.59.14;
merge ktrace-lwp.
 1.58 16-May-2005  fvdl branches: 1.58.2;
Regen.
 1.57 16-May-2005  fvdl Regen.
 1.56 26-Feb-2005  perry regen
 1.55 26-Feb-2005  perry regen
 1.54 05-Oct-2004  jdolecek branches: 1.54.4; 1.54.6;
regen: generate struct linux_sys_shmget_args for linux_sys_shmget(2)
 1.53 28-Sep-2004  jdolecek regen - now using wrapper for shmget(2)
 1.52 08-Sep-2004  jdolecek regen: add exit_group(2)
 1.51 01-Aug-2004  jdolecek regen - sync syscall lists with Linux kernel 2.6.7
 1.50 01-Aug-2004  jdolecek regen:

connect madvise(2) and mincore(2) - apparently the newer Linux libs
don't stub it anymore, so allow the application to take advantage
of them

the Linux calls appear to be compatible in the flag values and semantics,
so a wrapper is not necessary
 1.49 18-Jan-2003  thorpej branches: 1.49.2; 1.49.4;
Regen to get correct RCS ID.
 1.48 18-Jan-2003  thorpej Regen: Merge the nathanw_sa branch.
 1.47 10-Apr-2002  christos regen
 1.46 22-Mar-2002  christos regen.
 1.45 18-Feb-2002  christos regen
 1.44 18-Feb-2002  christos regen
 1.43 15-Feb-2002  christos - add a real linux_sys___sysctl because the mib numbers are different.
implement only the kernel version getting entries.
- make the signal conversion functions consistent; dest is arg 1.
- make linux_fakedev deal with block and char devices differently.
- add linux_sys_ugetrlimit, and flesh out the regular get/setrlimit so
that they work properly.
- add linux_mmap2 [untested].
- bump kernel to 2.4.18, and make the date be valentine's day :-)
- linux_sys_*stat64 family was totally busted. Fix it.

tested only on i386.

Status:
gdb, telnet, work
jdk-1.4.0 extractor works, jdk still coredumps.

christos
 1.42 13-Nov-2001  lukem add RCSIDs (including regeneration of files as appropriate)
 1.41 08-Sep-2001  manu Removed a hack to make PowerPC mmap work. This could have side effects on
alpha and i386. It has been tested and works on i386.
 1.40 04-Jul-2001  jdolecek branches: 1.40.2; 1.40.4;
Regen - modify to use linux_* wrappers for syscalls passing/fetching sockaddr
 1.39 30-May-2001  mrg use _KERNEL_OPT.
 1.38 30-Mar-2001  jdolecek regen - use linux_sys_nosys() instead sys_nosys()
 1.37 30-Mar-2001  jdolecek regen
 1.36 30-Mar-2001  jdolecek regen
 1.35 27-Jan-2001  thorpej branches: 1.35.2;
Regen; add sy_flags.
 1.34 29-Dec-2000  fvdl Regen.
 1.33 21-Dec-2000  thorpej Regen.
 1.32 14-Dec-2000  jdolecek regen
 1.31 14-Dec-2000  mycroft Regen.
 1.30 11-Dec-2000  mycroft Regen.
 1.29 11-Dec-2000  mycroft Regen.
 1.28 09-Dec-2000  jdolecek regen
 1.27 09-Dec-2000  mycroft Regen.
 1.26 02-Dec-2000  jdolecek regen after addition of linux_sys_swapoff()
 1.25 01-Dec-2000  jdolecek regen
 1.24 17-Nov-2000  erh Regen.
 1.23 13-Nov-2000  jdolecek change the type of *syscallnames[] array to 'const char * const foo[]'
 1.22 08-Nov-2000  erh Update the names of some unimplemented syscalls to match what linux calls them. Match const in parameters to our sys_writev.
 1.21 01-Nov-2000  jdolecek regen
 1.20 18-Aug-2000  cgd update for changed makesyscalls.master
 1.19 18-Aug-2000  cgd update for new makesyscalls.sh, and also for correct ids for changed
syscalls.master files. (you need to regenerate after checking in
syscalls.master to get the correct ids.)
 1.18 20-Mar-2000  erh branches: 1.18.4;
Regen.
 1.17 18-Mar-2000  erh Regen.
 1.16 18-Mar-2000  erh Regen.
 1.15 18-Mar-2000  erh Regen.
 1.14 16-Dec-1999  tron Regen.
 1.13 05-Dec-1999  tron Regen.
 1.12 04-Oct-1999  tron branches: 1.12.2; 1.12.8;
Regen from "syscalls.master".
 1.11 14-May-1999  thorpej Regen.
 1.10 13-May-1999  thorpej Regen.
 1.9 30-Mar-1999  tron branches: 1.9.4;
Regen.
 1.8 27-Mar-1999  tron Regen.
 1.7 23-Mar-1999  thorpej Regen; pread(2) and pwrite(2).
 1.6 10-Dec-1998  christos Regen
 1.5 19-Oct-1998  tron Regen.
 1.4 07-Oct-1998  erh Regen.
 1.3 04-Oct-1998  fvdl Assign my copyright to TNF. Merge with others were appropriate.
Regen syscall files after script change.
 1.2 03-Oct-1998  christos Attempt to fix the mess.
 1.1 30-Sep-1998  erh Generate.
 1.9.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.12.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.12.2.6 21-Apr-2001  bouyer Sync with HEAD
 1.12.2.5 05-Jan-2001  bouyer Sync with HEAD
 1.12.2.4 13-Dec-2000  bouyer Sync with HEAD (for UBC fixes).
 1.12.2.3 08-Dec-2000  bouyer Sync with HEAD.
 1.12.2.2 22-Nov-2000  bouyer Sync with HEAD.
 1.12.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.18.4.2 01-May-2001  he Pull up regenerated files (requested by jdolecek):
Make it possible to use a different function for unimplemented
syscalls than sys_nosys(), so that the Linux emulation can avoid
posting SIGSYS and instead just return ENOSYS.
 1.18.4.1 30-Mar-2001  he Pull up regenerated files (requested by fvdl):
Add some required Linux emulation bits to support the Linux
version of VMware.
 1.35.2.9 29-May-2002  nathanw Regen.
 1.35.2.8 17-Apr-2002  nathanw Catch up to -current.
 1.35.2.7 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.35.2.6 28-Feb-2002  nathanw Catch up to -current.
 1.35.2.5 14-Nov-2001  nathanw Catch up to -current.
 1.35.2.4 30-Aug-2001  nathanw First cut at LWP and SA support on the alpha.
Doesn't break in ordinary multiuser mode; LWPs and SAs not yet tested.
 1.35.2.3 24-Aug-2001  nathanw Catch up with -current.
 1.35.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.35.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.40.4.1 01-Oct-2001  fvdl Catch up with -current.
 1.40.2.4 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.40.2.3 16-Mar-2002  jdolecek Catch up with -current.
 1.40.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.40.2.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.49.4.2 08-Oct-2004  jmc Regen for ticket #884
 1.49.4.1 04-Oct-2004  jmc Regen
 1.49.2.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.49.2.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.49.2.4 19-Oct-2004  skrll Sync with HEAD
 1.49.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.49.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.49.2.1 03-Aug-2004  skrll Sync with HEAD
 1.54.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.54.4.1 29-Apr-2005  kent sync with -current
 1.58.2.5 21-Jan-2008  yamt sync with head
 1.58.2.4 07-Dec-2007  yamt sync with head
 1.58.2.3 26-Feb-2007  yamt sync with head.
 1.58.2.2 30-Dec-2006  yamt sync with head.
 1.58.2.1 21-Jun-2006  yamt sync with head.
 1.59.14.1 19-Jun-2006  chap Sync with head.
 1.59.8.2 03-Sep-2006  yamt sync with head.
 1.59.8.1 26-Jun-2006  yamt sync with head.
 1.59.4.1 09-Sep-2006  rpaulo sync with head
 1.62.2.1 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.63.26.2 27-Dec-2007  mjf Sync with HEAD.
 1.63.26.1 19-Nov-2007  mjf Sync with HEAD.
 1.63.24.1 18-Nov-2007  bouyer Sync with HEAD
 1.63.20.1 09-Jan-2008  matt sync with HEAD
 1.63.18.1 21-Nov-2007  joerg Sync with HEAD.
 1.64.6.1 02-Jan-2008  bouyer Sync with HEAD
 1.64.2.1 26-Dec-2007  ad Sync with head.
 1.67.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.67.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.68.14.1 20-Nov-2008  snj Regen for ticket 81.
 1.68.12.1 19-Jan-2009  skrll Sync with HEAD.
 1.68.10.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.68.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.68.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.68.4.4 11-Aug-2010  yamt sync with head.
 1.68.4.3 11-Mar-2010  yamt sync with head
 1.68.4.2 20-Jun-2009  yamt sync with head
 1.68.4.1 04-May-2009  yamt sync with head.
 1.74.2.1 23-Jul-2009  jym Sync with HEAD.
 1.78.4.3 31-May-2011  rmind sync with head
 1.78.4.2 21-Apr-2011  rmind sync with head
 1.78.4.1 05-Mar-2011  rmind sync with head
 1.78.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.79.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.82.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.82.4.2 30-Oct-2012  yamt sync with head
 1.82.4.1 17-Apr-2012  yamt sync with head
 1.83.10.3 03-Dec-2017  jdolecek update from HEAD
 1.83.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.83.10.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.84.2.1 18-May-2014  rmind sync with head
 1.90.2.1 10-Aug-2014  tls Rebase.
 1.95.2.1 17-Apr-2017  snj regen for ticket 1354
 1.96.2.4 05-Feb-2017  skrll Sync with HEAD
 1.96.2.3 05-Oct-2016  skrll Sync with HEAD
 1.96.2.2 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.96.2.1 06-Apr-2015  skrll Sync with HEAD
 1.99.2.3 20-Mar-2017  pgoyette Sync with HEAD
 1.99.2.2 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.99.2.1 26-Jul-2016  pgoyette Sync with HEAD
 1.103.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.106.4.1 11-May-2017  pgoyette Sync with HEAD
 1.107.10.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.107.10.1 10-Jun-2019  christos Sync with HEAD
 1.107.8.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.111.2.2 17-Dec-2020  thorpej Regen for preadv(2) and pwritev(2).
 1.111.2.1 15-Dec-2020  thorpej Regen for eventfd, timerfd, POSIX timers.
 1.121.2.1 02-Aug-2025  perseant Sync with HEAD
 1.122 28-Sep-2024  christos regen
 1.121 01-Jul-2024  christos regen
 1.120 29-Jun-2024  christos branches: 1.120.2;
regen
 1.119 19-Aug-2023  christos regen
 1.118 18-Aug-2023  christos regen
 1.117 29-Jul-2023  christos regen
 1.116 28-Jul-2023  christos regen
 1.115 02-Dec-2021  ryo regen
 1.114 20-Sep-2021  thorpej Regen for preadv(2) / pwritev(2).
 1.113 20-Sep-2021  thorpej Regen for eventfd.
 1.112 19-Sep-2021  thorpej Regen for timerfd.
 1.111 19-Sep-2021  thorpej Regen for POSIX timer syscalls.
 1.110 26-Apr-2020  thorpej branches: 1.110.2;
Regen for native futex calls.
 1.109 09-Nov-2019  jdolecek regen
 1.108 24-Mar-2019  maxv regen
 1.107 10-Aug-2018  pgoyette Regen
 1.106 10-May-2017  riastradh branches: 1.106.8; 1.106.10;
regen
 1.105 03-Feb-2017  christos branches: 1.105.4;
regen
 1.104 03-Feb-2017  martin Regen for accept4
 1.103 16-Jan-2017  christos regen all
 1.102 13-Jan-2017  christos branches: 1.102.2;
regen
 1.101 02-Jan-2017  martin Regen (something apparently went wrong in previous)
 1.100 02-Jan-2017  manu Regen
 1.99 24-Jul-2016  njoly Regen for readlink/readlinkat signatures.
 1.98 25-Oct-2015  njoly branches: 1.98.2;
Regen for posix chown family cleanup.
 1.97 24-Sep-2015  christos regen
 1.96 07-Mar-2015  christos regen
 1.95 22-Nov-2014  njoly branches: 1.95.2;
Regen for ppoll signature fix
 1.94 29-May-2014  njoly branches: 1.94.2;
Regen for utimes(2) change.
 1.93 17-May-2014  njoly Regen for fadvise64 offset types changes.
 1.92 06-May-2014  njoly Regen for mknod device argument type change.
 1.91 04-May-2014  njoly Regen for pread/pwrite 64bit offset argument.
 1.90 08-Apr-2014  njoly Regen.
 1.89 13-Jan-2014  njoly branches: 1.89.2;
Regen.
 1.88 27-Dec-2013  njoly Regen.
 1.87 08-Dec-2013  njoly Regen.
 1.86 19-Nov-2013  chs regen
 1.85 24-Sep-2013  njoly Regen for utimensat(2).
 1.84 15-Sep-2013  njoly Regen.
 1.83 19-Sep-2012  pooka branches: 1.83.2;
regen for ppoll (and, apparently, SYCALL_ARG_PTR)
 1.82 18-Nov-2011  christos branches: 1.82.10;
- add sigtimedwait support.
- merge the siginfo population code.
 1.81 30-May-2011  alnsn branches: 1.81.4;
Regenerate files to pick up correct RCS Ids. Suggested by Chris Badura.
 1.80 30-May-2011  alnsn Add fadvise64 and fadvise64_64 syscalls to compat_linux and compat_linux32.
 1.79 15-Apr-2011  he Regenerate these files after adding pipe2() and dup3().
 1.78 07-Jul-2010  chs branches: 1.78.2;
regen
 1.77 14-Dec-2009  matt branches: 1.77.2; 1.77.4;
Regen (new makesyscalls.sh)
 1.76 24-Nov-2009  njoly Regen for personality(2) update.
 1.75 17-Jun-2009  njoly Regen for sendmsg/recvmsg definitions update.
 1.74 08-Jun-2009  njoly Regen for rt_queueinfo(2) update.
 1.73 17-Jan-2009  njoly branches: 1.73.2;
Regen for wait4 update.
 1.72 15-Jan-2009  njoly Rengen for compat50 update.
 1.71 13-Jan-2009  pooka Regen to prove I didn't screw up the conversion: purely RCSID changes.
 1.70 13-Jan-2009  pooka regen
 1.69 19-Nov-2008  ad Regen.
 1.68 12-Nov-2008  njoly Regen for nanosleep(2) fix.
 1.67 04-Apr-2008  njoly branches: 1.67.4; 1.67.6; 1.67.10; 1.67.12; 1.67.14;
Regen for linux_sys_msync removal.
 1.66 24-Dec-2007  njoly branches: 1.66.6;
Regen for linux_sys_getpgid removal.
 1.65 21-Dec-2007  njoly Regen for getfsuid/setfsgid syscall exchange.
 1.64 20-Dec-2007  dsl regen
 1.63 16-Nov-2007  njoly branches: 1.63.2; 1.63.6;
Regen, for syscalls cleanup.
 1.62 09-Feb-2007  ad branches: 1.62.18; 1.62.20; 1.62.24; 1.62.26;
Merge newlock2 to head.
 1.61 01-Sep-2006  matt branches: 1.61.2;
Regen.
 1.60 30-Aug-2006  matt Regen
 1.59 10-Jun-2006  christos regen
 1.58 11-Dec-2005  christos branches: 1.58.4; 1.58.8; 1.58.14;
merge ktrace-lwp.
 1.57 16-May-2005  fvdl branches: 1.57.2;
Regen.
 1.56 16-May-2005  fvdl Regen.
 1.55 26-Feb-2005  perry regen
 1.54 26-Feb-2005  perry regen
 1.53 05-Oct-2004  jdolecek branches: 1.53.4; 1.53.6;
regen: generate struct linux_sys_shmget_args for linux_sys_shmget(2)
 1.52 28-Sep-2004  jdolecek regen - now using wrapper for shmget(2)
 1.51 08-Sep-2004  jdolecek regen: add exit_group(2)
 1.50 01-Aug-2004  jdolecek regen - sync syscall lists with Linux kernel 2.6.7
 1.49 01-Aug-2004  jdolecek regen:

connect madvise(2) and mincore(2) - apparently the newer Linux libs
don't stub it anymore, so allow the application to take advantage
of them

the Linux calls appear to be compatible in the flag values and semantics,
so a wrapper is not necessary
 1.48 18-Jan-2003  thorpej branches: 1.48.2; 1.48.4;
Regen to get correct RCS ID.
 1.47 18-Jan-2003  thorpej Regen: Merge the nathanw_sa branch.
 1.46 10-Apr-2002  christos regen
 1.45 22-Mar-2002  christos regen.
 1.44 18-Feb-2002  christos regen
 1.43 18-Feb-2002  christos regen
 1.42 15-Feb-2002  christos - add a real linux_sys___sysctl because the mib numbers are different.
implement only the kernel version getting entries.
- make the signal conversion functions consistent; dest is arg 1.
- make linux_fakedev deal with block and char devices differently.
- add linux_sys_ugetrlimit, and flesh out the regular get/setrlimit so
that they work properly.
- add linux_mmap2 [untested].
- bump kernel to 2.4.18, and make the date be valentine's day :-)
- linux_sys_*stat64 family was totally busted. Fix it.

tested only on i386.

Status:
gdb, telnet, work
jdk-1.4.0 extractor works, jdk still coredumps.

christos
 1.41 13-Nov-2001  lukem add RCSIDs (including regeneration of files as appropriate)
 1.40 04-Jul-2001  jdolecek branches: 1.40.2;
Regen - modify to use linux_* wrappers for syscalls passing/fetching sockaddr
 1.39 30-May-2001  mrg use _KERNEL_OPT.
 1.38 30-Mar-2001  jdolecek regen - use linux_sys_nosys() instead sys_nosys()
 1.37 30-Mar-2001  jdolecek regen
 1.36 30-Mar-2001  jdolecek regen
 1.35 27-Jan-2001  thorpej branches: 1.35.2;
Regen; add sy_flags.
 1.34 29-Dec-2000  fvdl Regen.
 1.33 21-Dec-2000  thorpej Regen.
 1.32 14-Dec-2000  jdolecek regen
 1.31 14-Dec-2000  mycroft Regen.
 1.30 11-Dec-2000  mycroft Regen.
 1.29 11-Dec-2000  mycroft Regen.
 1.28 09-Dec-2000  jdolecek regen
 1.27 09-Dec-2000  mycroft Regen.
 1.26 02-Dec-2000  jdolecek regen after addition of linux_sys_swapoff()
 1.25 01-Dec-2000  jdolecek regen
 1.24 17-Nov-2000  erh Regen.
 1.23 08-Nov-2000  erh Update the names of some unimplemented syscalls to match what linux calls them. Match const in parameters to our sys_writev.
 1.22 01-Nov-2000  jdolecek regen
 1.21 18-Aug-2000  cgd update for changed makesyscalls.master
 1.20 18-Aug-2000  cgd update for new makesyscalls.sh, and also for correct ids for changed
syscalls.master files. (you need to regenerate after checking in
syscalls.master to get the correct ids.)
 1.19 20-Mar-2000  erh branches: 1.19.4;
Regen.
 1.18 18-Mar-2000  erh Regen.
 1.17 18-Mar-2000  erh Regen.
 1.16 18-Mar-2000  erh Regen.
 1.15 16-Dec-1999  tron Regen.
 1.14 05-Dec-1999  tron Regen.
 1.13 04-Oct-1999  tron branches: 1.13.2; 1.13.8;
Regen from "syscalls.master".
 1.12 14-May-1999  thorpej Regen.
 1.11 13-May-1999  thorpej Regen.
 1.10 30-Mar-1999  tron branches: 1.10.4;
Regen.
 1.9 27-Mar-1999  tron Regen.
 1.8 23-Mar-1999  thorpej Regen; pread(2) and pwrite(2).
 1.7 10-Dec-1998  christos Regen
 1.6 08-Dec-1998  erh Add mmap header.
 1.5 19-Oct-1998  tron Regen.
 1.4 07-Oct-1998  erh Regen.
 1.3 04-Oct-1998  fvdl Assign my copyright to TNF. Merge with others were appropriate.
Regen syscall files after script change.
 1.2 03-Oct-1998  christos Attempt to fix the mess.
 1.1 30-Sep-1998  erh Generate.
 1.10.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.13.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.13.2.7 21-Apr-2001  bouyer Sync with HEAD
 1.13.2.6 11-Feb-2001  bouyer Sync with HEAD.
 1.13.2.5 05-Jan-2001  bouyer Sync with HEAD
 1.13.2.4 13-Dec-2000  bouyer Sync with HEAD (for UBC fixes).
 1.13.2.3 08-Dec-2000  bouyer Sync with HEAD.
 1.13.2.2 22-Nov-2000  bouyer Sync with HEAD.
 1.13.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.19.4.2 01-May-2001  he Pull up regenerated files (requested by jdolecek):
Make it possible to use a different function for unimplemented
syscalls than sys_nosys(), so that the Linux emulation can avoid
posting SIGSYS and instead just return ENOSYS.
 1.19.4.1 30-Mar-2001  he Pull up regenerated files (requested by fvdl):
Add some required Linux emulation bits to support the Linux
version of VMware.
 1.35.2.9 29-May-2002  nathanw Regen.
 1.35.2.8 17-Apr-2002  nathanw Catch up to -current.
 1.35.2.7 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.35.2.6 28-Feb-2002  nathanw Catch up to -current.
 1.35.2.5 14-Nov-2001  nathanw Catch up to -current.
 1.35.2.4 30-Aug-2001  nathanw First cut at LWP and SA support on the alpha.
Doesn't break in ordinary multiuser mode; LWPs and SAs not yet tested.
 1.35.2.3 24-Aug-2001  nathanw Catch up with -current.
 1.35.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.35.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.40.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.40.2.2 16-Mar-2002  jdolecek Catch up with -current.
 1.40.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.48.4.2 08-Oct-2004  jmc Regen for ticket #884
 1.48.4.1 04-Oct-2004  jmc Regen
 1.48.2.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.48.2.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.48.2.4 19-Oct-2004  skrll Sync with HEAD
 1.48.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.48.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.48.2.1 03-Aug-2004  skrll Sync with HEAD
 1.53.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.53.4.1 29-Apr-2005  kent sync with -current
 1.57.2.5 21-Jan-2008  yamt sync with head
 1.57.2.4 07-Dec-2007  yamt sync with head
 1.57.2.3 26-Feb-2007  yamt sync with head.
 1.57.2.2 30-Dec-2006  yamt sync with head.
 1.57.2.1 21-Jun-2006  yamt sync with head.
 1.58.14.1 19-Jun-2006  chap Sync with head.
 1.58.8.2 03-Sep-2006  yamt sync with head.
 1.58.8.1 26-Jun-2006  yamt sync with head.
 1.58.4.1 09-Sep-2006  rpaulo sync with head
 1.61.2.1 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.62.26.2 27-Dec-2007  mjf Sync with HEAD.
 1.62.26.1 19-Nov-2007  mjf Sync with HEAD.
 1.62.24.1 18-Nov-2007  bouyer Sync with HEAD
 1.62.20.1 09-Jan-2008  matt sync with HEAD
 1.62.18.1 21-Nov-2007  joerg Sync with HEAD.
 1.63.6.1 02-Jan-2008  bouyer Sync with HEAD
 1.63.2.1 26-Dec-2007  ad Sync with head.
 1.66.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.66.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.67.14.1 20-Nov-2008  snj Regen for ticket 81.
 1.67.12.1 19-Jan-2009  skrll Sync with HEAD.
 1.67.10.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.67.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.67.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.67.4.4 11-Aug-2010  yamt sync with head.
 1.67.4.3 11-Mar-2010  yamt sync with head
 1.67.4.2 20-Jun-2009  yamt sync with head
 1.67.4.1 04-May-2009  yamt sync with head.
 1.73.2.1 23-Jul-2009  jym Sync with HEAD.
 1.77.4.3 31-May-2011  rmind sync with head
 1.77.4.2 21-Apr-2011  rmind sync with head
 1.77.4.1 05-Mar-2011  rmind sync with head
 1.77.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.78.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.81.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.81.4.2 30-Oct-2012  yamt sync with head
 1.81.4.1 17-Apr-2012  yamt sync with head
 1.82.10.3 03-Dec-2017  jdolecek update from HEAD
 1.82.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.82.10.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.83.2.1 18-May-2014  rmind sync with head
 1.89.2.1 10-Aug-2014  tls Rebase.
 1.94.2.1 17-Apr-2017  snj regen for ticket 1354
 1.95.2.4 05-Feb-2017  skrll Sync with HEAD
 1.95.2.3 05-Oct-2016  skrll Sync with HEAD
 1.95.2.2 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.95.2.1 06-Apr-2015  skrll Sync with HEAD
 1.98.2.3 20-Mar-2017  pgoyette Sync with HEAD
 1.98.2.2 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.98.2.1 26-Jul-2016  pgoyette Sync with HEAD
 1.102.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.105.4.1 11-May-2017  pgoyette Sync with HEAD
 1.106.10.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.106.10.1 10-Jun-2019  christos Sync with HEAD
 1.106.8.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.110.2.2 17-Dec-2020  thorpej Regen for preadv(2) and pwritev(2).
 1.110.2.1 15-Dec-2020  thorpej Regen for eventfd, timerfd, POSIX timers.
 1.120.2.1 02-Aug-2025  perseant Sync with HEAD
 1.4 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.3 26-Aug-2001  manu branches: 1.3.118; 1.3.120; 1.3.122;
Moved LINUX_NCCS from MI file to MD file, because the value is different
on MIPS and sparc machines.
 1.2 20-Jan-2001  manu branches: 1.2.2; 1.2.4;
Moved architecure dependent part of struct linux_termio to architecture
dependent header files.
 1.1 30-Sep-1998  erh branches: 1.1.12;
New header files for Linux compat on the Alpha.
 1.1.12.1 11-Feb-2001  bouyer Sync with HEAD.
 1.2.4.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.2.2.1 21-Sep-2001  nathanw Catch up to -current.
 1.3.122.1 16-May-2008  yamt sync with head.
 1.3.120.1 18-May-2008  yamt sync with head.
 1.3.118.1 02-Jun-2008  mjf Sync with HEAD.
 1.9 01-Oct-2024  riastradh sys/compat/linux/arch: Nix trailing whitespace.

No functional change intended.
 1.8 12-Feb-2023  andvar branches: 1.8.6;
fix typo in the include guard definition.
 1.7 27-Dec-2013  njoly Add struct linux_stat64 definition for alpha, and enable syscalls that
use it.
 1.6 11-Jan-2009  christos branches: 1.6.14; 1.6.24; 1.6.28;
merge christos-time_t
 1.5 28-Apr-2008  martin branches: 1.5.8; 1.5.14;
Remove clause 3 and 4 from TNF licenses
 1.4 11-Dec-2005  christos branches: 1.4.70; 1.4.72; 1.4.74;
merge ktrace-lwp.
 1.3 20-Sep-2004  jdolecek move definition of linux_fsid_t to common/linux_types.h - it's identical
across all Linux archs
 1.2 19-Sep-2004  jdolecek move definition of struct linux_stafs to common/linux_types.h, and use
explicit size types - the structure definition is actually identical
on currently support COMPAT_LINUX archs, so no point to have 6 copies of it
in the tree
 1.1 30-Sep-1998  erh branches: 1.1.46;
New header files for Linux compat on the Alpha.
 1.1.46.1 24-Sep-2004  skrll Sync with HEAD.
 1.4.74.2 04-May-2009  yamt sync with head.
 1.4.74.1 16-May-2008  yamt sync with head.
 1.4.72.1 18-May-2008  yamt sync with head.
 1.4.70.2 17-Jan-2009  mjf Sync with HEAD.
 1.4.70.1 02-Jun-2008  mjf Sync with HEAD.
 1.5.14.2 11-Jan-2009  christos add linux_suseconds_t
 1.5.14.1 28-Apr-2008  christos file linux_types.h was added on branch christos-time_t on 2009-01-11 00:17:51 +0000
 1.5.8.1 19-Jan-2009  skrll Sync with HEAD.
 1.6.28.1 18-May-2014  rmind sync with head
 1.6.24.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.6.14.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.8.6.1 02-Aug-2025  perseant Sync with HEAD
 1.4 28-Jul-2023  christos add epoll syscalls
 1.3 30-Mar-2001  jdolecek Use linux_sys_nosys() instead sys_nosys() here too.
 1.2 14-Dec-2000  mycroft branches: 1.2.2;
Round up sysent[] table size.
 1.1 30-Sep-1998  erh branches: 1.1.12; 1.1.22;
Initial support for linux compat on the alpha. Not quite working.
 1.1.22.1 01-May-2001  he Pull up revision 1.3 (via patch, requested by jdolecek):
Make it possible to use a different function for unimplemented
syscalls than sys_nosys(), so that the Linux emulation can avoid
posting SIGSYS and instead just return ENOSYS.
 1.1.12.2 21-Apr-2001  bouyer Sync with HEAD
 1.1.12.1 05-Jan-2001  bouyer Sync with HEAD
 1.2.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.109 28-Sep-2024  christos Linux GSoC-2024: renameat2, clone3, sync_file_range, syncfs (Shivraj Jamgade)
 1.108 01-Jul-2024  christos Add linux POSIX message queue support (Ricardo Branco)
 1.107 29-Jun-2024  christos branches: 1.107.2;
From gsoc 2024: Implement faccessat2 and getcpu (Shivraz)
 1.106 19-Aug-2023  christos Add inotify* syscalls GSoC 2023 (Theodore Preduta)
 1.105 18-Aug-2023  christos Add linux waitid(2) from GSoC 2023 (Theodore Preduta)
 1.104 29-Jul-2023  christos Add/fix statx, readahead, close_range. From GSoC 2023 by Theodore Preduta
 1.103 28-Jul-2023  christos add epoll syscalls
 1.102 02-Dec-2021  ryo add prlimit64(2) syscall to COMPAT_LINUX and COMPAT_LINUX32
 1.101 20-Sep-2021  thorpej Add preadv(2) and pwritev(2) system calls to COMPAT_LINUX and COMPAT_LINUX32.
 1.100 20-Sep-2021  thorpej Add the eventfd system calls to COMPAT_LINUX and COMPAT_LINUX32.
 1.99 19-Sep-2021  thorpej Add the timerfd syscalls to COMPAT_LINUX and COMPAT_LINUX32.
 1.98 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.97 26-Apr-2020  thorpej branches: 1.97.2;
Add a NetBSD native futex implementation, mostly written by riastradh@.
Map the COMPAT_LINUX futex calls to the native ones.
 1.96 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.95 24-Mar-2019  maxv Remove Alpha's compat_linux dependency on compat_osf1. Each function is
copied as-is from compat_osf1 with no functional change. Discussed on
tech-kern@, ok @thorpej.
 1.94 03-Feb-2017  christos branches: 1.94.14;
add send/recv mmsg and comment on the unimpl ones.
 1.93 03-Feb-2017  martin Add accept4 definitions
 1.92 02-Jan-2017  manu branches: 1.92.2;
Add pselect6 Linux system call.
This lets Matlab R2016A run on NetBSD/amd64
 1.91 24-Jul-2016  njoly Small cleanup. Adjust readlink/readlinkat signatures to reduce diffs with
native.
 1.90 25-Oct-2015  njoly branches: 1.90.2;
Cleanup posix chown family syscalls to match native (alpha, mips and
powerpc).
 1.89 22-Nov-2014  njoly branches: 1.89.2;
Fix ppoll signature (int ->u_int)
 1.88 29-May-2014  njoly branches: 1.88.2;
For utimes(2), use compat_50_sys_utimes() instead of local version.
 1.87 17-May-2014  njoly Fix fadvise64 syscalls to use 64bit offset types.
 1.86 06-May-2014  njoly Reduce diffs between archs; make mknod device argument unsigned.
 1.85 04-May-2014  njoly Fix pread/pwrite syscalls which need a 64bit offset argument.
 1.84 08-Apr-2014  njoly Adjust read/write/readv/writev signature to match native versions.
 1.83 13-Jan-2014  njoly branches: 1.83.2;
Cleanup, and reduce diffs between arches. Make alpha use
linux_sys_{get,set}timeofday like others.
 1.82 27-Dec-2013  njoly Add struct linux_stat64 definition for alpha, and enable syscalls that
use it.
 1.81 08-Dec-2013  njoly Sprinkle a few more linux_umode_t where appropriate.
Reduce diffs between archs.
 1.80 19-Nov-2013  chs add the *at() syscalls.
 1.79 24-Sep-2013  njoly Add utimensat(2) for compat linux.
 1.78 15-Sep-2013  njoly Make alpha use linux_sys_utimes() just like other archs.
 1.77 19-Sep-2012  pooka branches: 1.77.2;
emulate ppoll which is essentially our pollts
 1.76 18-Nov-2011  christos branches: 1.76.10;
add sigtimedwait
 1.75 09-Jul-2011  christos branches: 1.75.2;
the first argument of {g,s}etitimer() is int not u_int.
 1.74 30-May-2011  alnsn Add fadvise64 and fadvise64_64 syscalls to compat_linux and compat_linux32.
 1.73 15-Apr-2011  he Add dup3() and pipe2() for these archs as well.
 1.72 07-Jul-2010  chs branches: 1.72.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.71 24-Nov-2009  njoly branches: 1.71.2; 1.71.4;
Update personality(2) to match Linux definition where the argument is an
unsigned long.
 1.70 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.69 08-Jun-2009  njoly Update rt_queueinfo(2) definition, and kill a corresponding comment.
 1.68 17-Jan-2009  njoly branches: 1.68.2;
Convert linux/linux32 wait(4) to use a compat50 rusage structure.
 1.67 15-Jan-2009  njoly Update some syscalls/arguments to use the new compat50 equivalents.
 1.66 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.65 13-Jan-2009  pooka Somehow i doubt linux_sys_recvmsg() returns size_t. Make it ssize_t.
(XXX: the actual implementation returns int)
 1.64 19-Nov-2008  ad Make the emulations, exec formats, coredump, NFS, and the NFS server
into modules. By and large this commit:

- shuffles header files and ifdefs
- splits code out where necessary to be modular
- adds module glue for each of the components
- adds/replaces hooks for things that can be installed at runtime
 1.63 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.62 04-Apr-2008  njoly branches: 1.62.4; 1.62.6; 1.62.10; 1.62.12; 1.62.14;
Cleanup. Kill linux_sys_msync and use sys___msync13 instead.
No functional changes expected.
 1.61 24-Dec-2007  njoly branches: 1.61.6;
Kill unneeded linux_sys_getpgid and use native sys_getpgid instead.
 1.60 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.59 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.58 16-Nov-2007  njoly branches: 1.58.2; 1.58.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.57 04-Mar-2007  christos branches: 1.57.14; 1.57.16; 1.57.20; 1.57.22;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.56 09-Feb-2007  ad branches: 1.56.2;
Merge newlock2 to head.
 1.55 01-Sep-2006  matt branches: 1.55.2;
Don't conditionalize *sys_ptrace. The lack of sys_ptrace will be dealt
with differently.
 1.54 30-Aug-2006  matt Update to deal with options PTRACE
 1.53 10-Jun-2006  christos linux getpriority is off-by-20 so use our own function.
From PR/33671: Nicolas Joly
 1.52 11-Dec-2005  christos branches: 1.52.4; 1.52.8; 1.52.14;
merge ktrace-lwp.
 1.51 16-May-2005  fvdl branches: 1.51.2;
Add clock_* POSIX functions.
 1.50 16-May-2005  fvdl Add *xattr functions (they all return EOPNOTSUPP).
 1.49 26-Feb-2005  perry nuke trailing whitespace
 1.48 05-Oct-2004  jdolecek branches: 1.48.4; 1.48.6;
mark linux_sys_shmget() STD, so that appropriate struct linux_sys_shmget_args
would be defined for use by alpha linux_sysent.c
 1.47 28-Sep-2004  jdolecek add flag for shmget(2) to specify that later shmat(2) for the shared memory
segment should succeed even if the segment would be marked removed; use this
to implement the Linux-compatible semantics of shmat(2)

this fixes the old Linux VMware3 graphics problem with local display,
and possibly other local Linux X clients using MIT-SHM
 1.46 08-Sep-2004  jdolecek implement basic exit_group(2), which just terminates calling thread;
apparently not many apps use thread groups yet, at least not with default
SuSE 9.1 libraries, so this is enough for now
 1.45 01-Aug-2004  jdolecek add entries for #403, #404 (unused)
 1.44 01-Aug-2004  jdolecek sync the syscall lists with Linux kernel 2.6.7
 1.43 01-Aug-2004  jdolecek connect madvise(2) and mincore(2) - apparently the newer Linux libs
don't stub it anymore, so allow the application to take advantage
of them

the Linux calls appear to be compatible in the flag values and semantics,
so a wrapper is not necessary
 1.42 18-Jan-2003  thorpej branches: 1.42.2; 1.42.4;
Merge the nathanw_sa branch.
 1.41 10-Apr-2002  christos add getdents64
 1.40 22-Mar-2002  christos nuke mmap2, add mprotect
 1.39 18-Feb-2002  christos provide linux_sys_getrlimit and linux_sys_setrlimit
 1.38 18-Feb-2002  christos fix comment.
 1.37 15-Feb-2002  christos - add a real linux_sys___sysctl because the mib numbers are different.
implement only the kernel version getting entries.
- make the signal conversion functions consistent; dest is arg 1.
- make linux_fakedev deal with block and char devices differently.
- add linux_sys_ugetrlimit, and flesh out the regular get/setrlimit so
that they work properly.
- add linux_mmap2 [untested].
- bump kernel to 2.4.18, and make the date be valentine's day :-)
- linux_sys_*stat64 family was totally busted. Fix it.

tested only on i386.

Status:
gdb, telnet, work
jdk-1.4.0 extractor works, jdk still coredumps.

christos
 1.36 08-Sep-2001  manu Removed a hack to make PowerPC mmap work. This could have side effects on
alpha and i386. It has been tested and works on i386.
 1.35 04-Jul-2001  jdolecek branches: 1.35.2; 1.35.4;
modify to use linux_* wrappers for syscalls passing/fetching sockaddr
 1.34 30-May-2001  mrg use _KERNEL_OPT.
 1.33 30-Mar-2001  jdolecek Add new syscalls from Linux 2.4.3 to the lists. Not implemented ATM.
 1.32 30-Mar-2001  jdolecek Implement linux_sys_nosys() and use it instead of sys_nosys() for
unimplemented syscalls. Difference is that linux_sys_nosys() doesn't
post SIGSYS to the process. Linux doesn't do that and thus glibc (and
probably other Linux code) doesn't deal with SIGSYS, even through it
generally contains fallback code for ENOSYS case.

This also addresses port-i386/12503, though the issue was already discussed
earlier.
 1.31 29-Dec-2000  fvdl branches: 1.31.2;
Don't pass through link(2) directly, as we need to do altpath checks.
 1.30 21-Dec-2000  thorpej Make an Alpha kernel with COMPAT_LINUX compile again.
 1.29 14-Dec-2000  jdolecek add sysinfo()
 1.28 11-Dec-2000  mycroft getuid -> getuid_with_euid
getgid -> getgid_with_egid
 1.27 11-Dec-2000  mycroft getpid -> getpid_with_ppid
 1.26 09-Dec-2000  jdolecek add more unimplemented syscalls to list
 1.25 09-Dec-2000  mycroft Add the %% separators.
 1.24 02-Dec-2000  jdolecek add emulation of linux swapoff(2)
 1.23 01-Dec-2000  jdolecek replace compat_09_sys_setdomainname() with linux_sys_setdomainname(),
compat_12_sys_swapon() with linux_sys_swapon() - this is to drop dependency
on COMPAT_12/COMPAT_09
 1.22 17-Nov-2000  erh Make the linux compatibilty code work on the alpha. (horay!) (at last!)
Two main changes:
Create a linux_elf64_copyargs that uses the linux specific LinuxAuxInfo
structure. This is only used on the alpha. i386 and m68k use the
standard elf copyargs function.

Since linux's approach to binary compatibilty is to look as much
like osf1 as possible, add all the osf1 syscalls that we have
implemented to the linux syscall table. This includes get/setsysinfo,
ported from FreeBSD.

In order for linux compat to work you must have COMPAT_OSF1, COMPAT_43,
COMPAT_09, COMPAT_12 and COMPAT_13 on also.
 1.21 08-Nov-2000  erh Update the names of some unimplemented syscalls to match what linux calls them. Match const in parameters to our sys_writev.
 1.20 01-Nov-2000  jdolecek support mlockall(), munlockall() - they are same as respective NetBSD syscalls
 1.19 20-Mar-2000  erh branches: 1.19.4;
sys_clone isn't MD on linux.
 1.18 18-Mar-2000  erh Fix the msgrcv prototype.
 1.17 18-Mar-2000  erh Use the new linux_sys_reboot and linux_sys_connect.
 1.16 18-Mar-2000  erh resync NOARGS lines with their definitions in kern/syscalls.master. resync STD lines with what is expected in .c files. (especially wrt adding const). Add missing prototype for setfsuid. Fix ptrace prototype.
 1.15 16-Dec-1999  tron Add ptrace(2).
 1.14 05-Dec-1999  tron Fix incorrect system call number.
 1.13 05-Dec-1999  tron Add proper stub code to make emulation of Linux's pread(2) and pwrite(2)
work. Fixes PR kern/8945 by Dave Sainty.
 1.12 04-Oct-1999  tron branches: 1.12.2; 1.12.8;
Add emulation for scheduler related syscalls. Although they are dummies
even under Linux the posix thread library for "glibc2" requires them.
 1.11 14-May-1999  thorpej Emulate the Linux vfork(2) (which is like OSF/1 vfork(2) and NetBSD's
__vfork14(2)) and {get,set}resuid(2). Linux does not have {get,set}resgid(2)
on their Alpha port!
 1.10 13-May-1999  thorpej Emulate the Linux clone(2) system call.
 1.9 30-Mar-1999  tron branches: 1.9.4;
Add poll() emulation.
 1.8 27-Mar-1999  tron Add emulation for Linux "getcwd" syscall.
 1.7 23-Mar-1999  thorpej Add support for emulating the Linux pread(2) and pwrite(2) system calls;
just call the native NetBSD versions.

PR #7202, Jaromir Dolecek <dolecek@ics.muni.cz>.
 1.6 10-Dec-1998  christos defopt COMPAT_43
 1.5 08-Dec-1998  erh Add mmap header.
 1.4 19-Oct-1998  tron Defopt SYSVMSG, SYSVSEM and SYSVSHM.
 1.3 07-Oct-1998  erh Change sys_mmap to NOARGS. (args defined in linux_sys_mmap.h). Typo: siginfo_t->linux_siginfo_t.
 1.2 03-Oct-1998  christos Attempt to fix the mess.
 1.1 30-Sep-1998  erh Initial support for linux compat on the alpha. Not quite working.
 1.9.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.12.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.12.2.6 21-Apr-2001  bouyer Sync with HEAD
 1.12.2.5 05-Jan-2001  bouyer Sync with HEAD
 1.12.2.4 13-Dec-2000  bouyer Sync with HEAD (for UBC fixes).
 1.12.2.3 08-Dec-2000  bouyer Sync with HEAD.
 1.12.2.2 22-Nov-2000  bouyer Sync with HEAD.
 1.12.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.19.4.2 01-May-2001  he Pull up revision 1.32 (requested by jdolecek):
Make it possible to use a different function for unimplemented
syscalls than sys_nosys(), so that the Linux emulation can avoid
posting SIGSYS and instead just return ENOSYS.
 1.19.4.1 30-Mar-2001  he Pull up revision 1.31 (requested by fvdl):
Add some required Linux emulation bits to support the Linux
version of VMware.
 1.31.2.8 29-May-2002  nathanw #include <sys/sa.h> before <sys/syscallargs.h>, to provide sa_upcall_t
now that <sys/param.h> doesn't include <sys/sa.h>.

(Behold the Power of Ed)
 1.31.2.7 17-Apr-2002  nathanw Catch up to -current.
 1.31.2.6 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.31.2.5 28-Feb-2002  nathanw Catch up to -current.
 1.31.2.4 21-Sep-2001  nathanw Catch up to -current.
 1.31.2.3 24-Aug-2001  nathanw Catch up with -current.
 1.31.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.31.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.35.4.1 01-Oct-2001  fvdl Catch up with -current.
 1.35.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.35.2.2 16-Mar-2002  jdolecek Catch up with -current.
 1.35.2.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.42.4.2 08-Oct-2004  jmc Pullup rev 1.48 (requested by jdolecek in ticket #884)

Mmark linux_sys_shmget() STD, so that appropriate struct linux_sys_shmget_args
would be defined for use by alpha linux_sysent.c
 1.42.4.1 04-Oct-2004  jmc Pullup rev 1.47 (requested by jdolecek in ticket #884)

Fix linux handling of SysV-style shared memory. Fixed Linux VMware display
problems.
 1.42.2.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.42.2.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.42.2.4 19-Oct-2004  skrll Sync with HEAD
 1.42.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.42.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.42.2.1 03-Aug-2004  skrll Sync with HEAD
 1.48.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.48.4.1 29-Apr-2005  kent sync with -current
 1.51.2.5 21-Jan-2008  yamt sync with head
 1.51.2.4 07-Dec-2007  yamt sync with head
 1.51.2.3 03-Sep-2007  yamt sync with head.
 1.51.2.2 26-Feb-2007  yamt sync with head.
 1.51.2.1 21-Jun-2006  yamt sync with head.
 1.52.14.1 19-Jun-2006  chap Sync with head.
 1.52.8.1 26-Jun-2006  yamt sync with head.
 1.52.4.1 09-Sep-2006  rpaulo sync with head
 1.55.2.1 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.56.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.57.22.2 27-Dec-2007  mjf Sync with HEAD.
 1.57.22.1 19-Nov-2007  mjf Sync with HEAD.
 1.57.20.1 18-Nov-2007  bouyer Sync with HEAD
 1.57.16.1 09-Jan-2008  matt sync with HEAD
 1.57.14.1 21-Nov-2007  joerg Sync with HEAD.
 1.58.6.1 02-Jan-2008  bouyer Sync with HEAD
 1.58.2.1 26-Dec-2007  ad Sync with head.
 1.61.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.61.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.62.14.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.62.12.1 19-Jan-2009  skrll Sync with HEAD.
 1.62.10.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.62.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.62.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.62.4.4 11-Aug-2010  yamt sync with head.
 1.62.4.3 11-Mar-2010  yamt sync with head
 1.62.4.2 20-Jun-2009  yamt sync with head
 1.62.4.1 04-May-2009  yamt sync with head.
 1.68.2.1 23-Jul-2009  jym Sync with HEAD.
 1.71.4.3 31-May-2011  rmind sync with head
 1.71.4.2 21-Apr-2011  rmind sync with head
 1.71.4.1 05-Mar-2011  rmind sync with head
 1.71.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.72.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.75.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.75.2.2 30-Oct-2012  yamt sync with head
 1.75.2.1 17-Apr-2012  yamt sync with head
 1.76.10.3 03-Dec-2017  jdolecek update from HEAD
 1.76.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.76.10.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.77.2.1 18-May-2014  rmind sync with head
 1.83.2.1 10-Aug-2014  tls Rebase.
 1.88.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.89.2.3 05-Feb-2017  skrll Sync with HEAD
 1.89.2.2 05-Oct-2016  skrll Sync with HEAD
 1.89.2.1 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.90.2.3 20-Mar-2017  pgoyette Sync with HEAD
 1.90.2.2 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.90.2.1 26-Jul-2016  pgoyette Sync with HEAD
 1.92.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.94.14.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.94.14.1 10-Jun-2019  christos Sync with HEAD
 1.97.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.97.2.1 15-Dec-2020  thorpej Add Linux eventfd, timerfd, and POSIX timer calls.
 1.107.2.1 02-Aug-2025  perseant Sync with HEAD
 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.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.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.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.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.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.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
 1.3 29-May-2024  christos should not be using .include <> but .include "" here.
 1.2 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.1 14-Jan-2002  bjh21 branches: 1.1.2; 1.1.4; 1.1.158; 1.1.168; 1.1.174; 1.1.184;
Crude first cut at ARMLinux binary compatibility. Successfully runs
"/emul/linux/bin/echo hello, world", dynamically linked.
 1.1.184.1 10-Aug-2014  tls Rebase.
 1.1.174.1 18-May-2014  rmind sync with head
 1.1.168.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.158.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.1.4.2 28-Feb-2002  nathanw Catch up to -current.
 1.1.4.1 14-Jan-2002  nathanw file Makefile was added on branch nathanw_sa on 2002-02-28 04:12:46 +0000
 1.1.2.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.1.2.1 14-Jan-2002  jdolecek file Makefile was added on branch kqueue on 2002-02-11 20:09:28 +0000
 1.4 30-Aug-2006  matt Update to deal with options PTRACE
 1.3 31-Mar-2002  christos branches: 1.3.26; 1.3.40; 1.3.44;
bring the reverse signal mapping array into linux_signo.c
 1.2 23-Jan-2002  bjh21 branches: 1.2.2; 1.2.4;
Add support for the ARM-specific syscalls in ARMLinux. These are invoked
by SWI numbers above 0x9f0000, but we re-map them down to somewhere just
after the end of the usual syscall range, since NetBSD doesn't handle
sparse syscall arrays well.

The only syscall I've actually implemented in this range is cacheflush(),
which was previously being mapped to fork(), causing ... interesting results.
 1.1 14-Jan-2002  bjh21 Crude first cut at ARMLinux binary compatibility. Successfully runs
"/emul/linux/bin/echo hello, world", dynamically linked.
 1.2.4.3 17-Apr-2002  nathanw Catch up to -current.
 1.2.4.2 28-Feb-2002  nathanw Catch up to -current.
 1.2.4.1 23-Jan-2002  nathanw file files.linux_arm was added on branch nathanw_sa on 2002-02-28 04:12:46 +0000
 1.2.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.2.2.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.2.2.1 23-Jan-2002  jdolecek file files.linux_arm was added on branch kqueue on 2002-02-11 20:09:28 +0000
 1.3.44.1 03-Sep-2006  yamt sync with head.
 1.3.40.1 09-Sep-2006  rpaulo sync with head
 1.3.26.1 30-Dec-2006  yamt sync with head.
 1.14 12-Oct-2021  andvar fix various typos, mainly in comments.
 1.13 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.12 31-May-2011  njoly Fix path for fadvise64 files.
 1.11 30-May-2011  alnsn Add fadvise64 and fadvise64_64 syscalls to compat_linux and compat_linux32.
 1.10 07-Jul-2010  chs branches: 1.10.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.9 02-Mar-2010  pooka branches: 1.9.2;
Nuke fs_lfs.h included for unknown reasons (if there was a reason
other than "accident", i hereby declare that reason invalid)
 1.8 19-Nov-2008  ad branches: 1.8.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.7 02-Feb-2008  dsl branches: 1.7.6; 1.7.10; 1.7.12; 1.7.16; 1.7.18;
Extract the fcntl64() suppoort from linux_file64.c into linux_fcntl64.c
Unravel some of the knots that caused linux_file64.c to be compiled twice
for an amd64 kernel (once for linux and once for linux32) with different
parts being skipped each time.
 1.6 15-Jan-2008  njoly compat linux (and linux32) uid16 functions cleanup and fixes.

- Move uid16 functions to their own file linux_uid16.c, included by
needed archs (arm, i386 and m68k).
- Add new MI types linux_{u,g}id16_t.
- Add macros to handle linux_uid16_t and uid_t conversions.
- Add linux_sys_getres{uid,gid}16 syscalls, to fix an overflow with
bad sizes given to copyout when linux_sys_getres{uid,gid} are used.
- Update arm syscall table to use more uid16 functions.
 1.5 15-Aug-2007  ad branches: 1.5.2; 1.5.8; 1.5.14;
Changes to make ktrace LKM friendly and reduce ifdef KTRACE. Proposed
on tech-kern.
 1.4 09-Feb-2007  ad branches: 1.4.6; 1.4.14; 1.4.18;
Merge newlock2 to head.
 1.3 18-Jan-2003  thorpej branches: 1.3.18; 1.3.48;
Merge the nathanw_sa branch.
 1.2 17-Feb-2002  bjh21 branches: 1.2.2;
linux_sys_break() is marked OBSOL, so don't include it.
 1.1 14-Jan-2002  bjh21 branches: 1.1.2;
Crude first cut at ARMLinux binary compatibility. Successfully runs
"/emul/linux/bin/echo hello, world", dynamically linked.
 1.1.2.3 16-Mar-2002  jdolecek Catch up with -current.
 1.1.2.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.1.2.1 14-Jan-2002  jdolecek file linux_commons.c was added on branch kqueue on 2002-02-11 20:09:28 +0000
 1.2.2.3 29-May-2002  nathanw #include <sys/sa.h> before <sys/syscallargs.h>, to provide sa_upcall_t
now that <sys/param.h> doesn't include <sys/sa.h>.

(Behold the Power of Ed)
 1.2.2.2 28-Feb-2002  nathanw Catch up to -current.
 1.2.2.1 17-Feb-2002  nathanw file linux_commons.c was added on branch nathanw_sa on 2002-02-28 04:12:46 +0000
 1.3.48.1 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.3.18.4 04-Feb-2008  yamt sync with head.
 1.3.18.3 21-Jan-2008  yamt sync with head
 1.3.18.2 03-Sep-2007  yamt sync with head.
 1.3.18.1 26-Feb-2007  yamt sync with head.
 1.4.18.1 16-Aug-2007  jmcneill Sync with HEAD.
 1.4.14.1 03-Sep-2007  skrll Sync with HEAD.
 1.4.6.1 20-Aug-2007  ad Sync with HEAD.
 1.5.14.1 19-Jan-2008  bouyer Sync with HEAD
 1.5.8.1 18-Feb-2008  mjf Sync with HEAD.
 1.5.2.1 23-Mar-2008  matt sync with HEAD
 1.7.18.1 19-Jan-2009  skrll Sync with HEAD.
 1.7.16.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.7.12.2 14-May-2008  wrstuden Per discussion with ad, remove most of the #include <sys/sa.h> lines
as they were including sa.h just for the type(s) needed for syscallargs.h.

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

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

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

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

Also, kern_sa.c has received partial cleanup. There's still more
to do, though.
 1.7.10.3 11-Aug-2010  yamt sync with head.
 1.7.10.2 11-Mar-2010  yamt sync with head
 1.7.10.1 04-May-2009  yamt sync with head.
 1.7.6.1 17-Jan-2009  mjf Sync with HEAD.
 1.8.6.2 17-Aug-2010  uebayasi Sync with HEAD.
 1.8.6.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.9.2.3 12-Jun-2011  rmind sync with head
 1.9.2.2 31-May-2011  rmind sync with head
 1.9.2.1 05-Mar-2011  rmind sync with head
 1.10.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.7 17-Dec-2013  njoly 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.6 28-Apr-2008  martin branches: 1.6.34; 1.6.44; 1.6.50;
Remove clause 3 and 4 from TNF licenses
 1.5 11-Dec-2005  christos branches: 1.5.70; 1.5.72; 1.5.74;
merge ktrace-lwp.
 1.4 26-Feb-2005  perry nuke trailing whitespace
 1.3 17-Jan-2002  bjh21 branches: 1.3.2; 1.3.4; 1.3.20; 1.3.28; 1.3.30;
Fix unterminated #ifdef.
 1.2 17-Jan-2002  rjs Add extra error codes from Linux.
 1.1 14-Jan-2002  bjh21 Crude first cut at ARMLinux binary compatibility. Successfully runs
"/emul/linux/bin/echo hello, world", dynamically linked.
 1.3.30.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.3.28.1 29-Apr-2005  kent sync with -current
 1.3.20.1 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.3.4.2 28-Feb-2002  nathanw Catch up to -current.
 1.3.4.1 17-Jan-2002  nathanw file linux_errno.h was added on branch nathanw_sa on 2002-02-28 04:12:46 +0000
 1.3.2.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.3.2.1 17-Jan-2002  jdolecek file linux_errno.h was added on branch kqueue on 2002-02-11 20:09:30 +0000
 1.5.74.1 16-May-2008  yamt sync with head.
 1.5.72.1 18-May-2008  yamt sync with head.
 1.5.70.1 02-Jun-2008  mjf Sync with HEAD.
 1.6.50.1 18-May-2014  rmind sync with head
 1.6.44.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.6.34.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.12 26-Nov-2021  ryo The internal architecture name of golang is "arm" or "arm64", which has
different naming conventions from netbsd's machine[] or machine_arch[]
("earmv7", "aarch64", etc.) and cannot be used as is.
Instead, use define LINUX_GO_RT0_SIGNATURE_ARCH{32,64}.
 1.11 26-Nov-2021  ryo - LINUX_GO_RT0_SIGNATURE for compat_linux is no longer enabled by default.
it is now defined in each arch same as the other *_SIGNATURE definitions.
- add new LINUX32_GO_RT0_SIGNATURE for compat_linux32, and is defined in amd64 and aarch64.
 1.10 12-Feb-2017  chs es_arglen is now in units of bytes, update the emulations accordingly.
 1.9 09-Feb-2014  chs branches: 1.9.6; 1.9.10; 1.9.14;
account for the 16 bytes of AT_RANDOM data in the stack setup. fixes PR 48518.
use cprng_strong32() instead of random(). add AT_RANDOM support for linux32.
 1.8 28-Apr-2008  martin branches: 1.8.34; 1.8.44; 1.8.50;
Remove clause 3 and 4 from TNF licenses
 1.7 11-Dec-2005  christos branches: 1.7.70; 1.7.72; 1.7.74;
merge ktrace-lwp.
 1.6 14-Aug-2003  christos remove the args from the macro.
 1.5 08-Aug-2003  christos - GC all the setup_stack functions
- add one for linux/i386
 1.4 01-Mar-2003  thorpej branches: 1.4.2;
Do the syscall_plain/syscall_fancy dance on ARM. Shaves a fair number
of cycles off the syscall overhead.

Since all COMPAT_LINUX platforms now support __HAVE_SYSCALL_INTERN,
garbage-collect the LINUX_SYSCALL_FUNCTION stuff.
 1.3 13-Nov-2002  jdolecek add generic linux compat ELF copyargs function

this gives:
* linux sysconf(_SC_CLK_TCK) gives correct value for linux binaries (hz)
even if hz != 100
* glibc gets proper information on real/effective uid and enables
secure mode for suid binaries

g/c LINUX_COPYARGS_FUNCTION, replaced by linux ELF copyargs function
g/c alpha-specific linux ELF copyargs function and linux ELF defines
 1.2 17-Jan-2002  bjh21 branches: 1.2.2; 1.2.4;
On platforms that don't __HAVE_SYSCALL_INTERN, define LINUX_SYSCALL_FUNCTION
to be the value of emul_linux.e_syscall that we want. This allows it to differ
between machines, so I can have a separate linux_syscall() on arm.
 1.1 14-Jan-2002  bjh21 Crude first cut at ARMLinux binary compatibility. Successfully runs
"/emul/linux/bin/echo hello, world", dynamically linked.
 1.2.4.3 11-Dec-2002  thorpej Sync with HEAD.
 1.2.4.2 28-Feb-2002  nathanw Catch up to -current.
 1.2.4.1 17-Jan-2002  nathanw file linux_exec.h was added on branch nathanw_sa on 2002-02-28 04:12:46 +0000
 1.2.2.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.2.2.1 17-Jan-2002  jdolecek file linux_exec.h was added on branch kqueue on 2002-02-11 20:09:30 +0000
 1.4.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.4.2.1 03-Aug-2004  skrll Sync with HEAD
 1.7.74.1 16-May-2008  yamt sync with head.
 1.7.72.1 18-May-2008  yamt sync with head.
 1.7.70.1 02-Jun-2008  mjf Sync with HEAD.
 1.8.50.1 18-May-2014  rmind sync with head
 1.8.44.2 03-Dec-2017  jdolecek update from HEAD
 1.8.44.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.8.34.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.9.14.1 21-Apr-2017  bouyer Sync with HEAD
 1.9.10.1 20-Mar-2017  pgoyette Sync with HEAD
 1.9.6.1 28-Aug-2017  skrll Sync with HEAD
 1.5 25-Jun-2014  njoly 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 28-Apr-2008  martin branches: 1.2.20; 1.2.22;
Remove clause 3 and 4 from TNF licenses
 1.1 14-Jan-2002  bjh21 branches: 1.1.2; 1.1.4; 1.1.118; 1.1.120; 1.1.122;
Crude first cut at ARMLinux binary compatibility. Successfully runs
"/emul/linux/bin/echo hello, world", dynamically linked.
 1.1.122.2 09-Oct-2010  yamt sync with head
 1.1.122.1 16-May-2008  yamt sync with head.
 1.1.120.1 18-May-2008  yamt sync with head.
 1.1.118.1 02-Jun-2008  mjf Sync with HEAD.
 1.1.4.2 28-Feb-2002  nathanw Catch up to -current.
 1.1.4.1 14-Jan-2002  nathanw file linux_fcntl.h was added on branch nathanw_sa on 2002-02-28 04:12:46 +0000
 1.1.2.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.1.2.1 14-Jan-2002  jdolecek file linux_fcntl.h was added on branch kqueue on 2002-02-11 20:09:30 +0000
 1.2.22.1 05-Mar-2011  rmind sync with head
 1.2.20.2 06-Nov-2010  uebayasi Sync with HEAD.
 1.2.20.1 22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 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.2 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.1 14-Jan-2002  bjh21 branches: 1.1.2; 1.1.4; 1.1.118; 1.1.120; 1.1.122;
Crude first cut at ARMLinux binary compatibility. Successfully runs
"/emul/linux/bin/echo hello, world", dynamically linked.
 1.1.122.1 16-May-2008  yamt sync with head.
 1.1.120.1 18-May-2008  yamt sync with head.
 1.1.118.1 02-Jun-2008  mjf Sync with HEAD.
 1.1.4.2 28-Feb-2002  nathanw Catch up to -current.
 1.1.4.1 14-Jan-2002  nathanw file linux_ioctl.h was added on branch nathanw_sa on 2002-02-28 04:12:46 +0000
 1.1.2.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.1.2.1 14-Jan-2002  jdolecek file linux_ioctl.h was added on branch kqueue on 2002-02-11 20:09:30 +0000
 1.34 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.33 01-Feb-2021  skrll G/C some old code that was for acorn26
 1.32 09-Nov-2014  maxv branches: 1.32.12; 1.32.24; 1.32.32;
Do not uselessly include <sys/malloc.h>.
 1.31 18-Aug-2013  matt branches: 1.31.4;
Use <arm/locore.h>
 1.30 16-Aug-2012  matt branches: 1.30.2; 1.30.4;
Rename process_frame to lwp_trapframe
 1.29 07-Jul-2010  chs branches: 1.29.8; 1.29.16;
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.28 23-Nov-2009  rmind branches: 1.28.2; 1.28.4;
Use lwp_getpcb() in compat code, clean from struct user.
 1.27 28-Apr-2008  martin branches: 1.27.2;
Remove clause 3 and 4 from TNF licenses
 1.26 24-Apr-2008  ad branches: 1.26.2;
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.25 21-Dec-2007  matt branches: 1.25.6; 1.25.8;
Make this compile again.
 1.24 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.23 08-Dec-2007  dsl branches: 1.23.4;
ANSIfy most of the function definitions in sys/compat (but not ndis).
All by the magic of sed ...
 1.22 26-Mar-2007  hubertf branches: 1.22.8; 1.22.10; 1.22.18;
Remove duplicate #include <sys/param.h>,
and pull in the <sys/cdefs.h> needed for __KERNEL_RCSID

From: Slava Semushin <php-coder@altlinux.ru>
 1.21 04-Mar-2007  christos branches: 1.21.2; 1.21.4; 1.21.6;
fix caddr_t fallout.
 1.20 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.19 09-Feb-2007  ad branches: 1.19.2;
Merge newlock2 to head.
 1.18 23-Aug-2006  bjh21 branches: 1.18.2;
Use VALID_R15_PSR() to check the context we're restoring in
linux_sys_sigreturn(). Somehow this got missed when I introduced that macro.
 1.17 11-Dec-2005  christos branches: 1.17.4; 1.17.8;
merge ktrace-lwp.
 1.16 13-Sep-2005  christos need linux_syscallargs.h to compile, and remove inline function.
 1.15 20-May-2005  fvdl branches: 1.15.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.14 26-Feb-2005  perry nuke trailing whitespace
 1.13 10-Oct-2003  matt branches: 1.13.8; 1.13.10;
Adapt ARM Linux compat code to deal with SIGINFO.
 1.12 26-Sep-2003  simonb Fix "constify sendsig/trapsignal" fallout for non-siginfo'd archs. Test
compiled on most architectures.
 1.11 18-Jan-2003  thorpej branches: 1.11.2;
Merge the nathanw_sa branch.
 1.10 25-Sep-2002  thorpej Don't include <sys/map.h>.
 1.9 04-Jul-2002  thorpej Add kernel support for having userland provide the signal trampoline:

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

Changes to libc to use the new facility will be checked in later. Kernel
version not bumped; we will ride the 1.6C bump made recently.
 1.8 20-May-2002  jdolecek whitespace fixes
 1.7 31-Mar-2002  christos branches: 1.7.2;
make signal array handling uniform, and put signal arrays in a separate
file. This is simular to errno array handling.
 1.6 17-Feb-2002  bjh21 branches: 1.6.2;
Adapt for changes to limux_old_extra_to_native_sigset() and
native_to_linux_old_extra_sigset().
 1.5 17-Feb-2002  bjh21 linux_sys_rt_sigreturn is currently marked UNIMPL, so leave the stub out.
 1.4 15-Feb-2002  christos - add a real linux_sys___sysctl because the mib numbers are different.
implement only the kernel version getting entries.
- make the signal conversion functions consistent; dest is arg 1.
- make linux_fakedev deal with block and char devices differently.
- add linux_sys_ugetrlimit, and flesh out the regular get/setrlimit so
that they work properly.
- add linux_mmap2 [untested].
- bump kernel to 2.4.18, and make the date be valentine's day :-)
- linux_sys_*stat64 family was totally busted. Fix it.

tested only on i386.

Status:
gdb, telnet, work
jdk-1.4.0 extractor works, jdk still coredumps.

christos
 1.3 02-Feb-2002  bjh21 branches: 1.3.2;
We shouldn't need an icache sync when catching a signal, so don't bother.
 1.2 17-Jan-2002  bjh21 More-or-less working signal handling for Linux processes on ARM.
 1.1 14-Jan-2002  bjh21 Crude first cut at ARMLinux binary compatibility. Successfully runs
"/emul/linux/bin/echo hello, world", dynamically linked.
 1.3.2.6 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.3.2.5 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.3.2.4 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.3.2.3 16-Mar-2002  jdolecek Catch up with -current.
 1.3.2.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.3.2.1 02-Feb-2002  jdolecek file linux_machdep.c was added on branch kqueue on 2002-02-11 20:09:30 +0000
 1.6.2.9 18-Oct-2002  nathanw Catch up to -current.
 1.6.2.8 01-Aug-2002  nathanw Catch up to -current.
 1.6.2.7 24-Jun-2002  nathanw Curproc->curlwp renaming.

Change uses of "curproc->l_proc" back to "curproc", which is more like the
original use. Bare uses of "curproc" are now "curlwp".

"curproc" is now #defined in proc.h as ((curlwp) ? (curlwp)->l_proc) : NULL)
so that it is always safe to reference curproc (*de*referencing curproc
is another story, but that's always been true).
 1.6.2.6 20-Jun-2002  nathanw Catch up to -current.
 1.6.2.5 29-May-2002  nathanw #include <sys/sa.h> before <sys/syscallargs.h>, to provide sa_upcall_t
now that <sys/param.h> doesn't include <sys/sa.h>.

(Behold the Power of Ed)
 1.6.2.4 04-May-2002  thorpej LWP'ify.
 1.6.2.3 17-Apr-2002  nathanw Catch up to -current.
 1.6.2.2 28-Feb-2002  nathanw Catch up to -current.
 1.6.2.1 17-Feb-2002  nathanw file linux_machdep.c was added on branch nathanw_sa on 2002-02-28 04:12:46 +0000
 1.7.2.2 15-Jul-2002  gehenna catch up with -current.
 1.7.2.1 30-May-2002  gehenna Catch up with -current.
 1.11.2.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.11.2.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.11.2.4 27-Jan-2005  skrll Adapt to branch.
 1.11.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.11.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.11.2.1 03-Aug-2004  skrll Sync with HEAD
 1.13.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.13.8.1 29-Apr-2005  kent sync with -current
 1.15.2.5 21-Jan-2008  yamt sync with head
 1.15.2.4 03-Sep-2007  yamt sync with head.
 1.15.2.3 26-Feb-2007  yamt sync with head.
 1.15.2.2 30-Dec-2006  yamt sync with head.
 1.15.2.1 21-Jun-2006  yamt sync with head.
 1.17.8.1 03-Sep-2006  yamt sync with head.
 1.17.4.1 09-Sep-2006  rpaulo sync with head
 1.18.2.2 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.18.2.1 27-Jan-2007  ad More compat changes.
 1.19.2.2 15-Apr-2007  yamt sync with head.
 1.19.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.21.6.1 29-Mar-2007  reinoud Pullup to -current
 1.21.4.1 11-Jul-2007  mjf Sync with head.
 1.21.2.1 10-Apr-2007  ad Sync with head.
 1.22.18.1 26-Dec-2007  ad Sync with head.
 1.22.10.1 09-Jan-2008  matt sync with HEAD
 1.22.8.1 09-Dec-2007  jmcneill Sync with HEAD.
 1.23.4.1 02-Jan-2008  bouyer Sync with HEAD
 1.25.8.1 18-May-2008  yamt sync with head.
 1.25.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.26.2.3 11-Aug-2010  yamt sync with head.
 1.26.2.2 11-Mar-2010  yamt sync with head
 1.26.2.1 16-May-2008  yamt sync with head.
 1.27.2.3 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.27.2.2 14-May-2008  wrstuden Per discussion with ad, remove most of the #include <sys/sa.h> lines
as they were including sa.h just for the type(s) needed for syscallargs.h.

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

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

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

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

Also, kern_sa.c has received partial cleanup. There's still more
to do, though.
 1.28.4.1 05-Mar-2011  rmind sync with head
 1.28.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.29.16.1 29-Nov-2012  matt Sync with HEAD
 1.29.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.29.8.1 30-Oct-2012  yamt sync with head
 1.30.4.1 28-Aug-2013  rmind sync with head
 1.30.2.2 03-Dec-2017  jdolecek update from HEAD
 1.30.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.31.4.1 17-Jan-2015  martin Pull up following revision(s) (requested by maxv in ticket #427):
sys/compat/svr4/svr4_schedctl.c: revision 1.8
sys/netinet/tcp_timer.c: revision 1.88
sys/miscfs/genfs/layer_vfsops.c: revision 1.45
sys/compat/svr4/svr4_ioctl.c: revision 1.37
sys/ufs/chfs/chfs_vfsops.c: revision 1.14
sys/miscfs/fdesc/fdesc_vfsops.c: revision 1.91
sys/compat/linux/arch/i386/linux_ptrace.c: revision 1.30
sys/compat/common/kern_time_50.c: revision 1.28
sys/netinet6/ip6_forward.c: revision 1.74
sys/miscfs/umapfs/umap_vnops.c: revision 1.57
sys/compat/svr4/svr4_fcntl.c: revision 1.74
distrib/sets/lists/comp/mi: revision 1.1931
sys/netinet6/udp6_output.c: revision 1.46
sys/fs/puffs/puffs_compat.c: revision 1.3
sys/fs/udf/udf_rename.c: revision 1.11
sys/compat/svr4/svr4_filio.c: revision 1.24
sys/fs/udf/udf_rename.c: revision 1.12
sys/netinet/tcp_usrreq.c: revision 1.202
sys/miscfs/umapfs/umap_subr.c: revision 1.29
sys/compat/linux/common/linux_fadvise64.c: revision 1.3
sys/netinet/if_atm.c: revision 1.34
sys/miscfs/procfs/procfs_subr.c: revision 1.106
sys/miscfs/genfs/layer_subr.c: revision 1.37
sys/netinet/tcp_sack.c: revision 1.30
sys/compat/freebsd/freebsd_misc.c: revision 1.33
sys/compat/freebsd/freebsd_file.c: revision 1.33
sys/ufs/chfs/chfs_vnode.c: revision 1.12
sys/compat/svr4/svr4_ttold.c: revision 1.34
sys/compat/linux/common/linux_file.c: revision 1.114
sys/compat/linux/arch/mips/linux_machdep.c: revision 1.43
sys/compat/linux/common/linux_signal.c: revision 1.76
sys/compat/common/compat_util.c: revision 1.46
sys/compat/linux/arch/arm/linux_ptrace.c: revision 1.18
sys/compat/svr4/svr4_sockio.c: revision 1.36
sys/compat/linux/arch/arm/linux_machdep.c: revision 1.32
sys/compat/svr4/svr4_signal.c: revision 1.66
sys/kern/kern_exec.c: revision 1.410
sys/fs/puffs/puffs_vfsops.c: revision 1.115
sys/compat/svr4/svr4_exec_elf64.c: revision 1.15
sys/compat/linux/arch/i386/linux_machdep.c: revision 1.159
sys/compat/linux/arch/alpha/linux_machdep.c: revision 1.50
sys/compat/linux32/common/linux32_misc.c: revision 1.24
sys/netinet/in_pcb.c: revision 1.153
sys/sys/malloc.h: revision 1.116
sys/compat/common/if_43.c: revision 1.9
share/man/man9/Makefile: revision 1.380
sys/netinet/tcp_vtw.c: revision 1.12
sys/miscfs/umapfs/umap_vfsops.c: revision 1.95
sys/ufs/ext2fs/ext2fs_vfsops.c: revision 1.186
sys/compat/common/uipc_syscalls_43.c: revision 1.46
sys/ufs/ext2fs/ext2fs_vnops.c: revision 1.115
sys/fs/puffs/puffs_msgif.c: revision 1.97
sys/compat/svr4/svr4_ipc.c: revision 1.27
sys/compat/linux/common/linux_exec.c: revision 1.117
sys/ufs/ext2fs/ext2fs_readwrite.c: revision 1.66
sys/netinet/tcp_output.c: revision 1.179
sys/compat/svr4/svr4_termios.c: revision 1.28
sys/fs/udf/udf_strat_bootstrap.c: revision 1.4
sys/fs/puffs/puffs_subr.c: revision 1.67
sys/fs/puffs/puffs_node.c: revision 1.36
sys/miscfs/overlay/overlay_vnops.c: revision 1.21
sys/fs/cd9660/cd9660_node.c: revision 1.34
sys/netinet/raw_ip.c: revision 1.146
sys/sys/mallocvar.h: revision 1.13
sys/miscfs/overlay/overlay_vfsops.c: revision 1.63
share/man/man9/malloc.9: revision 1.50
sys/netinet6/dest6.c: revision 1.18
sys/compat/linux/common/linux_uselib.c: revision 1.33
sys/compat/linux/common/linux_socket.c: revision 1.120
share/man/man9/malloc.9: revision 1.51
sys/netinet/tcp_subr.c: revision 1.257
sys/compat/linux/common/linux_socketcall.c: revision 1.45
sys/compat/linux/common/linux_fadvise64_64.c: revision 1.3
sys/compat/freebsd/freebsd_ipc.c: revision 1.17
sys/compat/linux/common/linux_misc_notalpha.c: revision 1.109
sys/compat/linux/arch/alpha/linux_pipe.c: revision 1.17
sys/netinet6/in6_pcb.c: revision 1.132
sys/netinet6/in6_ifattach.c: revision 1.94
sys/compat/svr4/svr4_exec_elf32.c: revision 1.15
sys/miscfs/nullfs/null_vfsops.c: revision 1.90
sys/fs/cd9660/cd9660_util.c: revision 1.12
sys/compat/linux/arch/powerpc/linux_machdep.c: revision 1.48
sys/compat/freebsd/freebsd_exec_elf32.c: revision 1.20
sys/miscfs/procfs/procfs_vfsops.c: revision 1.94
sys/compat/linux/arch/powerpc/linux_ptrace.c: revision 1.28
sys/compat/linux/common/linux_sched.c: revision 1.67
sys/compat/linux/common/linux_exec_aout.c: revision 1.67
sys/compat/linux/common/linux_pipe.c: revision 1.67
sys/compat/linux/common/linux_llseek.c: revision 1.34
sys/compat/linux/arch/mips/linux_ptrace.c: revision 1.10
Do not uselessly include <sys/malloc.h>.
Cleanup:
- remove struct kmembuckets (dead)
- correctly deadify MALLOC_XX
- remove MALLOC_DEFINE_LIMIT and MALLOC_JUSTDEFINE_LIMIT (dead)
- remove malloc_roundup(), malloc_type_setlimit(), MALLOC_DEFINE_LIMIT()
and MALLOC_JUSTDEFINE_LIMIT() from man 9 malloc
New sentence, new line. Bump date for previous.
Obsolete malloc_roundup(9), malloc_type_setlimit(9) and MALLOC_DEFINE_LIMIT(9)
man pages.
 1.32.32.1 03-Apr-2021  thorpej Sync with HEAD.
 1.32.24.1 03-Aug-2022  martin Pull up following revision(s), all via patch
(requested by riastradh in ticket #1487):

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

sys/compat: Memset zero before copyout.

Just in case of uninitialized padding which would lead to kernel
stack disclosure. If the compiler can prove the memset redundant
then it can optimize it away; otherwise better safe than sorry.
 1.32.12.1 21-Jun-2023  martin Pull up following revision(s) (requested by riastradh in ticket #1836):

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

sys/compat: Memset zero before copyout.

Just in case of uninitialized padding which would lead to kernel
stack disclosure. If the compiler can prove the memset redundant
then it can optimize it away; otherwise better safe than sorry.
 1.6 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.5 04-Dec-2007  dsl branches: 1.5.12; 1.5.14; 1.5.16;
Remove all the __P
 1.4 01-Mar-2003  thorpej branches: 1.4.18; 1.4.74; 1.4.76; 1.4.82; 1.4.86;
Do the syscall_plain/syscall_fancy dance on ARM. Shaves a fair number
of cycles off the syscall overhead.

Since all COMPAT_LINUX platforms now support __HAVE_SYSCALL_INTERN,
garbage-collect the LINUX_SYSCALL_FUNCTION stuff.
 1.3 15-Feb-2002  christos branches: 1.3.2;
- add a real linux_sys___sysctl because the mib numbers are different.
implement only the kernel version getting entries.
- make the signal conversion functions consistent; dest is arg 1.
- make linux_fakedev deal with block and char devices differently.
- add linux_sys_ugetrlimit, and flesh out the regular get/setrlimit so
that they work properly.
- add linux_mmap2 [untested].
- bump kernel to 2.4.18, and make the date be valentine's day :-)
- linux_sys_*stat64 family was totally busted. Fix it.

tested only on i386.

Status:
gdb, telnet, work
jdk-1.4.0 extractor works, jdk still coredumps.

christos
 1.2 17-Jan-2002  bjh21 branches: 1.2.2;
More-or-less working signal handling for Linux processes on ARM.
 1.1 14-Jan-2002  bjh21 Crude first cut at ARMLinux binary compatibility. Successfully runs
"/emul/linux/bin/echo hello, world", dynamically linked.
 1.2.2.3 16-Mar-2002  jdolecek Catch up with -current.
 1.2.2.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.2.2.1 17-Jan-2002  jdolecek file linux_machdep.h was added on branch kqueue on 2002-02-11 20:09:30 +0000
 1.3.2.2 28-Feb-2002  nathanw Catch up to -current.
 1.3.2.1 15-Feb-2002  nathanw file linux_machdep.h was added on branch nathanw_sa on 2002-02-28 04:12:47 +0000
 1.4.86.1 08-Dec-2007  ad Sync with head.
 1.4.82.1 08-Dec-2007  mjf Sync with HEAD.
 1.4.76.1 09-Jan-2008  matt sync with HEAD
 1.4.74.1 09-Dec-2007  jmcneill Sync with HEAD.
 1.4.18.1 07-Dec-2007  yamt sync with head
 1.5.16.1 16-May-2008  yamt sync with head.
 1.5.14.1 18-May-2008  yamt sync with head.
 1.5.12.1 02-Jun-2008  mjf Sync with HEAD.
 1.5 14-Mar-2015  njoly Support Linux MAP_LOCKED mmap flag.
 1.4 28-Apr-2008  martin branches: 1.4.44; 1.4.64;
Remove clause 3 and 4 from TNF licenses
 1.3 11-Dec-2005  christos branches: 1.3.70; 1.3.72; 1.3.74;
merge ktrace-lwp.
 1.2 28-Aug-2004  jdolecek g/c LINUX_MAP_IGNMASK define - it's not used anywhere
 1.1 14-Jan-2002  bjh21 branches: 1.1.2; 1.1.4; 1.1.20;
Crude first cut at ARMLinux binary compatibility. Successfully runs
"/emul/linux/bin/echo hello, world", dynamically linked.
 1.1.20.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.20.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.20.1 03-Sep-2004  skrll Sync with HEAD
 1.1.4.2 28-Feb-2002  nathanw Catch up to -current.
 1.1.4.1 14-Jan-2002  nathanw file linux_mmap.h was added on branch nathanw_sa on 2002-02-28 04:12:47 +0000
 1.1.2.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.1.2.1 14-Jan-2002  jdolecek file linux_mmap.h was added on branch kqueue on 2002-02-11 20:09:30 +0000
 1.3.74.1 16-May-2008  yamt sync with head.
 1.3.72.1 18-May-2008  yamt sync with head.
 1.3.70.1 02-Jun-2008  mjf Sync with HEAD.
 1.4.64.1 06-Apr-2015  skrll Sync with HEAD
 1.4.44.1 03-Dec-2017  jdolecek update from HEAD
 1.23 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.22 23-May-2020  ad Move proc_lock into the data segment. It was dynamically allocated because
at the time we had mutex_obj_alloc() but not __cacheline_aligned.
 1.21 26-Jan-2018  christos branches: 1.21.8;
union was removed
 1.20 28-Aug-2017  kamil Remove the filesystem tracing feature

This is a legacy interface from 4.4BSD, and it was
introduced to overcome shortcomings of ptrace(2) at that time, which are
no longer relevant (performance). Today /proc/#/ctl offers a narrow
subset of ptrace(2) commands and is not applicable for modern
applications use beyond simplistic tracing scenarios.

This removal will simplify kernel internals. Users will still be able to
use all the other /proc files.

This change won't affect other procfs files neither Linux compat
features within mount_procfs(8). /proc/#/ctl isn't available on Linux.

Remove:
- /proc/#/ctl from mount_procfs(8)
- P_FSTRACE note from the documentation of ps(1)
- /proc/#/ctl and filesystem tracing documentation from mount_procfs(8)
- KAUTH_REQ_PROCESS_PROCFS_CTL documentation from kauth(9)
- source code file miscfs/procfs/procfs_ctl.c
- PFSctl and procfs_doctl() from sys/miscfs/procfs/procfs.h
- KAUTH_REQ_PROCESS_PROCFS_CTL from sys/sys/kauth.h
- PSL_FSTRACE (0x00010000) from sys/sys/proc.h
- P_FSTRACE (0x00010000) from sys/sys/sysctl.h

Reduce code complexity after removal of this functionality.

Update TODO.ptrace accordingly: remove two entries about /proc tracing.

Do not keep legacy notes as comments in the headers about removed
PSL_FSTRACE / P_FSTRACE, as this interface had little number of users
(close or equal to zero).

Proposed on tech-kern@.

All filesystem tracing utility users are encouraged to switch to ptrace(2).

Sponsored by <The NetBSD Foundation>
 1.19 13-Oct-2015  pgoyette branches: 1.19.10;
Don't release proc_lock until we're done looking at things that are
protected by the lock, particularly p_stat and p_waited. Found by
Robert Elz.

XXX Pullup to NetBSD-7, -6, -6-0, and -6-1
 1.18 09-Nov-2014  maxv branches: 1.18.2;
Do not uselessly include <sys/malloc.h>.
 1.17 04-Sep-2012  matt branches: 1.17.2; 1.17.14;
Add missing <machine/pcb.h> include
 1.16 07-Jul-2010  chs branches: 1.16.8; 1.16.14; 1.16.18; 1.16.20;
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.15 01-Jul-2010  rmind Remove pfind() and pgfind(), fix locking in various broken uses of these.
Rename real routines to proc_find() and pgrp_find(), remove PFIND_* flags
and have consistent behaviour. Provide proc_find_raw() for special cases.
Fix memory leak in sysctl_proc_corename().

COMPAT_LINUX: rework ptrace() locking, minimise differences between
different versions per-arch.

Note: while this change adds some formal cosmetics for COMPAT_DARWIN and
COMPAT_IRIX - locking there is utterly broken (for ages).

Fixes PR/43176.
 1.14 17-Dec-2008  cegger branches: 1.14.4; 1.14.6;
kill MALLOC and FREE macros.
 1.13 28-Apr-2008  martin branches: 1.13.2; 1.13.8;
Remove clause 3 and 4 from TNF licenses
 1.12 23-Apr-2008  ad branches: 1.12.2;
Disable bitrotted linux ptrace interfaces, which are likely now a
security hole. Can be re-enabled at runtime. If you want to repair
them please look at the native implementation.
 1.11 20-Dec-2007  dsl branches: 1.11.6; 1.11.8;
Convert all the system call entry points from:
int foo(struct lwp *l, void *v, register_t *retval)
to:
int foo(struct lwp *l, const struct foo_args *uap, register_t *retval)
Fixup compat code to not write into 'uap' and (in some cases) to actually
pass a correctly formatted 'uap' structure with the right name to the
next routine.
A few 'compat' routines that just call standard ones have been deleted.
All the 'compat' code compiles (along with the kernels required to test
build it).
98% done by automated scripts.
 1.10 08-Dec-2007  dsl branches: 1.10.4;
ANSIfy most of the function definitions in sys/compat (but not ndis).
All by the magic of sed ...
 1.9 04-Mar-2007  christos branches: 1.9.14; 1.9.16; 1.9.24;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.8 19-Feb-2007  ad Make this build.
 1.7 09-Feb-2007  ad branches: 1.7.2;
Merge newlock2 to head.
 1.6 01-Sep-2006  matt branches: 1.6.2;
When calling PTRACE from an LKM, use sysent[SYS_ptrace].sy_call in case
the sys_ptrace symbol isn't present.
 1.5 30-Aug-2006  matt Update to deal with options PTRACE
 1.4 06-Mar-2006  thorpej Remove SET/CLR/ISSET definitions.
 1.3 18-Jan-2003  thorpej branches: 1.3.18; 1.3.24; 1.3.32; 1.3.34; 1.3.36;
Merge the nathanw_sa branch.
 1.2 27-Jan-2002  bjh21 branches: 1.2.2; 1.2.4;
Add support for PTRACE_GETREGS and PTRACE_SETREGS in ARMLinux emulation.
 1.1 14-Jan-2002  bjh21 Crude first cut at ARMLinux binary compatibility. Successfully runs
"/emul/linux/bin/echo hello, world", dynamically linked.
 1.2.4.4 29-May-2002  nathanw #include <sys/sa.h> before <sys/syscallargs.h>, to provide sa_upcall_t
now that <sys/param.h> doesn't include <sys/sa.h>.

(Behold the Power of Ed)
 1.2.4.3 04-May-2002  thorpej LWP'ify.
 1.2.4.2 28-Feb-2002  nathanw Catch up to -current.
 1.2.4.1 27-Jan-2002  nathanw file linux_ptrace.c was added on branch nathanw_sa on 2002-02-28 04:12:47 +0000
 1.2.2.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.2.2.1 27-Jan-2002  jdolecek file linux_ptrace.c was added on branch kqueue on 2002-02-11 20:09:31 +0000
 1.3.36.1 13-Mar-2006  yamt sync with head.
 1.3.34.1 22-Apr-2006  simonb Sync with head.
 1.3.32.1 09-Sep-2006  rpaulo sync with head
 1.3.24.2 07-Mar-2006  he Sorry, committed on branch in error, so back out previous removal
of SET/CLR/ISSET.
 1.3.24.1 07-Mar-2006  he Remove another instance of the macro triplet SET/CLR/ISSET, now found
in <sys/types.h>.
 1.3.18.4 21-Jan-2008  yamt sync with head
 1.3.18.3 03-Sep-2007  yamt sync with head.
 1.3.18.2 26-Feb-2007  yamt sync with head.
 1.3.18.1 21-Jun-2006  yamt sync with head.
 1.6.2.1 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.7.2.2 12-Mar-2007  rmind Sync with HEAD.
 1.7.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.9.24.1 26-Dec-2007  ad Sync with head.
 1.9.16.1 09-Jan-2008  matt sync with HEAD
 1.9.14.1 09-Dec-2007  jmcneill Sync with HEAD.
 1.10.4.1 02-Jan-2008  bouyer Sync with HEAD
 1.11.8.1 18-May-2008  yamt sync with head.
 1.11.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.11.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.12.2.3 11-Aug-2010  yamt sync with head.
 1.12.2.2 04-May-2009  yamt sync with head.
 1.12.2.1 16-May-2008  yamt sync with head.
 1.13.8.1 19-Jan-2009  skrll Sync with HEAD.
 1.13.2.2 14-May-2008  wrstuden Per discussion with ad, remove most of the #include <sys/sa.h> lines
as they were including sa.h just for the type(s) needed for syscallargs.h.

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

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

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

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

Also, kern_sa.c has received partial cleanup. There's still more
to do, though.
 1.14.6.2 05-Mar-2011  rmind sync with head
 1.14.6.1 03-Jul-2010  rmind sync with head
 1.14.4.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.16.20.1 15-Nov-2015  bouyer Pull up following revision(s) (requested by pgoyette in ticket #1335):
sys/compat/linux/arch/i386/linux_ptrace.c: revision 1.31
sys/compat/linux/arch/arm/linux_ptrace.c: revision 1.19
sys/compat/linux/arch/powerpc/linux_ptrace.c: revision 1.29
Don't release proc_lock until we're done looking at things that are
protected by the lock, particularly p_stat and p_waited. Found by
Robert Elz.
XXX Pullup to NetBSD-7, -6, -6-0, and -6-1
 1.16.18.1 15-Nov-2015  bouyer Pull up following revision(s) (requested by pgoyette in ticket #1335):
sys/compat/linux/arch/i386/linux_ptrace.c: revision 1.31
sys/compat/linux/arch/arm/linux_ptrace.c: revision 1.19
sys/compat/linux/arch/powerpc/linux_ptrace.c: revision 1.29
Don't release proc_lock until we're done looking at things that are
protected by the lock, particularly p_stat and p_waited. Found by
Robert Elz.
XXX Pullup to NetBSD-7, -6, -6-0, and -6-1
 1.16.14.1 15-Nov-2015  bouyer Pull up following revision(s) (requested by pgoyette in ticket #1335):
sys/compat/linux/arch/i386/linux_ptrace.c: revision 1.31
sys/compat/linux/arch/arm/linux_ptrace.c: revision 1.19
sys/compat/linux/arch/powerpc/linux_ptrace.c: revision 1.29
Don't release proc_lock until we're done looking at things that are
protected by the lock, particularly p_stat and p_waited. Found by
Robert Elz.
XXX Pullup to NetBSD-7, -6, -6-0, and -6-1
 1.16.8.1 30-Oct-2012  yamt sync with head
 1.17.14.2 05-Nov-2015  snj Pull up following revision(s) (requested by pgoyette in ticket #998):
sys/compat/linux/arch/arm/linux_ptrace.c: revision 1.19
sys/compat/linux/arch/i386/linux_ptrace.c: revision 1.31
sys/compat/linux/arch/powerpc/linux_ptrace.c: revision 1.29
Don't release proc_lock until we're done looking at things that are
protected by the lock, particularly p_stat and p_waited. Found by
Robert Elz.
 1.17.14.1 17-Jan-2015  martin branches: 1.17.14.1.2;
Pull up following revision(s) (requested by maxv in ticket #427):
sys/compat/svr4/svr4_schedctl.c: revision 1.8
sys/netinet/tcp_timer.c: revision 1.88
sys/miscfs/genfs/layer_vfsops.c: revision 1.45
sys/compat/svr4/svr4_ioctl.c: revision 1.37
sys/ufs/chfs/chfs_vfsops.c: revision 1.14
sys/miscfs/fdesc/fdesc_vfsops.c: revision 1.91
sys/compat/linux/arch/i386/linux_ptrace.c: revision 1.30
sys/compat/common/kern_time_50.c: revision 1.28
sys/netinet6/ip6_forward.c: revision 1.74
sys/miscfs/umapfs/umap_vnops.c: revision 1.57
sys/compat/svr4/svr4_fcntl.c: revision 1.74
distrib/sets/lists/comp/mi: revision 1.1931
sys/netinet6/udp6_output.c: revision 1.46
sys/fs/puffs/puffs_compat.c: revision 1.3
sys/fs/udf/udf_rename.c: revision 1.11
sys/compat/svr4/svr4_filio.c: revision 1.24
sys/fs/udf/udf_rename.c: revision 1.12
sys/netinet/tcp_usrreq.c: revision 1.202
sys/miscfs/umapfs/umap_subr.c: revision 1.29
sys/compat/linux/common/linux_fadvise64.c: revision 1.3
sys/netinet/if_atm.c: revision 1.34
sys/miscfs/procfs/procfs_subr.c: revision 1.106
sys/miscfs/genfs/layer_subr.c: revision 1.37
sys/netinet/tcp_sack.c: revision 1.30
sys/compat/freebsd/freebsd_misc.c: revision 1.33
sys/compat/freebsd/freebsd_file.c: revision 1.33
sys/ufs/chfs/chfs_vnode.c: revision 1.12
sys/compat/svr4/svr4_ttold.c: revision 1.34
sys/compat/linux/common/linux_file.c: revision 1.114
sys/compat/linux/arch/mips/linux_machdep.c: revision 1.43
sys/compat/linux/common/linux_signal.c: revision 1.76
sys/compat/common/compat_util.c: revision 1.46
sys/compat/linux/arch/arm/linux_ptrace.c: revision 1.18
sys/compat/svr4/svr4_sockio.c: revision 1.36
sys/compat/linux/arch/arm/linux_machdep.c: revision 1.32
sys/compat/svr4/svr4_signal.c: revision 1.66
sys/kern/kern_exec.c: revision 1.410
sys/fs/puffs/puffs_vfsops.c: revision 1.115
sys/compat/svr4/svr4_exec_elf64.c: revision 1.15
sys/compat/linux/arch/i386/linux_machdep.c: revision 1.159
sys/compat/linux/arch/alpha/linux_machdep.c: revision 1.50
sys/compat/linux32/common/linux32_misc.c: revision 1.24
sys/netinet/in_pcb.c: revision 1.153
sys/sys/malloc.h: revision 1.116
sys/compat/common/if_43.c: revision 1.9
share/man/man9/Makefile: revision 1.380
sys/netinet/tcp_vtw.c: revision 1.12
sys/miscfs/umapfs/umap_vfsops.c: revision 1.95
sys/ufs/ext2fs/ext2fs_vfsops.c: revision 1.186
sys/compat/common/uipc_syscalls_43.c: revision 1.46
sys/ufs/ext2fs/ext2fs_vnops.c: revision 1.115
sys/fs/puffs/puffs_msgif.c: revision 1.97
sys/compat/svr4/svr4_ipc.c: revision 1.27
sys/compat/linux/common/linux_exec.c: revision 1.117
sys/ufs/ext2fs/ext2fs_readwrite.c: revision 1.66
sys/netinet/tcp_output.c: revision 1.179
sys/compat/svr4/svr4_termios.c: revision 1.28
sys/fs/udf/udf_strat_bootstrap.c: revision 1.4
sys/fs/puffs/puffs_subr.c: revision 1.67
sys/fs/puffs/puffs_node.c: revision 1.36
sys/miscfs/overlay/overlay_vnops.c: revision 1.21
sys/fs/cd9660/cd9660_node.c: revision 1.34
sys/netinet/raw_ip.c: revision 1.146
sys/sys/mallocvar.h: revision 1.13
sys/miscfs/overlay/overlay_vfsops.c: revision 1.63
share/man/man9/malloc.9: revision 1.50
sys/netinet6/dest6.c: revision 1.18
sys/compat/linux/common/linux_uselib.c: revision 1.33
sys/compat/linux/common/linux_socket.c: revision 1.120
share/man/man9/malloc.9: revision 1.51
sys/netinet/tcp_subr.c: revision 1.257
sys/compat/linux/common/linux_socketcall.c: revision 1.45
sys/compat/linux/common/linux_fadvise64_64.c: revision 1.3
sys/compat/freebsd/freebsd_ipc.c: revision 1.17
sys/compat/linux/common/linux_misc_notalpha.c: revision 1.109
sys/compat/linux/arch/alpha/linux_pipe.c: revision 1.17
sys/netinet6/in6_pcb.c: revision 1.132
sys/netinet6/in6_ifattach.c: revision 1.94
sys/compat/svr4/svr4_exec_elf32.c: revision 1.15
sys/miscfs/nullfs/null_vfsops.c: revision 1.90
sys/fs/cd9660/cd9660_util.c: revision 1.12
sys/compat/linux/arch/powerpc/linux_machdep.c: revision 1.48
sys/compat/freebsd/freebsd_exec_elf32.c: revision 1.20
sys/miscfs/procfs/procfs_vfsops.c: revision 1.94
sys/compat/linux/arch/powerpc/linux_ptrace.c: revision 1.28
sys/compat/linux/common/linux_sched.c: revision 1.67
sys/compat/linux/common/linux_exec_aout.c: revision 1.67
sys/compat/linux/common/linux_pipe.c: revision 1.67
sys/compat/linux/common/linux_llseek.c: revision 1.34
sys/compat/linux/arch/mips/linux_ptrace.c: revision 1.10
Do not uselessly include <sys/malloc.h>.
Cleanup:
- remove struct kmembuckets (dead)
- correctly deadify MALLOC_XX
- remove MALLOC_DEFINE_LIMIT and MALLOC_JUSTDEFINE_LIMIT (dead)
- remove malloc_roundup(), malloc_type_setlimit(), MALLOC_DEFINE_LIMIT()
and MALLOC_JUSTDEFINE_LIMIT() from man 9 malloc
New sentence, new line. Bump date for previous.
Obsolete malloc_roundup(9), malloc_type_setlimit(9) and MALLOC_DEFINE_LIMIT(9)
man pages.
 1.17.14.1.2.1 05-Nov-2015  snj Pull up following revision(s) (requested by pgoyette in ticket #998):
sys/compat/linux/arch/arm/linux_ptrace.c: revision 1.19
sys/compat/linux/arch/i386/linux_ptrace.c: revision 1.31
sys/compat/linux/arch/powerpc/linux_ptrace.c: revision 1.29
Don't release proc_lock until we're done looking at things that are
protected by the lock, particularly p_stat and p_waited. Found by
Robert Elz.
 1.17.2.1 03-Dec-2017  jdolecek update from HEAD
 1.18.2.1 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.19.10.2 21-Jun-2023  martin Pull up following revision(s) (requested by riastradh in ticket #1836):

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

sys/compat: Memset zero before copyout.

Just in case of uninitialized padding which would lead to kernel
stack disclosure. If the compiler can prove the memset redundant
then it can optimize it away; otherwise better safe than sorry.
 1.19.10.1 12-Apr-2018  martin Pull up following revision(s) (requested by kamil in ticket #713):

sys/modules/procfs/Makefile: revision 1.4
sys/miscfs/procfs/procfs_vfsops.c: revision 1.98
bin/ps/ps.1: revision 1.108
sys/compat/linux/arch/i386/linux_ptrace.c: revision 1.32
sys/miscfs/procfs/procfs_vnops.c: revision 1.198
sys/kern/sys_ptrace_common.c: revision 1.23
sys/kern/sys_ptrace_common.c: revision 1.24
sbin/mount_procfs/mount_procfs.8: revision 1.36
sys/kern/sys_ptrace_common.c: revision 1.25
sys/kern/sys_ptrace.c: revision 1.5
sys/compat/linux/arch/powerpc/linux_ptrace.c: revision 1.30
sys/sys/proc.h: revision 1.342
sys/kern/sys_ptrace_common.c: revision 1.26
sys/miscfs/procfs/procfs_ctl.c: file removal
sys/kern/sys_ptrace_common.c: revision 1.27
sys/miscfs/procfs/procfs_subr.c: revision 1.109
sys/kern/sys_ptrace_common.c: revision 1.28
sys/secmodel/extensions/secmodel_extensions.c: revision 1.8
sys/kern/sys_ptrace_common.c: revision 1.29
sys/sys/ptrace.h: revision 1.62
sys/compat/netbsd32/netbsd32_signal.c: revision 1.45
share/man/man9/kauth.9: revision 1.109
sys/miscfs/procfs/files.procfs: revision 1.12
sys/compat/netbsd32/netbsd32.h: revision 1.115
sys/miscfs/procfs/procfs.h: revision 1.72
sys/compat/netbsd32/netbsd32_ptrace.c: revision 1.5
sys/kern/kern_sig.c: revision 1.337
sys/sys/kauth.h: revision 1.75
sys/sys/sysctl.h: revision 1.224
sys/kern/sys_ptrace_common.c: revision 1.30
sys/kern/sys_ptrace_common.c: revision 1.31
sys/kern/sys_ptrace_common.c: revision 1.32
sys/kern/sys_ptrace_common.c: revision 1.33
sys/compat/linux/arch/arm/linux_ptrace.c: revision 1.20
sys/kern/sys_ptrace_common.c: revision 1.34
sys/kern/sys_ptrace_common.c: revision 1.36
sys/kern/kern_proc.c: revision 1.207
sys/kern/kern_exit.c: revision 1.269
doc/TODO.ptrace: revision 1.29

Make {s,g}et{db,fp,}regs work again for PK_32 processes
XXX: pullup-8

add disgusting magic to handle compat_netbsd32 as a module.

use process_*reg32 instead of struct *reg32.

Remove the filesystem tracing feature

This is a legacy interface from 4.4BSD, and it was
introduced to overcome shortcomings of ptrace(2) at that time, which are
no longer relevant (performance). Today /proc/#/ctl offers a narrow
subset of ptrace(2) commands and is not applicable for modern
applications use beyond simplistic tracing scenarios.

This removal will simplify kernel internals. Users will still be able to
use all the other /proc files.

This change won't affect other procfs files neither Linux compat
features within mount_procfs(8). /proc/#/ctl isn't available on Linux.

Remove:
- /proc/#/ctl from mount_procfs(8)
- P_FSTRACE note from the documentation of ps(1)
- /proc/#/ctl and filesystem tracing documentation from mount_procfs(8)
- KAUTH_REQ_PROCESS_PROCFS_CTL documentation from kauth(9)
- source code file miscfs/procfs/procfs_ctl.c
- PFSctl and procfs_doctl() from sys/miscfs/procfs/procfs.h
- KAUTH_REQ_PROCESS_PROCFS_CTL from sys/sys/kauth.h
- PSL_FSTRACE (0x00010000) from sys/sys/proc.h
- P_FSTRACE (0x00010000) from sys/sys/sysctl.h

Reduce code complexity after removal of this functionality.

Update TODO.ptrace accordingly: remove two entries about /proc tracing.

Do not keep legacy notes as comments in the headers about removed

PSL_FSTRACE / P_FSTRACE, as this interface had little number of users
(close or equal to zero).
Proposed on tech-kern@.

All filesystem tracing utility users are encouraged to switch to ptrace(2).

Sponsored by <The NetBSD Foundation>

untangle the mess:
- factor out common code
- break each ptrace subcall to its own sub-function
.. more to come ...
- reduce ifdef ugliness by moving it up top.
- factor out PT_IO and make PT_{READ,WRITE}_{I,D} use it
- factor out PT_DUMPCORE
- factor out sendsig code
.. more to come ...

handle siginfo requests for ptrace32

ptrace: Partially undo PT_{READ,WRITE}_{I,D} and unbreak these commands

The refactored code did not work and was generating EFAULT.

Sponsored by <The NetBSD Foundation>

Merge the code back; the problem was that since we are reading/writing
to a kernel address for PT_{READ,WRITE}_{I,D} we need the kernel vmspace.
provide separate read and write functions to accomodate register functions
that need a size argument.

don't ignore error from copyout_piod

Use the proper process (the tracee) to get information about lwps and
registers and the tracer for vmspace.

Add new sysctl(3) entry: security.models.extensions.user_set_dbregs

Model this new sysctl(3) entry after "user_set_cpu_affinity" in the same
level of sysctl(3) switches.

Allow to read unconditionally Debug Registers (no change here). This is
convenient as even if a user of a debugger does not use hardware assisted
watchpoints/breakpoints, a debugger can still prompt these values to store
in an internal cache with context of registers. Reading them should have
no security concerns.

Add a paranoid MI switch that prohibits by default setting these registers
by a regular user (non-superuser). Make this switch disabled by default.
There are enough reserved bits out there to allow using them
unconditionally on hardened hosts.

Features shipped with Debug Registers are optional features in debuggers.
There is no reduction in elementary functionality.

Reviewed by <christos>

Sponsored by <The NetBSD Foundation>
 1.21.8.1 03-Aug-2022  martin Pull up following revision(s), all via patch
(requested by riastradh in ticket #1487):

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

sys/compat: Memset zero before copyout.

Just in case of uninitialized padding which would lead to kernel
stack disclosure. If the compiler can prove the memset redundant
then it can optimize it away; otherwise better safe than sorry.
 1.4 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.3 31-Mar-2002  christos branches: 1.3.108; 1.3.110; 1.3.112;
bring the reverse signal mapping array into linux_signo.c
 1.2 31-Mar-2002  christos make signal array handling uniform, and put signal arrays in a separate
file. This is simular to errno array handling.
 1.1 14-Jan-2002  bjh21 branches: 1.1.2; 1.1.4;
Crude first cut at ARMLinux binary compatibility. Successfully runs
"/emul/linux/bin/echo hello, world", dynamically linked.
 1.1.4.3 17-Apr-2002  nathanw Catch up to -current.
 1.1.4.2 28-Feb-2002  nathanw Catch up to -current.
 1.1.4.1 14-Jan-2002  nathanw file linux_sigarray.c was added on branch nathanw_sa on 2002-02-28 04:12:47 +0000
 1.1.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.2.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.1.2.1 14-Jan-2002  jdolecek file linux_sigarray.c was added on branch kqueue on 2002-02-11 20:09:31 +0000
 1.3.112.1 16-May-2008  yamt sync with head.
 1.3.110.1 18-May-2008  yamt sync with head.
 1.3.108.1 02-Jun-2008  mjf Sync with HEAD.
 1.2 08-Jun-2009  njoly 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.1 14-Jan-2002  bjh21 branches: 1.1.2; 1.1.4; 1.1.122; 1.1.138;
Crude first cut at ARMLinux binary compatibility. Successfully runs
"/emul/linux/bin/echo hello, world", dynamically linked.
 1.1.138.1 23-Jul-2009  jym Sync with HEAD.
 1.1.122.1 20-Jun-2009  yamt sync with head
 1.1.4.2 28-Feb-2002  nathanw Catch up to -current.
 1.1.4.1 14-Jan-2002  nathanw file linux_siginfo.h was added on branch nathanw_sa on 2002-02-28 04:12:47 +0000
 1.1.2.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.1.2.1 14-Jan-2002  jdolecek file linux_siginfo.h was added on branch kqueue on 2002-02-11 20:09:31 +0000
 1.9 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.8 04-Dec-2007  dsl branches: 1.8.12; 1.8.14; 1.8.16;
Remove all the __P
 1.7 11-Dec-2005  christos branches: 1.7.44; 1.7.46; 1.7.52; 1.7.56;
merge ktrace-lwp.
 1.6 19-Sep-2005  christos MINSIGSTKSZ on linux is different depending on the platform and usually
smaller than ours.
 1.5 19-May-2005  manu branches: 1.5.2;
Add support for Linux SA_RESTORER on amd64.
 1.4 26-Nov-2002  christos branches: 1.4.6;
rename: s/sa_/<compat>sa/g
 1.3 19-Mar-2002  christos - Now that RT-signals fit, fix the array to deliver them. [i386 only].
- jdk-1.4 works perfectly now. :-)
 1.2 17-Feb-2002  bjh21 branches: 1.2.2;
Add LINUX_SA_NOCLDWAIT.
 1.1 14-Jan-2002  bjh21 branches: 1.1.2;
Crude first cut at ARMLinux binary compatibility. Successfully runs
"/emul/linux/bin/echo hello, world", dynamically linked.
 1.1.2.4 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.2.3 16-Mar-2002  jdolecek Catch up with -current.
 1.1.2.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.1.2.1 14-Jan-2002  jdolecek file linux_signal.h was added on branch kqueue on 2002-02-11 20:09:31 +0000
 1.2.2.4 11-Dec-2002  thorpej Sync with HEAD.
 1.2.2.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.2.2.2 28-Feb-2002  nathanw Catch up to -current.
 1.2.2.1 17-Feb-2002  nathanw file linux_signal.h was added on branch nathanw_sa on 2002-02-28 04:12:47 +0000
 1.4.6.1 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.5.2.2 07-Dec-2007  yamt sync with head
 1.5.2.1 21-Jun-2006  yamt sync with head.
 1.7.56.1 08-Dec-2007  ad Sync with head.
 1.7.52.1 08-Dec-2007  mjf Sync with HEAD.
 1.7.46.1 09-Jan-2008  matt sync with HEAD
 1.7.44.1 09-Dec-2007  jmcneill Sync with HEAD.
 1.8.16.1 16-May-2008  yamt sync with head.
 1.8.14.1 18-May-2008  yamt sync with head.
 1.8.12.1 02-Jun-2008  mjf Sync with HEAD.
 1.5 25-Jan-2014  njoly 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.4 28-Apr-2008  martin branches: 1.4.34; 1.4.44; 1.4.50;
Remove clause 3 and 4 from TNF licenses
 1.3 11-Dec-2005  christos branches: 1.3.70; 1.3.72; 1.3.74;
merge ktrace-lwp.
 1.2 26-Jul-2003  jdolecek add LINUX_SO_PEERNAME, LINUX_SO_TIMESTAMP where it has been missing
fix value for LINUX_SO_DETACH_FILTER on couple places (unused anyway)

g/c LINUX_SCM_TIMESTAMP definition for some archs, it will be defined
in generic linux_socket.h
 1.1 14-Jan-2002  bjh21 branches: 1.1.2; 1.1.4; 1.1.20;
Crude first cut at ARMLinux binary compatibility. Successfully runs
"/emul/linux/bin/echo hello, world", dynamically linked.
 1.1.20.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.20.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.20.1 03-Aug-2004  skrll Sync with HEAD
 1.1.4.2 28-Feb-2002  nathanw Catch up to -current.
 1.1.4.1 14-Jan-2002  nathanw file linux_socket.h was added on branch nathanw_sa on 2002-02-28 04:12:48 +0000
 1.1.2.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.1.2.1 14-Jan-2002  jdolecek file linux_socket.h was added on branch kqueue on 2002-02-11 20:09:31 +0000
 1.3.74.1 16-May-2008  yamt sync with head.
 1.3.72.1 18-May-2008  yamt sync with head.
 1.3.70.1 02-Jun-2008  mjf Sync with HEAD.
 1.4.50.1 18-May-2014  rmind sync with head
 1.4.44.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.4.34.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.15 24-Jan-2018  skrll Remove port-acorn26

OK core@
 1.14 07-Jul-2010  chs many changes for COMPAT_LINUX:
- update the linux syscall table for each platform.
- support new-style (NPTL) linux pthreads on all platforms.
clone() with CLONE_THREAD uses 1 process with many LWPs
instead of separate processes.
- move the contents of sys__lwp_setprivate() into a new
lwp_setprivate() and use that everywhere.
- update linux_release[] and linux32_release[] to "2.6.18".
- adjust placement of emul fork/exec/exit hooks as needed
and adjust other emul code to match.
- convert all struct emul definitions to use named initializers.
- change the pid allocator to allow multiple pids to refer to the same proc.
- remove a few fields from struct proc that are no longer needed.
- disable the non-functional "vdso" code in linux32/amd64,
glibc works fine without it.
- fix a race in the futex code where we could miss a wakeup after
a requeue operation.
- redo futex locking to be a little more efficient.
 1.13 20-Dec-2007  dsl branches: 1.13.10; 1.13.30; 1.13.32;
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.12 11-May-2006  yamt branches: 1.12.34; 1.12.44; 1.12.48;
cleanup user.h.
- remove several #include which are not directly related to
this header anymore. tweak *.c accordingly.
- update comments.
- move some !_KERNEL #include to proc.h because it's more appropriate
place these days.
- whitespace.
 1.11 11-Dec-2005  christos branches: 1.11.4; 1.11.6; 1.11.8; 1.11.10; 1.11.12;
merge ktrace-lwp.
 1.10 26-Feb-2005  perry branches: 1.10.4;
nuke trailing whitespace
 1.9 10-Oct-2003  matt branches: 1.9.8; 1.9.10;
Adapt ARM Linux compat code to deal with SIGINFO.
 1.8 18-Jan-2003  thorpej branches: 1.8.2;
Merge the nathanw_sa branch.
 1.7 24-Mar-2002  bjh21 arm26->acorn26 transition.
 1.6 10-Mar-2002  bjh21 __RCSID -> __KERNEL_RCSID
 1.5 10-Mar-2002  bjh21 Id -> NetBSD in RCSID (oops).
 1.4 02-Feb-2002  bjh21 branches: 1.4.2; 1.4.4;
cpu_cache_syncI_rng -> cpu_icache_sync_range
 1.3 02-Feb-2002  bjh21 Get rid of "unused variable" warnings on arm26.
 1.2 27-Jan-2002  bjh21 Add support for breakpoints to ARMLinux emulation.
 1.1 23-Jan-2002  bjh21 Add support for the ARM-specific syscalls in ARMLinux. These are invoked
by SWI numbers above 0x9f0000, but we re-map them down to somewhere just
after the end of the usual syscall range, since NetBSD doesn't handle
sparse syscall arrays well.

The only syscall I've actually implemented in this range is cacheflush(),
which was previously being mapped to fork(), causing ... interesting results.
 1.4.4.4 04-May-2002  thorpej LWP'ify.
 1.4.4.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.4.4.2 28-Feb-2002  nathanw Catch up to -current.
 1.4.4.1 02-Feb-2002  nathanw file linux_sys_machdep.c was added on branch nathanw_sa on 2002-02-28 04:12:48 +0000
 1.4.2.4 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.4.2.3 16-Mar-2002  jdolecek Catch up with -current.
 1.4.2.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.4.2.1 02-Feb-2002  jdolecek file linux_sys_machdep.c was added on branch kqueue on 2002-02-11 20:09:31 +0000
 1.8.2.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.8.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.8.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.8.2.1 03-Aug-2004  skrll Sync with HEAD
 1.9.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.9.8.1 29-Apr-2005  kent sync with -current
 1.10.4.2 21-Jan-2008  yamt sync with head
 1.10.4.1 21-Jun-2006  yamt sync with head.
 1.11.12.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.11.10.1 11-May-2006  elad sync with head
 1.11.8.1 24-May-2006  yamt sync with head.
 1.11.6.1 01-Jun-2006  kardel Sync with head.
 1.11.4.1 09-Sep-2006  rpaulo sync with head
 1.12.48.1 02-Jan-2008  bouyer Sync with HEAD
 1.12.44.1 26-Dec-2007  ad Sync with head.
 1.12.34.1 09-Jan-2008  matt sync with HEAD
 1.13.32.1 05-Mar-2011  rmind sync with head
 1.13.30.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.13.10.1 11-Aug-2010  yamt sync with head.
 1.95 28-Sep-2024  christos regen
 1.94 01-Jul-2024  christos regen
 1.93 29-Jun-2024  christos branches: 1.93.2;
regen
 1.92 19-Aug-2023  christos regen
 1.91 18-Aug-2023  christos regen
 1.90 29-Jul-2023  christos regen
 1.89 28-Jul-2023  christos regen
 1.88 02-Dec-2021  ryo regen
 1.87 24-Nov-2021  ryo regen
 1.86 20-Sep-2021  thorpej Regen for preadv(2) / pwritev(2).
 1.85 20-Sep-2021  thorpej Regen for eventfd.
 1.84 19-Sep-2021  thorpej Regen for timerfd.
 1.83 19-Sep-2021  thorpej Regen for POSIX timer syscalls.
 1.82 26-Apr-2020  thorpej branches: 1.82.2;
Regen for native futex calls.
 1.81 09-Nov-2019  jdolecek regen
 1.80 10-Aug-2018  pgoyette Regen
 1.79 10-May-2017  riastradh branches: 1.79.8; 1.79.10;
regen
 1.78 03-Feb-2017  christos branches: 1.78.4;
regen
 1.77 03-Feb-2017  martin Regen for accept4
 1.76 16-Jan-2017  christos regen all
 1.75 15-Jan-2017  christos branches: 1.75.2;
regen
 1.74 15-Jan-2017  christos regen
 1.73 15-Jan-2017  christos regen
 1.72 13-Jan-2017  christos regen
 1.71 02-Jan-2017  martin Regen (something apparently went wrong in previous)
 1.70 02-Jan-2017  manu Regen
 1.69 24-Jul-2016  njoly Regen for readlink/readlinkat signatures.
 1.68 23-Mar-2015  ozaki-r branches: 1.68.2;
Regen
 1.67 23-Mar-2015  ozaki-r Regen
 1.66 07-Mar-2015  christos regen
 1.65 22-Nov-2014  njoly branches: 1.65.2;
Regen for ppoll signature fix
 1.64 31-May-2014  njoly branches: 1.64.2;
Regen for munmap(2) signature.
 1.63 29-May-2014  njoly Regen for utimes(2) change.
 1.62 20-May-2014  njoly Regen for getgroups/setgroups update.
 1.61 17-May-2014  njoly Regen for fadvise64 offset types changes.
 1.60 06-May-2014  njoly Regen for mknod device argument type change.
 1.59 04-May-2014  njoly Regen for pread/pwrite 64bit offset argument.
 1.58 08-Apr-2014  njoly Regen.
 1.57 08-Dec-2013  njoly branches: 1.57.2;
Regen.
 1.56 19-Nov-2013  chs regen
 1.55 07-Nov-2013  njoly Regen for dup/dup2/dup3 argument types fix.
 1.54 24-Sep-2013  njoly Regen for utimensat(2).
 1.53 08-Apr-2013  pooka branches: 1.53.4;
regen for utimes
 1.52 19-Sep-2012  pooka regen for ppoll (and, apparently, SYCALL_ARG_PTR)
 1.51 18-Nov-2011  christos branches: 1.51.10;
- add sigtimedwait support.
- merge the siginfo population code.
 1.50 30-May-2011  alnsn branches: 1.50.4;
Regenerate files to pick up correct RCS Ids. Suggested by Chris Badura.
 1.49 30-May-2011  alnsn Add fadvise64 and fadvise64_64 syscalls to compat_linux and compat_linux32.
 1.48 15-Apr-2011  he Regenerate these files after adding pipe2() and dup3().
 1.47 07-Jul-2010  chs branches: 1.47.2;
regen
 1.46 14-Dec-2009  matt branches: 1.46.2; 1.46.4;
Regen (new makesyscalls.sh)
 1.45 24-Nov-2009  njoly Regen for personality(2) update.
 1.44 08-Jun-2009  njoly Regen for rt_queueinfo(2) update.
 1.43 17-Jan-2009  njoly branches: 1.43.2;
Regen for wait4 update.
 1.42 15-Jan-2009  njoly Rengen for compat50 update.
 1.41 13-Jan-2009  pooka Regen to prove I didn't screw up the conversion: purely RCSID changes.
 1.40 13-Jan-2009  rtr actually commit syscalls.master this time
add back blank line between #include <sys/.. and #include <sys/compat/..
regen
 1.39 12-Jan-2009  rtr regen for christos_time_t merge
 1.38 19-Nov-2008  ad Regen.
 1.37 12-Nov-2008  njoly Regen for nanosleep(2) fix.
 1.36 23-Apr-2008  ad branches: 1.36.2; 1.36.4; 1.36.8; 1.36.10; 1.36.12;
Regen.
 1.35 04-Apr-2008  njoly branches: 1.35.2;
Regen for linux_sys_msync removal.
 1.34 15-Jan-2008  njoly branches: 1.34.6;
Regen.
 1.33 24-Dec-2007  njoly Regen for linux_sys_getpgid removal.
 1.32 21-Dec-2007  njoly Regen for getfsuid/setfsgid syscall exchange.
 1.31 20-Dec-2007  dsl regen
 1.30 16-Nov-2007  njoly branches: 1.30.2; 1.30.6;
Regen, for syscalls cleanup.
 1.29 04-Mar-2007  christos branches: 1.29.14; 1.29.16; 1.29.20; 1.29.22;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.28 01-Sep-2006  matt branches: 1.28.8;
Regen.
 1.27 30-Aug-2006  matt Regen
 1.26 10-Jun-2006  christos regen
 1.25 11-Dec-2005  christos branches: 1.25.4; 1.25.8; 1.25.14;
merge ktrace-lwp.
 1.24 16-May-2005  fvdl branches: 1.24.2;
Regen.
 1.23 16-May-2005  fvdl Regen.
 1.22 26-Feb-2005  perry regen
 1.21 26-Feb-2005  perry regen
 1.20 20-Sep-2004  jdolecek branches: 1.20.4; 1.20.6;
regen:
implement support for Linux statfs64() syscall - 64bit variant of statfs()
 1.19 08-Sep-2004  jdolecek regen: add exit_group(2)
 1.18 01-Aug-2004  jdolecek regen:

add stub entries for syscalls added until Linux kernel 2.6.7

move the ARM-specific syscall range up to offset 0x180, to make room
for the new syscalls
 1.17 01-Aug-2004  jdolecek regen:

connect madvise(2) and mincore(2) - apparently the newer Linux libs
don't stub it anymore, so allow the application to take advantage
of them

the Linux calls appear to be compatible in the flag values and semantics,
so a wrapper is not necessary
 1.16 10-Aug-2003  jdolecek regen - added wrapper for Linux ftruncate64()
 1.15 28-Jun-2003  he branches: 1.15.2;
Regenerate after adding include of linux_mmap.h.
 1.14 23-Jun-2003  christos Regen.
 1.13 18-Jan-2003  thorpej Regen to get correct RCS IDs.
 1.12 18-Jan-2003  thorpej Regen: Merge the nathanw_sa branch.
 1.11 12-May-2002  jdolecek branches: 1.11.4;
regen - hook linux_sys_fcntl64()
 1.10 10-Apr-2002  christos regen
 1.9 22-Mar-2002  christos regen
 1.8 17-Feb-2002  bjh21 branches: 1.8.2;
Regen.
 1.7 15-Feb-2002  christos - add a real linux_sys___sysctl because the mib numbers are different.
implement only the kernel version getting entries.
- make the signal conversion functions consistent; dest is arg 1.
- make linux_fakedev deal with block and char devices differently.
- add linux_sys_ugetrlimit, and flesh out the regular get/setrlimit so
that they work properly.
- add linux_mmap2 [untested].
- bump kernel to 2.4.18, and make the date be valentine's day :-)
- linux_sys_*stat64 family was totally busted. Fix it.

tested only on i386.

Status:
gdb, telnet, work
jdk-1.4.0 extractor works, jdk still coredumps.

christos
 1.6 27-Jan-2002  bjh21 branches: 1.6.2;
Regen (breakpoint() implemented).
 1.5 27-Jan-2002  bjh21 Regen (prototype for linux_sys_nosys()).
 1.4 23-Jan-2002  bjh21 Regen (sys_nosys -> linux_sys_nosys).
 1.3 23-Jan-2002  bjh21 Regen (cacheflush() and remove syscall 0).
 1.2 15-Jan-2002  bjh21 Regen.
 1.1 14-Jan-2002  bjh21 Generated files for ARMLinux binary compatibility.
 1.6.2.4 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.6.2.3 16-Mar-2002  jdolecek Catch up with -current.
 1.6.2.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.6.2.1 27-Jan-2002  jdolecek file linux_syscall.h was added on branch kqueue on 2002-02-11 20:09:31 +0000
 1.8.2.7 20-Jun-2002  nathanw Catch up to -current.
 1.8.2.6 29-May-2002  nathanw Regen.
 1.8.2.5 04-May-2002  thorpej Regen.
 1.8.2.4 17-Apr-2002  nathanw Catch up to -current.
 1.8.2.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.8.2.2 28-Feb-2002  nathanw Catch up to -current.
 1.8.2.1 17-Feb-2002  nathanw file linux_syscall.h was added on branch nathanw_sa on 2002-02-28 04:12:48 +0000
 1.11.4.4 14-Jun-2004  jmc Regen for changes in ticket #1708
 1.11.4.3 11-May-2004  tron Regen for ticket 1686.
 1.11.4.2 20-Nov-2003  jmc Regen after fix in syscalls.master from ticket #1427.
 1.11.4.1 22-Oct-2003  jmc Regen files (requested by tv in ticket #1427)

Proper support for mmap2
 1.15.2.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.15.2.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.15.2.4 24-Sep-2004  skrll Sync with HEAD.
 1.15.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.15.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.15.2.1 03-Aug-2004  skrll Sync with HEAD
 1.20.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.20.4.1 29-Apr-2005  kent sync with -current
 1.24.2.5 21-Jan-2008  yamt sync with head
 1.24.2.4 07-Dec-2007  yamt sync with head
 1.24.2.3 03-Sep-2007  yamt sync with head.
 1.24.2.2 30-Dec-2006  yamt sync with head.
 1.24.2.1 21-Jun-2006  yamt sync with head.
 1.25.14.1 19-Jun-2006  chap Sync with head.
 1.25.8.2 03-Sep-2006  yamt sync with head.
 1.25.8.1 26-Jun-2006  yamt sync with head.
 1.25.4.1 09-Sep-2006  rpaulo sync with head
 1.28.8.1 12-Mar-2007  rmind Sync with HEAD.
 1.29.22.3 18-Feb-2008  mjf Sync with HEAD.
 1.29.22.2 27-Dec-2007  mjf Sync with HEAD.
 1.29.22.1 19-Nov-2007  mjf Sync with HEAD.
 1.29.20.1 18-Nov-2007  bouyer Sync with HEAD
 1.29.16.2 23-Mar-2008  matt sync with HEAD
 1.29.16.1 09-Jan-2008  matt sync with HEAD
 1.29.14.1 21-Nov-2007  joerg Sync with HEAD.
 1.30.6.2 19-Jan-2008  bouyer Sync with HEAD
 1.30.6.1 02-Jan-2008  bouyer Sync with HEAD
 1.30.2.1 26-Dec-2007  ad Sync with head.
 1.34.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.34.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.35.2.1 18-May-2008  yamt sync with head.
 1.36.12.1 20-Nov-2008  snj Regen for ticket 81.
 1.36.10.1 19-Jan-2009  skrll Sync with HEAD.
 1.36.8.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.36.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.36.2.4 11-Aug-2010  yamt sync with head.
 1.36.2.3 11-Mar-2010  yamt sync with head
 1.36.2.2 20-Jun-2009  yamt sync with head
 1.36.2.1 04-May-2009  yamt sync with head.
 1.43.2.1 23-Jul-2009  jym Sync with HEAD.
 1.46.4.3 31-May-2011  rmind sync with head
 1.46.4.2 21-Apr-2011  rmind sync with head
 1.46.4.1 05-Mar-2011  rmind sync with head
 1.46.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.47.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.50.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.50.4.2 30-Oct-2012  yamt sync with head
 1.50.4.1 17-Apr-2012  yamt sync with head
 1.51.10.4 03-Dec-2017  jdolecek update from HEAD
 1.51.10.3 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.51.10.2 23-Jun-2013  tls resync from head
 1.51.10.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.53.4.1 18-May-2014  rmind sync with head
 1.57.2.1 10-Aug-2014  tls Rebase.
 1.64.2.1 17-Apr-2017  snj regen for ticket 1354
 1.65.2.3 05-Feb-2017  skrll Sync with HEAD
 1.65.2.2 05-Oct-2016  skrll Sync with HEAD
 1.65.2.1 06-Apr-2015  skrll Sync with HEAD
 1.68.2.3 20-Mar-2017  pgoyette Sync with HEAD
 1.68.2.2 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.68.2.1 26-Jul-2016  pgoyette Sync with HEAD
 1.75.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.78.4.1 11-May-2017  pgoyette Sync with HEAD
 1.79.10.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.79.10.1 10-Jun-2019  christos Sync with HEAD
 1.79.8.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.82.2.2 17-Dec-2020  thorpej Regen for preadv(2) and pwritev(2).
 1.82.2.1 15-Dec-2020  thorpej Regen for eventfd, timerfd, POSIX timers.
 1.93.2.1 02-Aug-2025  perseant Sync with HEAD
 1.95 28-Sep-2024  christos regen
 1.94 01-Jul-2024  christos regen
 1.93 29-Jun-2024  christos branches: 1.93.2;
regen
 1.92 19-Aug-2023  christos regen
 1.91 18-Aug-2023  christos regen
 1.90 29-Jul-2023  christos regen
 1.89 28-Jul-2023  christos regen
 1.88 02-Dec-2021  ryo regen
 1.87 24-Nov-2021  ryo regen
 1.86 20-Sep-2021  thorpej Regen for preadv(2) / pwritev(2).
 1.85 20-Sep-2021  thorpej Regen for eventfd.
 1.84 19-Sep-2021  thorpej Regen for timerfd.
 1.83 19-Sep-2021  thorpej Regen for POSIX timer syscalls.
 1.82 26-Apr-2020  thorpej branches: 1.82.2;
Regen for native futex calls.
 1.81 09-Nov-2019  jdolecek regen
 1.80 10-Aug-2018  pgoyette Regen
 1.79 10-May-2017  riastradh branches: 1.79.8; 1.79.10;
regen
 1.78 03-Feb-2017  christos branches: 1.78.4;
regen
 1.77 03-Feb-2017  martin Regen for accept4
 1.76 16-Jan-2017  christos regen all
 1.75 15-Jan-2017  christos branches: 1.75.2;
regen
 1.74 15-Jan-2017  christos regen
 1.73 15-Jan-2017  christos regen
 1.72 13-Jan-2017  christos regen
 1.71 02-Jan-2017  martin Regen (something apparently went wrong in previous)
 1.70 02-Jan-2017  manu Regen
 1.69 24-Jul-2016  njoly Regen for readlink/readlinkat signatures.
 1.68 23-Mar-2015  ozaki-r branches: 1.68.2;
Regen
 1.67 23-Mar-2015  ozaki-r Regen
 1.66 07-Mar-2015  christos regen
 1.65 22-Nov-2014  njoly branches: 1.65.2;
Regen for ppoll signature fix
 1.64 31-May-2014  njoly branches: 1.64.2;
Regen for munmap(2) signature.
 1.63 29-May-2014  njoly Regen for utimes(2) change.
 1.62 20-May-2014  njoly Regen for getgroups/setgroups update.
 1.61 17-May-2014  njoly Regen for fadvise64 offset types changes.
 1.60 06-May-2014  njoly Regen for mknod device argument type change.
 1.59 04-May-2014  njoly Regen for pread/pwrite 64bit offset argument.
 1.58 08-Apr-2014  njoly Regen.
 1.57 08-Dec-2013  njoly branches: 1.57.2;
Regen.
 1.56 19-Nov-2013  chs regen
 1.55 07-Nov-2013  njoly Regen for dup/dup2/dup3 argument types fix.
 1.54 24-Sep-2013  njoly Regen for utimensat(2).
 1.53 08-Apr-2013  pooka branches: 1.53.4;
regen for utimes
 1.52 19-Sep-2012  pooka regen for ppoll (and, apparently, SYCALL_ARG_PTR)
 1.51 18-Nov-2011  christos branches: 1.51.10;
- add sigtimedwait support.
- merge the siginfo population code.
 1.50 30-May-2011  alnsn branches: 1.50.4;
Regenerate files to pick up correct RCS Ids. Suggested by Chris Badura.
 1.49 30-May-2011  alnsn Add fadvise64 and fadvise64_64 syscalls to compat_linux and compat_linux32.
 1.48 15-Apr-2011  he Regenerate these files after adding pipe2() and dup3().
 1.47 07-Jul-2010  chs branches: 1.47.2;
regen
 1.46 14-Dec-2009  matt branches: 1.46.2; 1.46.4;
Regen (new makesyscalls.sh)
 1.45 24-Nov-2009  njoly Regen for personality(2) update.
 1.44 08-Jun-2009  njoly Regen for rt_queueinfo(2) update.
 1.43 17-Jan-2009  njoly branches: 1.43.2;
Regen for wait4 update.
 1.42 15-Jan-2009  njoly Rengen for compat50 update.
 1.41 13-Jan-2009  pooka Regen to prove I didn't screw up the conversion: purely RCSID changes.
 1.40 13-Jan-2009  rtr actually commit syscalls.master this time
add back blank line between #include <sys/.. and #include <sys/compat/..
regen
 1.39 12-Jan-2009  rtr regen for christos_time_t merge
 1.38 19-Nov-2008  ad Regen.
 1.37 12-Nov-2008  njoly Regen for nanosleep(2) fix.
 1.36 23-Apr-2008  ad branches: 1.36.2; 1.36.4; 1.36.8; 1.36.10; 1.36.12;
Regen.
 1.35 04-Apr-2008  njoly branches: 1.35.2;
Regen for linux_sys_msync removal.
 1.34 15-Jan-2008  njoly branches: 1.34.6;
Regen.
 1.33 24-Dec-2007  njoly Regen for linux_sys_getpgid removal.
 1.32 21-Dec-2007  njoly Regen for getfsuid/setfsgid syscall exchange.
 1.31 20-Dec-2007  dsl regen
 1.30 16-Nov-2007  njoly branches: 1.30.2; 1.30.6;
Regen, for syscalls cleanup.
 1.29 04-Mar-2007  christos branches: 1.29.14; 1.29.16; 1.29.20; 1.29.22;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.28 01-Sep-2006  matt branches: 1.28.8;
Regen.
 1.27 30-Aug-2006  matt Regen
 1.26 10-Jun-2006  christos regen
 1.25 11-Dec-2005  christos branches: 1.25.4; 1.25.8; 1.25.14;
merge ktrace-lwp.
 1.24 16-May-2005  fvdl branches: 1.24.2;
Regen.
 1.23 16-May-2005  fvdl Regen.
 1.22 26-Feb-2005  perry regen
 1.21 26-Feb-2005  perry regen
 1.20 20-Sep-2004  jdolecek branches: 1.20.4; 1.20.6;
regen:
implement support for Linux statfs64() syscall - 64bit variant of statfs()
 1.19 08-Sep-2004  jdolecek regen: add exit_group(2)
 1.18 01-Aug-2004  jdolecek regen:

add stub entries for syscalls added until Linux kernel 2.6.7

move the ARM-specific syscall range up to offset 0x180, to make room
for the new syscalls
 1.17 01-Aug-2004  jdolecek regen:

connect madvise(2) and mincore(2) - apparently the newer Linux libs
don't stub it anymore, so allow the application to take advantage
of them

the Linux calls appear to be compatible in the flag values and semantics,
so a wrapper is not necessary
 1.16 10-Aug-2003  jdolecek regen - added wrapper for Linux ftruncate64()
 1.15 28-Jun-2003  he branches: 1.15.2;
Regenerate after adding include of linux_mmap.h.
 1.14 23-Jun-2003  christos Regen.
 1.13 18-Jan-2003  thorpej Regen to get correct RCS IDs.
 1.12 18-Jan-2003  thorpej Regen: Merge the nathanw_sa branch.
 1.11 12-May-2002  jdolecek branches: 1.11.4;
regen - hook linux_sys_fcntl64()
 1.10 10-Apr-2002  christos regen
 1.9 22-Mar-2002  christos regen
 1.8 17-Feb-2002  bjh21 branches: 1.8.2;
Regen.
 1.7 15-Feb-2002  christos - add a real linux_sys___sysctl because the mib numbers are different.
implement only the kernel version getting entries.
- make the signal conversion functions consistent; dest is arg 1.
- make linux_fakedev deal with block and char devices differently.
- add linux_sys_ugetrlimit, and flesh out the regular get/setrlimit so
that they work properly.
- add linux_mmap2 [untested].
- bump kernel to 2.4.18, and make the date be valentine's day :-)
- linux_sys_*stat64 family was totally busted. Fix it.

tested only on i386.

Status:
gdb, telnet, work
jdk-1.4.0 extractor works, jdk still coredumps.

christos
 1.6 27-Jan-2002  bjh21 branches: 1.6.2;
Regen (breakpoint() implemented).
 1.5 27-Jan-2002  bjh21 Regen (prototype for linux_sys_nosys()).
 1.4 23-Jan-2002  bjh21 Regen (sys_nosys -> linux_sys_nosys).
 1.3 23-Jan-2002  bjh21 Regen (cacheflush() and remove syscall 0).
 1.2 15-Jan-2002  bjh21 Regen.
 1.1 14-Jan-2002  bjh21 Generated files for ARMLinux binary compatibility.
 1.6.2.4 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.6.2.3 16-Mar-2002  jdolecek Catch up with -current.
 1.6.2.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.6.2.1 27-Jan-2002  jdolecek file linux_syscallargs.h was added on branch kqueue on 2002-02-11 20:09:31 +0000
 1.8.2.7 20-Jun-2002  nathanw Catch up to -current.
 1.8.2.6 29-May-2002  nathanw Regen.
 1.8.2.5 04-May-2002  thorpej Regen.
 1.8.2.4 17-Apr-2002  nathanw Catch up to -current.
 1.8.2.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.8.2.2 28-Feb-2002  nathanw Catch up to -current.
 1.8.2.1 17-Feb-2002  nathanw file linux_syscallargs.h was added on branch nathanw_sa on 2002-02-28 04:12:48 +0000
 1.11.4.4 14-Jun-2004  jmc Regen for changes in ticket #1708
 1.11.4.3 11-May-2004  tron Regen for ticket 1686.
 1.11.4.2 20-Nov-2003  jmc Regen after fix in syscalls.master from ticket #1427.
 1.11.4.1 22-Oct-2003  jmc Regen files (requested by tv in ticket #1427)

Proper support for mmap2
 1.15.2.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.15.2.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.15.2.4 24-Sep-2004  skrll Sync with HEAD.
 1.15.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.15.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.15.2.1 03-Aug-2004  skrll Sync with HEAD
 1.20.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.20.4.1 29-Apr-2005  kent sync with -current
 1.24.2.5 21-Jan-2008  yamt sync with head
 1.24.2.4 07-Dec-2007  yamt sync with head
 1.24.2.3 03-Sep-2007  yamt sync with head.
 1.24.2.2 30-Dec-2006  yamt sync with head.
 1.24.2.1 21-Jun-2006  yamt sync with head.
 1.25.14.1 19-Jun-2006  chap Sync with head.
 1.25.8.2 03-Sep-2006  yamt sync with head.
 1.25.8.1 26-Jun-2006  yamt sync with head.
 1.25.4.1 09-Sep-2006  rpaulo sync with head
 1.28.8.1 12-Mar-2007  rmind Sync with HEAD.
 1.29.22.3 18-Feb-2008  mjf Sync with HEAD.
 1.29.22.2 27-Dec-2007  mjf Sync with HEAD.
 1.29.22.1 19-Nov-2007  mjf Sync with HEAD.
 1.29.20.1 18-Nov-2007  bouyer Sync with HEAD
 1.29.16.2 23-Mar-2008  matt sync with HEAD
 1.29.16.1 09-Jan-2008  matt sync with HEAD
 1.29.14.1 21-Nov-2007  joerg Sync with HEAD.
 1.30.6.2 19-Jan-2008  bouyer Sync with HEAD
 1.30.6.1 02-Jan-2008  bouyer Sync with HEAD
 1.30.2.1 26-Dec-2007  ad Sync with head.
 1.34.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.34.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.35.2.1 18-May-2008  yamt sync with head.
 1.36.12.1 20-Nov-2008  snj Regen for ticket 81.
 1.36.10.1 19-Jan-2009  skrll Sync with HEAD.
 1.36.8.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.36.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.36.2.4 11-Aug-2010  yamt sync with head.
 1.36.2.3 11-Mar-2010  yamt sync with head
 1.36.2.2 20-Jun-2009  yamt sync with head
 1.36.2.1 04-May-2009  yamt sync with head.
 1.43.2.1 23-Jul-2009  jym Sync with HEAD.
 1.46.4.3 31-May-2011  rmind sync with head
 1.46.4.2 21-Apr-2011  rmind sync with head
 1.46.4.1 05-Mar-2011  rmind sync with head
 1.46.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.47.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.50.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.50.4.2 30-Oct-2012  yamt sync with head
 1.50.4.1 17-Apr-2012  yamt sync with head
 1.51.10.4 03-Dec-2017  jdolecek update from HEAD
 1.51.10.3 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.51.10.2 23-Jun-2013  tls resync from head
 1.51.10.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.53.4.1 18-May-2014  rmind sync with head
 1.57.2.1 10-Aug-2014  tls Rebase.
 1.64.2.1 17-Apr-2017  snj regen for ticket 1354
 1.65.2.4 28-Aug-2017  skrll Sync with HEAD
 1.65.2.3 05-Feb-2017  skrll Sync with HEAD
 1.65.2.2 05-Oct-2016  skrll Sync with HEAD
 1.65.2.1 06-Apr-2015  skrll Sync with HEAD
 1.68.2.3 20-Mar-2017  pgoyette Sync with HEAD
 1.68.2.2 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.68.2.1 26-Jul-2016  pgoyette Sync with HEAD
 1.75.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.78.4.1 11-May-2017  pgoyette Sync with HEAD
 1.79.10.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.79.10.1 10-Jun-2019  christos Sync with HEAD
 1.79.8.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.82.2.2 17-Dec-2020  thorpej Regen for preadv(2) and pwritev(2).
 1.82.2.1 15-Dec-2020  thorpej Regen for eventfd, timerfd, POSIX timers.
 1.93.2.1 02-Aug-2025  perseant Sync with HEAD
 1.95 28-Sep-2024  christos regen
 1.94 01-Jul-2024  christos regen
 1.93 29-Jun-2024  christos branches: 1.93.2;
regen
 1.92 19-Aug-2023  christos regen
 1.91 18-Aug-2023  christos regen
 1.90 29-Jul-2023  christos regen
 1.89 28-Jul-2023  christos regen
 1.88 02-Dec-2021  ryo regen
 1.87 24-Nov-2021  ryo regen
 1.86 20-Sep-2021  thorpej Regen for preadv(2) / pwritev(2).
 1.85 20-Sep-2021  thorpej Regen for eventfd.
 1.84 19-Sep-2021  thorpej Regen for timerfd.
 1.83 19-Sep-2021  thorpej Regen for POSIX timer syscalls.
 1.82 26-Apr-2020  thorpej branches: 1.82.2;
Regen for native futex calls.
 1.81 09-Nov-2019  jdolecek regen
 1.80 10-Aug-2018  pgoyette Regen
 1.79 10-May-2017  riastradh branches: 1.79.8; 1.79.10;
regen
 1.78 03-Feb-2017  christos branches: 1.78.4;
regen
 1.77 03-Feb-2017  martin Regen for accept4
 1.76 16-Jan-2017  christos regen all
 1.75 15-Jan-2017  christos branches: 1.75.2;
regen
 1.74 15-Jan-2017  christos regen
 1.73 15-Jan-2017  christos regen
 1.72 13-Jan-2017  christos regen
 1.71 02-Jan-2017  martin Regen (something apparently went wrong in previous)
 1.70 02-Jan-2017  manu Regen
 1.69 24-Jul-2016  njoly Regen for readlink/readlinkat signatures.
 1.68 23-Mar-2015  ozaki-r branches: 1.68.2;
Regen
 1.67 23-Mar-2015  ozaki-r Regen
 1.66 07-Mar-2015  christos regen
 1.65 22-Nov-2014  njoly branches: 1.65.2;
Regen for ppoll signature fix
 1.64 31-May-2014  njoly branches: 1.64.2;
Regen for munmap(2) signature.
 1.63 29-May-2014  njoly Regen for utimes(2) change.
 1.62 20-May-2014  njoly Regen for getgroups/setgroups update.
 1.61 17-May-2014  njoly Regen for fadvise64 offset types changes.
 1.60 06-May-2014  njoly Regen for mknod device argument type change.
 1.59 04-May-2014  njoly Regen for pread/pwrite 64bit offset argument.
 1.58 08-Apr-2014  njoly Regen.
 1.57 08-Dec-2013  njoly branches: 1.57.2;
Regen.
 1.56 19-Nov-2013  chs regen
 1.55 07-Nov-2013  njoly Regen for dup/dup2/dup3 argument types fix.
 1.54 24-Sep-2013  njoly Regen for utimensat(2).
 1.53 08-Apr-2013  pooka branches: 1.53.4;
regen for utimes
 1.52 19-Sep-2012  pooka regen for ppoll (and, apparently, SYCALL_ARG_PTR)
 1.51 18-Nov-2011  christos branches: 1.51.10;
- add sigtimedwait support.
- merge the siginfo population code.
 1.50 30-May-2011  alnsn branches: 1.50.4;
Regenerate files to pick up correct RCS Ids. Suggested by Chris Badura.
 1.49 30-May-2011  alnsn Add fadvise64 and fadvise64_64 syscalls to compat_linux and compat_linux32.
 1.48 15-Apr-2011  he Regenerate these files after adding pipe2() and dup3().
 1.47 07-Jul-2010  chs branches: 1.47.2;
regen
 1.46 14-Dec-2009  matt branches: 1.46.2; 1.46.4;
Regen (new makesyscalls.sh)
 1.45 24-Nov-2009  njoly Regen for personality(2) update.
 1.44 08-Jun-2009  njoly Regen for rt_queueinfo(2) update.
 1.43 17-Jan-2009  njoly branches: 1.43.2;
Regen for wait4 update.
 1.42 15-Jan-2009  njoly Rengen for compat50 update.
 1.41 13-Jan-2009  pooka Regen to prove I didn't screw up the conversion: purely RCSID changes.
 1.40 13-Jan-2009  rtr actually commit syscalls.master this time
add back blank line between #include <sys/.. and #include <sys/compat/..
regen
 1.39 12-Jan-2009  rtr regen for christos_time_t merge
 1.38 19-Nov-2008  ad Regen.
 1.37 12-Nov-2008  njoly Regen for nanosleep(2) fix.
 1.36 23-Apr-2008  ad branches: 1.36.2; 1.36.4; 1.36.8; 1.36.10; 1.36.12;
Regen.
 1.35 04-Apr-2008  njoly branches: 1.35.2;
Regen for linux_sys_msync removal.
 1.34 15-Jan-2008  njoly branches: 1.34.6;
Regen.
 1.33 24-Dec-2007  njoly Regen for linux_sys_getpgid removal.
 1.32 21-Dec-2007  njoly Regen for getfsuid/setfsgid syscall exchange.
 1.31 20-Dec-2007  dsl regen
 1.30 16-Nov-2007  njoly branches: 1.30.2; 1.30.6;
Regen, for syscalls cleanup.
 1.29 09-Feb-2007  ad branches: 1.29.18; 1.29.20; 1.29.24; 1.29.26;
Merge newlock2 to head.
 1.28 01-Sep-2006  matt branches: 1.28.2;
Regen.
 1.27 30-Aug-2006  matt Regen
 1.26 10-Jun-2006  christos regen
 1.25 11-Dec-2005  christos branches: 1.25.4; 1.25.8; 1.25.14;
merge ktrace-lwp.
 1.24 16-May-2005  fvdl branches: 1.24.2;
Regen.
 1.23 16-May-2005  fvdl Regen.
 1.22 26-Feb-2005  perry regen
 1.21 26-Feb-2005  perry regen
 1.20 20-Sep-2004  jdolecek branches: 1.20.4; 1.20.6;
regen:
implement support for Linux statfs64() syscall - 64bit variant of statfs()
 1.19 08-Sep-2004  jdolecek regen: add exit_group(2)
 1.18 01-Aug-2004  jdolecek regen:

add stub entries for syscalls added until Linux kernel 2.6.7

move the ARM-specific syscall range up to offset 0x180, to make room
for the new syscalls
 1.17 01-Aug-2004  jdolecek regen:

connect madvise(2) and mincore(2) - apparently the newer Linux libs
don't stub it anymore, so allow the application to take advantage
of them

the Linux calls appear to be compatible in the flag values and semantics,
so a wrapper is not necessary
 1.16 10-Aug-2003  jdolecek regen - added wrapper for Linux ftruncate64()
 1.15 28-Jun-2003  he branches: 1.15.2;
Regenerate after adding include of linux_mmap.h.
 1.14 23-Jun-2003  christos Regen.
 1.13 18-Jan-2003  thorpej Regen to get correct RCS IDs.
 1.12 18-Jan-2003  thorpej Regen: Merge the nathanw_sa branch.
 1.11 12-May-2002  jdolecek branches: 1.11.4;
regen - hook linux_sys_fcntl64()
 1.10 10-Apr-2002  christos regen
 1.9 22-Mar-2002  christos regen
 1.8 17-Feb-2002  bjh21 branches: 1.8.2;
Regen.
 1.7 15-Feb-2002  christos - add a real linux_sys___sysctl because the mib numbers are different.
implement only the kernel version getting entries.
- make the signal conversion functions consistent; dest is arg 1.
- make linux_fakedev deal with block and char devices differently.
- add linux_sys_ugetrlimit, and flesh out the regular get/setrlimit so
that they work properly.
- add linux_mmap2 [untested].
- bump kernel to 2.4.18, and make the date be valentine's day :-)
- linux_sys_*stat64 family was totally busted. Fix it.

tested only on i386.

Status:
gdb, telnet, work
jdk-1.4.0 extractor works, jdk still coredumps.

christos
 1.6 27-Jan-2002  bjh21 branches: 1.6.2;
Regen (breakpoint() implemented).
 1.5 27-Jan-2002  bjh21 Regen (prototype for linux_sys_nosys()).
 1.4 23-Jan-2002  bjh21 Regen (sys_nosys -> linux_sys_nosys).
 1.3 23-Jan-2002  bjh21 Regen (cacheflush() and remove syscall 0).
 1.2 15-Jan-2002  bjh21 Regen.
 1.1 14-Jan-2002  bjh21 Generated files for ARMLinux binary compatibility.
 1.6.2.4 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.6.2.3 16-Mar-2002  jdolecek Catch up with -current.
 1.6.2.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.6.2.1 27-Jan-2002  jdolecek file linux_syscalls.c was added on branch kqueue on 2002-02-11 20:09:32 +0000
 1.8.2.7 20-Jun-2002  nathanw Catch up to -current.
 1.8.2.6 29-May-2002  nathanw Regen.
 1.8.2.5 04-May-2002  thorpej Regen.
 1.8.2.4 17-Apr-2002  nathanw Catch up to -current.
 1.8.2.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.8.2.2 28-Feb-2002  nathanw Catch up to -current.
 1.8.2.1 17-Feb-2002  nathanw file linux_syscalls.c was added on branch nathanw_sa on 2002-02-28 04:12:48 +0000
 1.11.4.4 14-Jun-2004  jmc Regen for changes in ticket #1708
 1.11.4.3 11-May-2004  tron Regen for ticket 1686.
 1.11.4.2 20-Nov-2003  jmc Regen after fix in syscalls.master from ticket #1427.
 1.11.4.1 22-Oct-2003  jmc Regen files (requested by tv in ticket #1427)

Proper support for mmap2
 1.15.2.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.15.2.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.15.2.4 24-Sep-2004  skrll Sync with HEAD.
 1.15.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.15.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.15.2.1 03-Aug-2004  skrll Sync with HEAD
 1.20.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.20.4.1 29-Apr-2005  kent sync with -current
 1.24.2.5 21-Jan-2008  yamt sync with head
 1.24.2.4 07-Dec-2007  yamt sync with head
 1.24.2.3 26-Feb-2007  yamt sync with head.
 1.24.2.2 30-Dec-2006  yamt sync with head.
 1.24.2.1 21-Jun-2006  yamt sync with head.
 1.25.14.1 19-Jun-2006  chap Sync with head.
 1.25.8.2 03-Sep-2006  yamt sync with head.
 1.25.8.1 26-Jun-2006  yamt sync with head.
 1.25.4.1 09-Sep-2006  rpaulo sync with head
 1.28.2.1 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.29.26.3 18-Feb-2008  mjf Sync with HEAD.
 1.29.26.2 27-Dec-2007  mjf Sync with HEAD.
 1.29.26.1 19-Nov-2007  mjf Sync with HEAD.
 1.29.24.1 18-Nov-2007  bouyer Sync with HEAD
 1.29.20.2 23-Mar-2008  matt sync with HEAD
 1.29.20.1 09-Jan-2008  matt sync with HEAD
 1.29.18.1 21-Nov-2007  joerg Sync with HEAD.
 1.30.6.2 19-Jan-2008  bouyer Sync with HEAD
 1.30.6.1 02-Jan-2008  bouyer Sync with HEAD
 1.30.2.1 26-Dec-2007  ad Sync with head.
 1.34.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.34.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.35.2.1 18-May-2008  yamt sync with head.
 1.36.12.1 20-Nov-2008  snj Regen for ticket 81.
 1.36.10.1 19-Jan-2009  skrll Sync with HEAD.
 1.36.8.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.36.4.2 14-May-2008  wrstuden Per discussion with ad, remove most of the #include <sys/sa.h> lines
as they were including sa.h just for the type(s) needed for syscallargs.h.

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

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

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

I think this reduction is very good thing.
 1.36.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.36.2.4 11-Aug-2010  yamt sync with head.
 1.36.2.3 11-Mar-2010  yamt sync with head
 1.36.2.2 20-Jun-2009  yamt sync with head
 1.36.2.1 04-May-2009  yamt sync with head.
 1.43.2.1 23-Jul-2009  jym Sync with HEAD.
 1.46.4.3 31-May-2011  rmind sync with head
 1.46.4.2 21-Apr-2011  rmind sync with head
 1.46.4.1 05-Mar-2011  rmind sync with head
 1.46.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.47.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.50.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.50.4.2 30-Oct-2012  yamt sync with head
 1.50.4.1 17-Apr-2012  yamt sync with head
 1.51.10.4 03-Dec-2017  jdolecek update from HEAD
 1.51.10.3 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.51.10.2 23-Jun-2013  tls resync from head
 1.51.10.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.53.4.1 18-May-2014  rmind sync with head
 1.57.2.1 10-Aug-2014  tls Rebase.
 1.64.2.1 17-Apr-2017  snj regen for ticket 1354
 1.65.2.3 05-Feb-2017  skrll Sync with HEAD
 1.65.2.2 05-Oct-2016  skrll Sync with HEAD
 1.65.2.1 06-Apr-2015  skrll Sync with HEAD
 1.68.2.3 20-Mar-2017  pgoyette Sync with HEAD
 1.68.2.2 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.68.2.1 26-Jul-2016  pgoyette Sync with HEAD
 1.75.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.78.4.1 11-May-2017  pgoyette Sync with HEAD
 1.79.10.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.79.10.1 10-Jun-2019  christos Sync with HEAD
 1.79.8.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.82.2.2 17-Dec-2020  thorpej Regen for preadv(2) and pwritev(2).
 1.82.2.1 15-Dec-2020  thorpej Regen for eventfd, timerfd, POSIX timers.
 1.93.2.1 02-Aug-2025  perseant Sync with HEAD
 1.95 28-Sep-2024  christos regen
 1.94 01-Jul-2024  christos regen
 1.93 29-Jun-2024  christos branches: 1.93.2;
regen
 1.92 19-Aug-2023  christos regen
 1.91 18-Aug-2023  christos regen
 1.90 29-Jul-2023  christos regen
 1.89 28-Jul-2023  christos regen
 1.88 02-Dec-2021  ryo regen
 1.87 24-Nov-2021  ryo regen
 1.86 20-Sep-2021  thorpej Regen for preadv(2) / pwritev(2).
 1.85 20-Sep-2021  thorpej Regen for eventfd.
 1.84 19-Sep-2021  thorpej Regen for timerfd.
 1.83 19-Sep-2021  thorpej Regen for POSIX timer syscalls.
 1.82 26-Apr-2020  thorpej branches: 1.82.2;
Regen for native futex calls.
 1.81 09-Nov-2019  jdolecek regen
 1.80 10-Aug-2018  pgoyette Regen
 1.79 10-May-2017  riastradh branches: 1.79.8; 1.79.10;
regen
 1.78 03-Feb-2017  christos branches: 1.78.4;
regen
 1.77 03-Feb-2017  martin Regen for accept4
 1.76 16-Jan-2017  christos regen all
 1.75 15-Jan-2017  christos branches: 1.75.2;
regen
 1.74 15-Jan-2017  christos regen
 1.73 15-Jan-2017  christos regen
 1.72 13-Jan-2017  christos regen
 1.71 02-Jan-2017  martin Regen (something apparently went wrong in previous)
 1.70 02-Jan-2017  manu Regen
 1.69 24-Jul-2016  njoly Regen for readlink/readlinkat signatures.
 1.68 23-Mar-2015  ozaki-r branches: 1.68.2;
Regen
 1.67 23-Mar-2015  ozaki-r Regen
 1.66 07-Mar-2015  christos regen
 1.65 22-Nov-2014  njoly branches: 1.65.2;
Regen for ppoll signature fix
 1.64 31-May-2014  njoly branches: 1.64.2;
Regen for munmap(2) signature.
 1.63 29-May-2014  njoly Regen for utimes(2) change.
 1.62 20-May-2014  njoly Regen for getgroups/setgroups update.
 1.61 17-May-2014  njoly Regen for fadvise64 offset types changes.
 1.60 06-May-2014  njoly Regen for mknod device argument type change.
 1.59 04-May-2014  njoly Regen for pread/pwrite 64bit offset argument.
 1.58 08-Apr-2014  njoly Regen.
 1.57 08-Dec-2013  njoly branches: 1.57.2;
Regen.
 1.56 19-Nov-2013  chs regen
 1.55 07-Nov-2013  njoly Regen for dup/dup2/dup3 argument types fix.
 1.54 24-Sep-2013  njoly Regen for utimensat(2).
 1.53 08-Apr-2013  pooka branches: 1.53.4;
regen for utimes
 1.52 19-Sep-2012  pooka regen for ppoll (and, apparently, SYCALL_ARG_PTR)
 1.51 18-Nov-2011  christos branches: 1.51.10;
- add sigtimedwait support.
- merge the siginfo population code.
 1.50 30-May-2011  alnsn branches: 1.50.4;
Regenerate files to pick up correct RCS Ids. Suggested by Chris Badura.
 1.49 30-May-2011  alnsn Add fadvise64 and fadvise64_64 syscalls to compat_linux and compat_linux32.
 1.48 15-Apr-2011  he Regenerate these files after adding pipe2() and dup3().
 1.47 07-Jul-2010  chs branches: 1.47.2;
regen
 1.46 14-Dec-2009  matt branches: 1.46.2; 1.46.4;
Regen (new makesyscalls.sh)
 1.45 24-Nov-2009  njoly Regen for personality(2) update.
 1.44 08-Jun-2009  njoly Regen for rt_queueinfo(2) update.
 1.43 17-Jan-2009  njoly branches: 1.43.2;
Regen for wait4 update.
 1.42 15-Jan-2009  njoly Rengen for compat50 update.
 1.41 13-Jan-2009  pooka Regen to prove I didn't screw up the conversion: purely RCSID changes.
 1.40 13-Jan-2009  rtr actually commit syscalls.master this time
add back blank line between #include <sys/.. and #include <sys/compat/..
regen
 1.39 12-Jan-2009  rtr regen for christos_time_t merge
 1.38 19-Nov-2008  ad Regen.
 1.37 12-Nov-2008  njoly Regen for nanosleep(2) fix.
 1.36 23-Apr-2008  ad branches: 1.36.2; 1.36.4; 1.36.8; 1.36.10; 1.36.12;
Regen.
 1.35 04-Apr-2008  njoly branches: 1.35.2;
Regen for linux_sys_msync removal.
 1.34 15-Jan-2008  njoly branches: 1.34.6;
Regen.
 1.33 24-Dec-2007  njoly Regen for linux_sys_getpgid removal.
 1.32 21-Dec-2007  njoly Regen for getfsuid/setfsgid syscall exchange.
 1.31 20-Dec-2007  dsl regen
 1.30 16-Nov-2007  njoly branches: 1.30.2; 1.30.6;
Regen, for syscalls cleanup.
 1.29 09-Feb-2007  ad branches: 1.29.18; 1.29.20; 1.29.24; 1.29.26;
Merge newlock2 to head.
 1.28 01-Sep-2006  matt branches: 1.28.2;
Regen.
 1.27 30-Aug-2006  matt Regen
 1.26 10-Jun-2006  christos regen
 1.25 11-Dec-2005  christos branches: 1.25.4; 1.25.8; 1.25.14;
merge ktrace-lwp.
 1.24 16-May-2005  fvdl branches: 1.24.2;
Regen.
 1.23 16-May-2005  fvdl Regen.
 1.22 26-Feb-2005  perry regen
 1.21 26-Feb-2005  perry regen
 1.20 20-Sep-2004  jdolecek branches: 1.20.4; 1.20.6;
regen:
implement support for Linux statfs64() syscall - 64bit variant of statfs()
 1.19 08-Sep-2004  jdolecek regen: add exit_group(2)
 1.18 01-Aug-2004  jdolecek regen:

add stub entries for syscalls added until Linux kernel 2.6.7

move the ARM-specific syscall range up to offset 0x180, to make room
for the new syscalls
 1.17 01-Aug-2004  jdolecek regen:

connect madvise(2) and mincore(2) - apparently the newer Linux libs
don't stub it anymore, so allow the application to take advantage
of them

the Linux calls appear to be compatible in the flag values and semantics,
so a wrapper is not necessary
 1.16 10-Aug-2003  jdolecek regen - added wrapper for Linux ftruncate64()
 1.15 28-Jun-2003  he branches: 1.15.2;
Regenerate after adding include of linux_mmap.h.
 1.14 23-Jun-2003  christos Regen.
 1.13 18-Jan-2003  thorpej Regen to get correct RCS IDs.
 1.12 18-Jan-2003  thorpej Regen: Merge the nathanw_sa branch.
 1.11 12-May-2002  jdolecek branches: 1.11.4;
regen - hook linux_sys_fcntl64()
 1.10 10-Apr-2002  christos regen
 1.9 22-Mar-2002  christos regen
 1.8 17-Feb-2002  bjh21 branches: 1.8.2;
Regen.
 1.7 15-Feb-2002  christos - add a real linux_sys___sysctl because the mib numbers are different.
implement only the kernel version getting entries.
- make the signal conversion functions consistent; dest is arg 1.
- make linux_fakedev deal with block and char devices differently.
- add linux_sys_ugetrlimit, and flesh out the regular get/setrlimit so
that they work properly.
- add linux_mmap2 [untested].
- bump kernel to 2.4.18, and make the date be valentine's day :-)
- linux_sys_*stat64 family was totally busted. Fix it.

tested only on i386.

Status:
gdb, telnet, work
jdk-1.4.0 extractor works, jdk still coredumps.

christos
 1.6 27-Jan-2002  bjh21 branches: 1.6.2;
Regen (breakpoint() implemented).
 1.5 27-Jan-2002  bjh21 Regen (prototype for linux_sys_nosys()).
 1.4 23-Jan-2002  bjh21 Regen (sys_nosys -> linux_sys_nosys).
 1.3 23-Jan-2002  bjh21 Regen (cacheflush() and remove syscall 0).
 1.2 15-Jan-2002  bjh21 Regen.
 1.1 14-Jan-2002  bjh21 Generated files for ARMLinux binary compatibility.
 1.6.2.4 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.6.2.3 16-Mar-2002  jdolecek Catch up with -current.
 1.6.2.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.6.2.1 27-Jan-2002  jdolecek file linux_sysent.c was added on branch kqueue on 2002-02-11 20:09:32 +0000
 1.8.2.7 20-Jun-2002  nathanw Catch up to -current.
 1.8.2.6 29-May-2002  nathanw Regen.
 1.8.2.5 04-May-2002  thorpej Regen.
 1.8.2.4 17-Apr-2002  nathanw Catch up to -current.
 1.8.2.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.8.2.2 28-Feb-2002  nathanw Catch up to -current.
 1.8.2.1 17-Feb-2002  nathanw file linux_sysent.c was added on branch nathanw_sa on 2002-02-28 04:12:48 +0000
 1.11.4.4 14-Jun-2004  jmc Regen for changes in ticket #1708
 1.11.4.3 11-May-2004  tron Regen for ticket 1686.
 1.11.4.2 20-Nov-2003  jmc Regen after fix in syscalls.master from ticket #1427.
 1.11.4.1 22-Oct-2003  jmc Regen files (requested by tv in ticket #1427)

Proper support for mmap2
 1.15.2.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.15.2.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.15.2.4 24-Sep-2004  skrll Sync with HEAD.
 1.15.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.15.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.15.2.1 03-Aug-2004  skrll Sync with HEAD
 1.20.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.20.4.1 29-Apr-2005  kent sync with -current
 1.24.2.5 21-Jan-2008  yamt sync with head
 1.24.2.4 07-Dec-2007  yamt sync with head
 1.24.2.3 26-Feb-2007  yamt sync with head.
 1.24.2.2 30-Dec-2006  yamt sync with head.
 1.24.2.1 21-Jun-2006  yamt sync with head.
 1.25.14.1 19-Jun-2006  chap Sync with head.
 1.25.8.2 03-Sep-2006  yamt sync with head.
 1.25.8.1 26-Jun-2006  yamt sync with head.
 1.25.4.1 09-Sep-2006  rpaulo sync with head
 1.28.2.1 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.29.26.3 18-Feb-2008  mjf Sync with HEAD.
 1.29.26.2 27-Dec-2007  mjf Sync with HEAD.
 1.29.26.1 19-Nov-2007  mjf Sync with HEAD.
 1.29.24.1 18-Nov-2007  bouyer Sync with HEAD
 1.29.20.2 23-Mar-2008  matt sync with HEAD
 1.29.20.1 09-Jan-2008  matt sync with HEAD
 1.29.18.1 21-Nov-2007  joerg Sync with HEAD.
 1.30.6.2 19-Jan-2008  bouyer Sync with HEAD
 1.30.6.1 02-Jan-2008  bouyer Sync with HEAD
 1.30.2.1 26-Dec-2007  ad Sync with head.
 1.34.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.34.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.35.2.1 18-May-2008  yamt sync with head.
 1.36.12.1 20-Nov-2008  snj Regen for ticket 81.
 1.36.10.1 19-Jan-2009  skrll Sync with HEAD.
 1.36.8.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.36.4.2 14-May-2008  wrstuden Per discussion with ad, remove most of the #include <sys/sa.h> lines
as they were including sa.h just for the type(s) needed for syscallargs.h.

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

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

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

I think this reduction is very good thing.
 1.36.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.36.2.4 11-Aug-2010  yamt sync with head.
 1.36.2.3 11-Mar-2010  yamt sync with head
 1.36.2.2 20-Jun-2009  yamt sync with head
 1.36.2.1 04-May-2009  yamt sync with head.
 1.43.2.1 23-Jul-2009  jym Sync with HEAD.
 1.46.4.3 31-May-2011  rmind sync with head
 1.46.4.2 21-Apr-2011  rmind sync with head
 1.46.4.1 05-Mar-2011  rmind sync with head
 1.46.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.47.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.50.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.50.4.2 30-Oct-2012  yamt sync with head
 1.50.4.1 17-Apr-2012  yamt sync with head
 1.51.10.4 03-Dec-2017  jdolecek update from HEAD
 1.51.10.3 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.51.10.2 23-Jun-2013  tls resync from head
 1.51.10.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.53.4.1 18-May-2014  rmind sync with head
 1.57.2.1 10-Aug-2014  tls Rebase.
 1.64.2.1 17-Apr-2017  snj regen for ticket 1354
 1.65.2.3 05-Feb-2017  skrll Sync with HEAD
 1.65.2.2 05-Oct-2016  skrll Sync with HEAD
 1.65.2.1 06-Apr-2015  skrll Sync with HEAD
 1.68.2.3 20-Mar-2017  pgoyette Sync with HEAD
 1.68.2.2 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.68.2.1 26-Jul-2016  pgoyette Sync with HEAD
 1.75.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.78.4.1 11-May-2017  pgoyette Sync with HEAD
 1.79.10.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.79.10.1 10-Jun-2019  christos Sync with HEAD
 1.79.8.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.82.2.2 17-Dec-2020  thorpej Regen for preadv(2) and pwritev(2).
 1.82.2.1 15-Dec-2020  thorpej Regen for eventfd, timerfd, POSIX timers.
 1.93.2.1 02-Aug-2025  perseant Sync with HEAD
 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 02-Dec-2021  ryo regen
 1.20 24-Nov-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  martin Regen for accept4
 1.9 16-Jan-2017  christos regen all
 1.8 15-Jan-2017  christos branches: 1.8.2;
regen
 1.7 15-Jan-2017  christos regen
 1.6 15-Jan-2017  christos regen
 1.5 15-Jan-2017  martin Cast pointer to int via intptr_t
 1.4 13-Jan-2017  christos regen
 1.3 02-Jan-2017  martin Regen (something apparently went wrong in previous)
 1.2 24-Jul-2016  njoly Regen for readlink/readlinkat signatures.
 1.1 23-Mar-2015  ozaki-r branches: 1.1.2; 1.1.4;
Regen
 1.1.4.3 20-Mar-2017  pgoyette Sync with HEAD
 1.1.4.2 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.1.4.1 26-Jul-2016  pgoyette Sync with HEAD
 1.1.2.4 05-Feb-2017  skrll Sync with HEAD
 1.1.2.3 05-Oct-2016  skrll Sync with HEAD
 1.1.2.2 06-Apr-2015  skrll Sync with HEAD
 1.1.2.1 23-Mar-2015  skrll file linux_systrace_args.c was added on branch nick-nhusb on 2015-04-06 15:18:06 +0000
 1.8.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:54 +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.2 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.1 14-Jan-2002  bjh21 branches: 1.1.2; 1.1.4; 1.1.118; 1.1.120; 1.1.122;
Crude first cut at ARMLinux binary compatibility. Successfully runs
"/emul/linux/bin/echo hello, world", dynamically linked.
 1.1.122.1 16-May-2008  yamt sync with head.
 1.1.120.1 18-May-2008  yamt sync with head.
 1.1.118.1 02-Jun-2008  mjf Sync with HEAD.
 1.1.4.2 28-Feb-2002  nathanw Catch up to -current.
 1.1.4.1 14-Jan-2002  nathanw file linux_termios.h was added on branch nathanw_sa on 2002-02-28 04:12:49 +0000
 1.1.2.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.1.2.1 14-Jan-2002  jdolecek file linux_termios.h was added on branch kqueue on 2002-02-11 20:09:32 +0000
 1.9 21-Mar-2013  pooka Fix stat64 by making it match i386. Other archs might still be broken,
but this is the one I could test.
 1.8 11-Jan-2009  christos branches: 1.8.14; 1.8.24;
merge christos-time_t
 1.7 28-Apr-2008  martin branches: 1.7.8; 1.7.14;
Remove clause 3 and 4 from TNF licenses
 1.6 11-Dec-2005  christos branches: 1.6.70; 1.6.72; 1.6.74;
merge ktrace-lwp.
 1.5 20-Sep-2004  jdolecek move definition of linux_fsid_t to common/linux_types.h - it's identical
across all Linux archs
 1.4 19-Sep-2004  jdolecek move definition of struct linux_stafs to common/linux_types.h, and use
explicit size types - the structure definition is actually identical
on currently support COMPAT_LINUX archs, so no point to have 6 copies of it
in the tree
 1.3 19-May-2002  jdolecek branches: 1.3.8;
On archs with broken linux struct stat64 st_ino, rename linux_stat64's
lst_ino to __lst_ino and lst_ino64 to lst_ino, and define
LINUX_STAT64_HAS_BROKEN_ST_INO. Only assign __lst_ino if this define
is present.

This fixes compile on powerpc archs, and hence port-powerpc/16893.
 1.2 17-Feb-2002  bjh21 branches: 1.2.2; 1.2.10;
Add an lst_ino64 member to struct linux_stat64.
 1.1 14-Jan-2002  bjh21 branches: 1.1.2;
Crude first cut at ARMLinux binary compatibility. Successfully runs
"/emul/linux/bin/echo hello, world", dynamically linked.
 1.1.2.4 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.2.3 16-Mar-2002  jdolecek Catch up with -current.
 1.1.2.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.1.2.1 14-Jan-2002  jdolecek file linux_types.h was added on branch kqueue on 2002-02-11 20:09:32 +0000
 1.2.10.1 30-May-2002  gehenna Catch up with -current.
 1.2.2.3 20-Jun-2002  nathanw Catch up to -current.
 1.2.2.2 28-Feb-2002  nathanw Catch up to -current.
 1.2.2.1 17-Feb-2002  nathanw file linux_types.h was added on branch nathanw_sa on 2002-02-28 04:12:49 +0000
 1.3.8.1 24-Sep-2004  skrll Sync with HEAD.
 1.6.74.2 04-May-2009  yamt sync with head.
 1.6.74.1 16-May-2008  yamt sync with head.
 1.6.72.1 18-May-2008  yamt sync with head.
 1.6.70.2 17-Jan-2009  mjf Sync with HEAD.
 1.6.70.1 02-Jun-2008  mjf Sync with HEAD.
 1.7.14.2 11-Jan-2009  christos add linux_suseconds_t
 1.7.14.1 28-Apr-2008  christos file linux_types.h was added on branch christos-time_t on 2009-01-11 00:17:51 +0000
 1.7.8.1 19-Jan-2009  skrll Sync with HEAD.
 1.8.24.1 23-Jun-2013  tls resync from head
 1.8.14.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 23-Mar-2015  ozaki-r Add linux_systrace_args.c for arm
 1.2 23-Jan-2002  bjh21 branches: 1.2.2; 1.2.4; 1.2.168; 1.2.188;
sys_nosys="linux_sys_nosys", since that's how it should be.
 1.1 14-Jan-2002  bjh21 Crude first cut at ARMLinux binary compatibility. Successfully runs
"/emul/linux/bin/echo hello, world", dynamically linked.
 1.2.188.1 06-Apr-2015  skrll Sync with HEAD
 1.2.168.1 03-Dec-2017  jdolecek update from HEAD
 1.2.4.2 28-Feb-2002  nathanw Catch up to -current.
 1.2.4.1 23-Jan-2002  nathanw file syscalls.conf was added on branch nathanw_sa on 2002-02-28 04:12:49 +0000
 1.2.2.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.2.2.1 23-Jan-2002  jdolecek file syscalls.conf was added on branch kqueue on 2002-02-11 20:09:32 +0000
 1.82 28-Sep-2024  christos Linux GSoC-2024: renameat2, clone3, sync_file_range, syncfs (Shivraj Jamgade)
 1.81 01-Jul-2024  christos Add linux POSIX message queue support (Ricardo Branco)
 1.80 29-Jun-2024  christos branches: 1.80.2;
From gsoc 2024: Implement faccessat2 and getcpu (Shivraz)
 1.79 19-Aug-2023  christos Add inotify* syscalls GSoC 2023 (Theodore Preduta)
 1.78 18-Aug-2023  christos Add linux waitid(2) from GSoC 2023 (Theodore Preduta)
 1.77 29-Jul-2023  christos Add/fix statx, readahead, close_range. From GSoC 2023 by Theodore Preduta
 1.76 28-Jul-2023  christos add epoll syscalls
 1.75 02-Dec-2021  ryo add prlimit64(2) syscall to COMPAT_LINUX and COMPAT_LINUX32
 1.74 24-Nov-2021  ryo add getrandom(2) syscall entry
 1.73 20-Sep-2021  thorpej Add preadv(2) and pwritev(2) system calls to COMPAT_LINUX and COMPAT_LINUX32.
 1.72 20-Sep-2021  thorpej Add the eventfd system calls to COMPAT_LINUX and COMPAT_LINUX32.
 1.71 19-Sep-2021  thorpej Add the timerfd syscalls to COMPAT_LINUX and COMPAT_LINUX32.
 1.70 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.69 26-Apr-2020  thorpej branches: 1.69.2;
Add a NetBSD native futex implementation, mostly written by riastradh@.
Map the COMPAT_LINUX futex calls to the native ones.
 1.68 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.67 03-Feb-2017  christos branches: 1.67.14;
add send recv mmsg and unimpl
XXX: fix base?
 1.66 03-Feb-2017  martin Add accept4 definitions
 1.65 02-Jan-2017  manu branches: 1.65.2;
Add pselect6 Linux system call.
This lets Matlab R2016A run on NetBSD/amd64
 1.64 24-Jul-2016  njoly Small cleanup. Adjust readlink/readlinkat signatures to reduce diffs with
native.
 1.63 23-Mar-2015  ozaki-r branches: 1.63.2;
Fix inconsistent argument names
 1.62 22-Nov-2014  njoly branches: 1.62.2;
Fix ppoll signature (int ->u_int)
 1.61 31-May-2014  njoly branches: 1.61.2;
Fix munmap(2) signature.
 1.60 29-May-2014  njoly For utimes(2), use compat_50_sys_utimes() instead of local version.
 1.59 20-May-2014  njoly Fix getgroups/setgroups signature.
 1.58 17-May-2014  njoly Fix fadvise64 syscalls to use 64bit offset types.
 1.57 06-May-2014  njoly Reduce diffs between archs; make mknod device argument unsigned.
 1.56 04-May-2014  njoly Fix pread/pwrite syscalls which need a 64bit offset argument.
 1.55 08-Apr-2014  njoly Adjust read/write/readv/writev signature to match native versions.
 1.54 08-Dec-2013  njoly branches: 1.54.2;
Sprinkle a few more linux_umode_t where appropriate.
Reduce diffs between archs.
 1.53 19-Nov-2013  chs add the *at() syscalls.
 1.52 07-Nov-2013  njoly Fix dup/dup2/dup3 argument types (u_int -> int).
 1.51 24-Sep-2013  njoly Add utimensat(2) for compat linux.
 1.50 08-Apr-2013  pooka branches: 1.50.4;
support utimes on non-alpha linux platforms
 1.49 19-Sep-2012  pooka emulate ppoll which is essentially our pollts
 1.48 18-Nov-2011  christos branches: 1.48.10;
add sigtimedwait
 1.47 09-Jul-2011  christos branches: 1.47.2;
the first argument of {g,s}etitimer() is int not u_int.
 1.46 30-May-2011  alnsn Add fadvise64 and fadvise64_64 syscalls to compat_linux and compat_linux32.
 1.45 15-Apr-2011  he Add dup3() and pipe2() for these archs as well.
 1.44 07-Jul-2010  chs branches: 1.44.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.43 24-Nov-2009  njoly branches: 1.43.2; 1.43.4;
Update personality(2) to match Linux definition where the argument is an
unsigned long.
 1.42 08-Jun-2009  njoly Update rt_queueinfo(2) definition, and kill a corresponding comment.
 1.41 17-Jan-2009  njoly branches: 1.41.2;
Convert linux/linux32 wait(4) to use a compat50 rusage structure.
 1.40 15-Jan-2009  njoly Update some syscalls/arguments to use the new compat50 equivalents.
 1.39 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.38 13-Jan-2009  rtr actually commit syscalls.master this time
add back blank line between #include <sys/.. and #include <sys/compat/..
regen
 1.37 19-Nov-2008  ad Make the emulations, exec formats, coredump, NFS, and the NFS server
into modules. By and large this commit:

- shuffles header files and ifdefs
- splits code out where necessary to be modular
- adds module glue for each of the components
- adds/replaces hooks for things that can be installed at runtime
 1.36 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.35 23-Apr-2008  ad branches: 1.35.2; 1.35.4; 1.35.8; 1.35.10; 1.35.12;
-SYCALL_MPSAFE
 1.34 04-Apr-2008  njoly branches: 1.34.2;
Cleanup. Kill linux_sys_msync and use sys___msync13 instead.
No functional changes expected.
 1.33 15-Jan-2008  njoly branches: 1.33.6;
compat linux (and linux32) uid16 functions cleanup and fixes.

- Move uid16 functions to their own file linux_uid16.c, included by
needed archs (arm, i386 and m68k).
- Add new MI types linux_{u,g}id16_t.
- Add macros to handle linux_uid16_t and uid_t conversions.
- Add linux_sys_getres{uid,gid}16 syscalls, to fix an overflow with
bad sizes given to copyout when linux_sys_getres{uid,gid} are used.
- Update arm syscall table to use more uid16 functions.
 1.32 24-Dec-2007  njoly Kill unneeded linux_sys_getpgid and use native sys_getpgid instead.
 1.31 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.30 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.29 16-Nov-2007  njoly branches: 1.29.2; 1.29.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.28 04-Mar-2007  christos branches: 1.28.14; 1.28.16; 1.28.20; 1.28.22;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.27 09-Feb-2007  ad branches: 1.27.2;
Merge newlock2 to head.
 1.26 01-Sep-2006  matt branches: 1.26.2;
Don't conditionalize *sys_ptrace. The lack of sys_ptrace will be dealt
with differently.
 1.25 30-Aug-2006  matt Update to deal with options PTRACE
 1.24 10-Jun-2006  christos linux getpriority is off-by-20 so use our own function.
From PR/33671: Nicolas Joly
 1.23 11-Dec-2005  christos branches: 1.23.4; 1.23.8; 1.23.14;
merge ktrace-lwp.
 1.22 16-May-2005  fvdl branches: 1.22.2;
Add clock_* POSIX functions.
 1.21 16-May-2005  fvdl Add *xattr functions (they all return EOPNOTSUPP).
 1.20 26-Feb-2005  perry nuke trailing whitespace
 1.19 20-Sep-2004  jdolecek branches: 1.19.4; 1.19.6;
implement support for Linux statfs64() syscall - 64bit variant of statfs()
 1.18 08-Sep-2004  jdolecek implement basic exit_group(2), which just terminates calling thread;
apparently not many apps use thread groups yet, at least not with default
SuSE 9.1 libraries, so this is enough for now
 1.17 01-Aug-2004  jdolecek add stub entries for syscalls added until Linux kernel 2.6.7

move the ARM-specific syscall range up to offset 0x180, to make room
for the new syscalls
 1.16 01-Aug-2004  jdolecek connect madvise(2) and mincore(2) - apparently the newer Linux libs
don't stub it anymore, so allow the application to take advantage
of them

the Linux calls appear to be compatible in the flag values and semantics,
so a wrapper is not necessary
 1.15 10-Aug-2003  jdolecek add Linux compat arg wrapper for ftruncate64(), and change linux compat
truncate64() wrapper to translate args structure
NetBSD truncate() and ftrucate() have hidden 'pad' argument, so we have
to do the argument translation

Problem found and patch supplied in PR kern/22360 by Ales Krenek

This is the last of syscalls with hidden 'pad' arg we didn't have
wrapper for; all the others (lseek, mmap, pwrite, pread) already had
wrapper before.
 1.14 28-Jun-2003  he branches: 1.14.2;
Need to include linux_mmap.h to get size of struct linux_sys_mmap2_args.
 1.13 23-Jun-2003  christos PR/21937: Todd Vierling: Proper support for mmap2
 1.12 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.11 12-May-2002  jdolecek branches: 1.11.4;
hook in remaining 64bit fs syscalls
make most of stuff in linux_file64.c available unconditionally,
with exception of fcntl64, which is not present on Linux m68k
 1.10 10-Apr-2002  christos add getdents64
 1.9 22-Mar-2002  christos nuke mmap2 add mprotect
 1.8 17-Feb-2002  bjh21 branches: 1.8.2;
getrlimit and setrlimit now have Linux-specific implementations. Use them.
 1.7 15-Feb-2002  christos - add a real linux_sys___sysctl because the mib numbers are different.
implement only the kernel version getting entries.
- make the signal conversion functions consistent; dest is arg 1.
- make linux_fakedev deal with block and char devices differently.
- add linux_sys_ugetrlimit, and flesh out the regular get/setrlimit so
that they work properly.
- add linux_mmap2 [untested].
- bump kernel to 2.4.18, and make the date be valentine's day :-)
- linux_sys_*stat64 family was totally busted. Fix it.

tested only on i386.

Status:
gdb, telnet, work
jdk-1.4.0 extractor works, jdk still coredumps.

christos
 1.6 27-Jan-2002  bjh21 branches: 1.6.2;
Add support for breakpoints to ARMLinux emulation.
 1.5 27-Jan-2002  bjh21 Make syscall 0 an explicit call of linux_sys_nosys, as it is on i386. This
is necessary to get a prototype for linux_sys_nosys generated in syscallargs.h.
 1.4 23-Jan-2002  bjh21 Syscall 0 isn't syscall() on ARMLinux. Mark it UNIMPL instead.
 1.3 23-Jan-2002  bjh21 Add support for the ARM-specific syscalls in ARMLinux. These are invoked
by SWI numbers above 0x9f0000, but we re-map them down to somewhere just
after the end of the usual syscall range, since NetBSD doesn't handle
sparse syscall arrays well.

The only syscall I've actually implemented in this range is cacheflush(),
which was previously being mapped to fork(), causing ... interesting results.
 1.2 15-Jan-2002  bjh21 Shuffle uname calls around. It turns out we don't use the same names as
Linux does, so:
sys_olduname -> linux_sys_oldolduname
sys_uname -> linux_sys_olduname
sys_newuname -> linux_sys_uname
 1.1 14-Jan-2002  bjh21 Crude first cut at ARMLinux binary compatibility. Successfully runs
"/emul/linux/bin/echo hello, world", dynamically linked.
 1.6.2.4 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.6.2.3 16-Mar-2002  jdolecek Catch up with -current.
 1.6.2.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.6.2.1 27-Jan-2002  jdolecek file syscalls.master was added on branch kqueue on 2002-02-11 20:09:32 +0000
 1.8.2.6 20-Jun-2002  nathanw Catch up to -current.
 1.8.2.5 29-May-2002  nathanw #include <sys/sa.h> before <sys/syscallargs.h>, to provide sa_upcall_t
now that <sys/param.h> doesn't include <sys/sa.h>.

(Behold the Power of Ed)
 1.8.2.4 17-Apr-2002  nathanw Catch up to -current.
 1.8.2.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.8.2.2 28-Feb-2002  nathanw Catch up to -current.
 1.8.2.1 17-Feb-2002  nathanw file syscalls.master was added on branch nathanw_sa on 2002-02-28 04:12:49 +0000
 1.11.4.4 14-Jun-2004  jmc Pullup patch (requested by skrll in ticket #1708)

Bring netbsd-1-6 inline with -current sources after the mistakes in ticket #1686
 1.11.4.3 11-May-2004  tron Pull up revision 1.15 via patch (requested by wennmach in ticket #1686):
add Linux compat arg wrapper for ftruncate64(), and change linux compat
truncate64() wrapper to translate args structure
NetBSD truncate() and ftrucate() have hidden 'pad' argument, so we have
to do the argument translation
Problem found and patch supplied in PR kern/22360 by Ales Krenek
This is the last of syscalls with hidden 'pad' arg we didn't have
wrapper for; all the others (lseek, mmap, pwrite, pread) already had
wrapper before.
 1.11.4.2 20-Nov-2003  jmc Followup from ticket #1427. Need to include mmap2.h here or it won't compile
 1.11.4.1 22-Oct-2003  jmc Regen files (requested by tv in ticket #1427)

Proper support for mmap2
 1.14.2.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.14.2.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.14.2.4 24-Sep-2004  skrll Sync with HEAD.
 1.14.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.14.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.14.2.1 03-Aug-2004  skrll Sync with HEAD
 1.19.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.19.4.1 29-Apr-2005  kent sync with -current
 1.22.2.5 21-Jan-2008  yamt sync with head
 1.22.2.4 07-Dec-2007  yamt sync with head
 1.22.2.3 03-Sep-2007  yamt sync with head.
 1.22.2.2 26-Feb-2007  yamt sync with head.
 1.22.2.1 21-Jun-2006  yamt sync with head.
 1.23.14.1 19-Jun-2006  chap Sync with head.
 1.23.8.1 26-Jun-2006  yamt sync with head.
 1.23.4.1 09-Sep-2006  rpaulo sync with head
 1.26.2.1 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.27.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.28.22.3 18-Feb-2008  mjf Sync with HEAD.
 1.28.22.2 27-Dec-2007  mjf Sync with HEAD.
 1.28.22.1 19-Nov-2007  mjf Sync with HEAD.
 1.28.20.1 18-Nov-2007  bouyer Sync with HEAD
 1.28.16.2 23-Mar-2008  matt sync with HEAD
 1.28.16.1 09-Jan-2008  matt sync with HEAD
 1.28.14.1 21-Nov-2007  joerg Sync with HEAD.
 1.29.6.2 19-Jan-2008  bouyer Sync with HEAD
 1.29.6.1 02-Jan-2008  bouyer Sync with HEAD
 1.29.2.1 26-Dec-2007  ad Sync with head.
 1.33.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.33.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.34.2.1 18-May-2008  yamt sync with head.
 1.35.12.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.35.10.1 19-Jan-2009  skrll Sync with HEAD.
 1.35.8.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.35.4.2 14-May-2008  wrstuden Per discussion with ad, remove most of the #include <sys/sa.h> lines
as they were including sa.h just for the type(s) needed for syscallargs.h.

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

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

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

I think this reduction is very good thing.
 1.35.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.35.2.4 11-Aug-2010  yamt sync with head.
 1.35.2.3 11-Mar-2010  yamt sync with head
 1.35.2.2 20-Jun-2009  yamt sync with head
 1.35.2.1 04-May-2009  yamt sync with head.
 1.41.2.1 23-Jul-2009  jym Sync with HEAD.
 1.43.4.3 31-May-2011  rmind sync with head
 1.43.4.2 21-Apr-2011  rmind sync with head
 1.43.4.1 05-Mar-2011  rmind sync with head
 1.43.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.44.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.47.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.47.2.2 30-Oct-2012  yamt sync with head
 1.47.2.1 17-Apr-2012  yamt sync with head
 1.48.10.4 03-Dec-2017  jdolecek update from HEAD
 1.48.10.3 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.48.10.2 23-Jun-2013  tls resync from head
 1.48.10.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.50.4.1 18-May-2014  rmind sync with head
 1.54.2.1 10-Aug-2014  tls Rebase.
 1.61.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.62.2.3 05-Feb-2017  skrll Sync with HEAD
 1.62.2.2 05-Oct-2016  skrll Sync with HEAD
 1.62.2.1 06-Apr-2015  skrll Sync with HEAD
 1.63.2.3 20-Mar-2017  pgoyette Sync with HEAD
 1.63.2.2 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.63.2.1 26-Jul-2016  pgoyette Sync with HEAD
 1.65.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.67.14.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.69.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.69.2.1 15-Dec-2020  thorpej Add Linux eventfd, timerfd, and POSIX timer calls.
 1.80.2.1 02-Aug-2025  perseant Sync with HEAD
 1.4 29-May-2024  christos 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 03-Oct-1998  christos branches: 1.2.184; 1.2.194; 1.2.200; 1.2.210;
Attempt to fix the mess.
 1.1 01-Oct-1998  erh New makefiles for includes, syscall gen.
 1.2.210.1 10-Aug-2014  tls Rebase.
 1.2.200.1 18-May-2014  rmind sync with head
 1.2.194.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.184.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.10 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.9 26-Oct-2008  christos branches: 1.9.2; 1.9.4; 1.9.8;
futex support fixes from FreeBSD via cube+pengo.
 1.8 30-Aug-2006  matt branches: 1.8.52; 1.8.62;
Update to deal with options PTRACE
 1.7 11-Dec-2005  christos branches: 1.7.4; 1.7.8;
merge ktrace-lwp.
 1.6 13-Nov-2004  christos branches: 1.6.12;
Split out the setup stack function for the benefit of lkms.
XXX: Our lkm system sucks. We really need to be exporting symbols, but
that leads to symbol conflicts.
 1.5 31-Mar-2002  christos branches: 1.5.10;
bring the reverse signal mapping array into linux_signo.c
 1.4 12-Dec-1999  tron branches: 1.4.6; 1.4.8;
Incomplete but already working emulation of Linux's ptrace(2) for i386.
 1.3 03-Jan-1999  erh branches: 1.3.8; 1.3.14;
Speed up compilation by #include-ing C files from common into one file.
 1.2 03-Oct-1998  christos Attempt to fix the mess.
 1.1 01-Oct-1998  erh New list of files for the i386.
 1.3.14.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.3.8.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.4.8.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.4.6.1 17-Apr-2002  nathanw Catch up to -current.
 1.5.10.1 14-Nov-2004  skrll Sync with HEAD.
 1.6.12.1 30-Dec-2006  yamt sync with head.
 1.7.8.1 03-Sep-2006  yamt sync with head.
 1.7.4.1 09-Sep-2006  rpaulo sync with head
 1.8.62.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.8.52.1 17-Jan-2009  mjf Sync with HEAD.
 1.9.8.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.9.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.9.2.1 03-Mar-2009  skrll Sync with HEAD.
 1.18 12-Oct-2021  andvar fix various typos, mainly in comments.
 1.17 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.16 31-May-2011  njoly Fix path for fadvise64 files.
 1.15 30-May-2011  alnsn Add fadvise64 and fadvise64_64 syscalls to compat_linux and compat_linux32.
 1.14 02-Mar-2010  pooka branches: 1.14.2; 1.14.4;
Nuke fs_lfs.h included for unknown reasons (if there was a reason
other than "accident", i hereby declare that reason invalid)
 1.13 19-Nov-2008  ad branches: 1.13.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.12 02-Feb-2008  dsl branches: 1.12.6; 1.12.10; 1.12.12; 1.12.16; 1.12.18;
Extract the fcntl64() suppoort from linux_file64.c into linux_fcntl64.c
Unravel some of the knots that caused linux_file64.c to be compiled twice
for an amd64 kernel (once for linux and once for linux32) with different
parts being skipped each time.
 1.11 15-Jan-2008  njoly compat linux (and linux32) uid16 functions cleanup and fixes.

- Move uid16 functions to their own file linux_uid16.c, included by
needed archs (arm, i386 and m68k).
- Add new MI types linux_{u,g}id16_t.
- Add macros to handle linux_uid16_t and uid_t conversions.
- Add linux_sys_getres{uid,gid}16 syscalls, to fix an overflow with
bad sizes given to copyout when linux_sys_getres{uid,gid} are used.
- Update arm syscall table to use more uid16 functions.
 1.10 15-Aug-2007  ad branches: 1.10.2; 1.10.8; 1.10.14;
Changes to make ktrace LKM friendly and reduce ifdef KTRACE. Proposed
on tech-kern.
 1.9 13-Jun-2007  christos branches: 1.9.2; 1.9.6;
Add futex.
 1.8 09-Feb-2007  ad branches: 1.8.6; 1.8.8;
Merge newlock2 to head.
 1.7 18-Jan-2003  thorpej branches: 1.7.18; 1.7.48;
Merge the nathanw_sa branch.
 1.6 15-Nov-2001  lukem don't need <sys/types.h> when including <sys/param.h>
 1.5 13-Nov-2001  lukem add RCSIDs (including regeneration of files as appropriate)
 1.4 30-May-2001  mrg branches: 1.4.2;
use _KERNEL_OPT.
 1.3 17-Dec-2000  jdolecek branches: 1.3.2;
make LKM safe
 1.2 12-Dec-2000  jdolecek add emulation of Linux truncate64(2), ftruncate64(2), *stat64(2)
 1.1 03-Jan-1999  erh branches: 1.1.8;
Speed up compilation by #include-ing C files from common into one file.
 1.1.8.2 05-Jan-2001  bouyer Sync with HEAD
 1.1.8.1 13-Dec-2000  bouyer Sync with HEAD (for UBC fixes).
 1.3.2.4 29-May-2002  nathanw #include <sys/sa.h> before <sys/syscallargs.h>, to provide sa_upcall_t
now that <sys/param.h> doesn't include <sys/sa.h>.

(Behold the Power of Ed)
 1.3.2.3 08-Jan-2002  nathanw Catch up to -current.
 1.3.2.2 14-Nov-2001  nathanw Catch up to -current.
 1.3.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.4.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.7.48.1 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.7.18.4 04-Feb-2008  yamt sync with head.
 1.7.18.3 21-Jan-2008  yamt sync with head
 1.7.18.2 03-Sep-2007  yamt sync with head.
 1.7.18.1 26-Feb-2007  yamt sync with head.
 1.8.8.1 11-Jul-2007  mjf Sync with head.
 1.8.6.2 20-Aug-2007  ad Sync with HEAD.
 1.8.6.1 15-Jul-2007  ad Sync with head.
 1.9.6.1 16-Aug-2007  jmcneill Sync with HEAD.
 1.9.2.1 03-Sep-2007  skrll Sync with HEAD.
 1.10.14.1 19-Jan-2008  bouyer Sync with HEAD
 1.10.8.1 18-Feb-2008  mjf Sync with HEAD.
 1.10.2.1 23-Mar-2008  matt sync with HEAD
 1.12.18.1 19-Jan-2009  skrll Sync with HEAD.
 1.12.16.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.12.12.2 14-May-2008  wrstuden Per discussion with ad, remove most of the #include <sys/sa.h> lines
as they were including sa.h just for the type(s) needed for syscallargs.h.

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

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

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

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

Also, kern_sa.c has received partial cleanup. There's still more
to do, though.
 1.12.10.2 11-Mar-2010  yamt sync with head
 1.12.10.1 04-May-2009  yamt sync with head.
 1.12.6.1 17-Jan-2009  mjf Sync with HEAD.
 1.13.6.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.14.4.1 06-Jun-2011  jruoho Sync with HEAD.
 1.14.2.2 12-Jun-2011  rmind sync with head
 1.14.2.1 31-May-2011  rmind sync with head
 1.11 17-Dec-2013  njoly 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.10 28-Apr-2008  martin branches: 1.10.34; 1.10.44; 1.10.50;
Remove clause 3 and 4 from TNF licenses
 1.9 11-Dec-2005  christos branches: 1.9.70; 1.9.72; 1.9.74;
merge ktrace-lwp.
 1.8 26-Feb-2005  perry nuke trailing whitespace
 1.7 12-Feb-2001  manu branches: 1.7.24; 1.7.32; 1.7.34;
Clarified comments about the LINUX_SCERR_SIGN macro
 1.6 11-Feb-2001  manu Moved the fix for negative errno returned to userland on the PowerPC to a
more machine independent fashion
 1.5 18-Jan-2001  jdolecek kill local declaration of native_to_linux_errno[], one in common/linux_errno.h suffices
 1.4 11-Dec-2000  mycroft Introduce 2 new flags in types.h:
* __HAVE_SYSCALL_INTERN. If this is defined, e_syscall is replaced by
e_syscall_intern, which is called at key places in the kernel. This can be
used to set a MD syscall handler pointer. This obsoletes and replaces the
*_HAS_SEPARATED_SYSCALL flags.
* __HAVE_MINIMAL_EMUL. If this is defined, certain (deprecated) elements in
struct emul are omitted.
 1.3 04-Oct-1998  fvdl branches: 1.3.12;
Assign my copyright to TNF. Merge with others were appropriate.
Regen syscall files after script change.
 1.2 01-Oct-1998  erh Split compat/linux/linux_errno.h into i386 and common parts.
 1.1 28-Feb-1995  fvdl Added Linux compat code.
 1.3.12.3 12-Mar-2001  bouyer Sync with HEAD.
 1.3.12.2 11-Feb-2001  bouyer Sync with HEAD.
 1.3.12.1 13-Dec-2000  bouyer Sync with HEAD (for UBC fixes).
 1.7.34.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.7.32.1 29-Apr-2005  kent sync with -current
 1.7.24.1 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.9.74.1 16-May-2008  yamt sync with head.
 1.9.72.1 18-May-2008  yamt sync with head.
 1.9.70.1 02-Jun-2008  mjf Sync with HEAD.
 1.10.50.1 18-May-2014  rmind sync with head
 1.10.44.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.10.34.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 26-Nov-2021  ryo - LINUX_GO_RT0_SIGNATURE for compat_linux is no longer enabled by default.
it is now defined in each arch same as the other *_SIGNATURE definitions.
- add new LINUX32_GO_RT0_SIGNATURE for compat_linux32, and is defined in amd64 and aarch64.
 1.13 12-Feb-2017  chs es_arglen is now in units of bytes, update the emulations accordingly.
 1.12 09-Feb-2014  chs branches: 1.12.6; 1.12.10; 1.12.14;
account for the 16 bytes of AT_RANDOM data in the stack setup. fixes PR 48518.
use cprng_strong32() instead of random(). add AT_RANDOM support for linux32.
 1.11 21-Mar-2012  chs branches: 1.11.2; 1.11.4;
define LINUX_DEBUGLINK_SIGNATURE for i386 too.
this allows linux ldd to work.
 1.10 17-Nov-2008  ad branches: 1.10.16; 1.10.20; 1.10.22;
LINUX_GCC_SIGNATURE also matches NetBSD/i386 ELF binaries, so disable it.
 1.9 28-Apr-2008  martin branches: 1.9.6; 1.9.8;
Remove clause 3 and 4 from TNF licenses
 1.8 11-Dec-2005  christos branches: 1.8.70; 1.8.72; 1.8.74;
merge ktrace-lwp.
 1.7 21-Aug-2003  dsl branches: 1.7.16;
Hide prototype of linux_exec_setup_stack() inside #ifdef _KERNEL so
that sbin/sysctl will compile.
 1.6 08-Aug-2003  christos - GC all the setup_stack functions
- add one for linux/i386
 1.5 13-Nov-2002  jdolecek branches: 1.5.6;
add generic linux compat ELF copyargs function

this gives:
* linux sysconf(_SC_CLK_TCK) gives correct value for linux binaries (hz)
even if hz != 100
* glibc gets proper information on real/effective uid and enables
secure mode for suid binaries

g/c LINUX_COPYARGS_FUNCTION, replaced by linux ELF copyargs function
g/c alpha-specific linux ELF copyargs function and linux ELF defines
 1.4 21-Nov-2000  jdolecek branches: 1.4.2;
restructure struct emul and execsw, in preparation to make emulations LKMable:
* move all exec-type specific information from struct emul to execsw[] and
provide single struct emul per emulation
* elf:
- kern/exec_elf32.c:probe_funcs[] is gone, execsw[] how has one entry
per emulation and contains pointer to respective probe function
- interp is allocated via MALLOC() rather than on stack
- elf_args structure is allocated via MALLOC() rather than malloc()
* ecoff: the per-emulation hooks moved from alpha and mips specific code
to OSF1 and Ultrix compat code as appropriate, execsw[] has one entry per
emulation supporting ecoff with appropriate probe function
* the makecmds/probe functions don't set emulation, pointer to emulation is
part of appropriate execsw[] entry
* constify couple of structures
 1.3 17-Nov-2000  erh Make the linux compatibilty code work on the alpha. (horay!) (at last!)
Two main changes:
Create a linux_elf64_copyargs that uses the linux specific LinuxAuxInfo
structure. This is only used on the alpha. i386 and m68k use the
standard elf copyargs function.

Since linux's approach to binary compatibilty is to look as much
like osf1 as possible, add all the osf1 syscalls that we have
implemented to the linux syscall table. This includes get/setsysinfo,
ported from FreeBSD.

In order for linux compat to work you must have COMPAT_OSF1, COMPAT_43,
COMPAT_09, COMPAT_12 and COMPAT_13 on also.
 1.2 22-Oct-1998  erh branches: 1.2.12;
Define LINUX_GCC_SIGNATURE.
 1.1 01-Oct-1998  erh Add linux i386 machine type.
 1.2.12.1 22-Nov-2000  bouyer Sync with HEAD.
 1.4.2.1 11-Dec-2002  thorpej Sync with HEAD.
 1.5.6.4 04-Feb-2005  skrll Adapt to branch.
 1.5.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.5.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.5.6.1 03-Aug-2004  skrll Sync with HEAD
 1.7.16.1 21-Jun-2006  yamt sync with head.
 1.8.74.2 04-May-2009  yamt sync with head.
 1.8.74.1 16-May-2008  yamt sync with head.
 1.8.72.1 18-May-2008  yamt sync with head.
 1.8.70.2 17-Jan-2009  mjf Sync with HEAD.
 1.8.70.1 02-Jun-2008  mjf Sync with HEAD.
 1.9.8.1 19-Jan-2009  skrll Sync with HEAD.
 1.9.6.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.10.22.1 25-Mar-2012  bouyer Pull up following revision(s) (requested by chs in ticket #140):
sys/compat/linux/arch/i386/linux_exec.h: revision 1.11
define LINUX_DEBUGLINK_SIGNATURE for i386 too.
this allows linux ldd to work.
 1.10.20.1 05-Apr-2012  mrg sync to latest -current.
 1.10.16.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.10.16.1 17-Apr-2012  yamt sync with head
 1.11.4.1 18-May-2014  rmind sync with head
 1.11.2.2 03-Dec-2017  jdolecek update from HEAD
 1.11.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.12.14.1 21-Apr-2017  bouyer Sync with HEAD
 1.12.10.1 20-Mar-2017  pgoyette Sync with HEAD
 1.12.6.1 28-Aug-2017  skrll Sync with HEAD
 1.20 05-Sep-2020  riastradh 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.19 19-Jul-2020  maxv don't include opt_user_ldt.h when it is not needed
 1.18 12-Aug-2017  maxv Remove vm86.

Pass 3.
 1.17 29-Mar-2011  plunky branches: 1.17.14; 1.17.32;
tidy up include pathname to exclude undefined behaviour

"If the characters ', \, ", //, or /* occur in the sequence between
the < and > delimiters, the behavior is undefined."
 1.16 07-Jul-2010  chs branches: 1.16.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.15 23-Apr-2010  joerg Use struct segment_descriptor for pcb_fsd and pcb_gsd instead of int[2].
 1.14 23-Nov-2009  rmind branches: 1.14.2; 1.14.4;
Use lwp_getpcb() in compat code, clean from struct user.
 1.13 20-Sep-2009  taca Trying to fix build problem. Thanks to joerg's advise.
 1.12 29-Mar-2009  mrg - 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.11 26-Oct-2008  christos branches: 1.11.2; 1.11.4; 1.11.8;
changes from pengo that make initializing skype more reliable.
 1.10 26-Oct-2008  christos use a symbolic constant instead of 6.
 1.9 26-Oct-2008  christos use GUGS_SEL instead of 3.
 1.8 26-Oct-2008  ad Assert that the segment descriptors we generate for TLS will not allow
privilege elevation.
 1.7 26-Oct-2008  christos don't forget the percpu stuff and load gs immediately.
 1.6 25-Oct-2008  christos Add preliminary tls support for i386. Does not work yet. From FreeBSD.
 1.5 28-Apr-2008  martin branches: 1.5.6;
Remove clause 3 and 4 from TNF licenses
 1.4 19-Oct-2007  ad branches: 1.4.16; 1.4.18; 1.4.20;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.3 11-Dec-2005  christos branches: 1.3.30; 1.3.44; 1.3.46; 1.3.50;
merge ktrace-lwp.
 1.2 26-Feb-2005  perry branches: 1.2.4;
nuke trailing whitespace
 1.1 13-Nov-2004  christos branches: 1.1.2; 1.1.6; 1.1.8;
Split out the setup stack function for the benefit of lkms.
XXX: Our lkm system sucks. We really need to be exporting symbols, but
that leads to symbol conflicts.
 1.1.8.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.1.6.1 29-Apr-2005  kent sync with -current
 1.1.2.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.1.2.3 04-Feb-2005  skrll Adapt to branch.
 1.1.2.2 14-Nov-2004  skrll Sync with HEAD.
 1.1.2.1 13-Nov-2004  skrll file linux_exec_machdep.c was added on branch ktrace-lwp on 2004-11-14 08:15:33 +0000
 1.2.4.2 27-Oct-2007  yamt sync with head.
 1.2.4.1 21-Jun-2006  yamt sync with head.
 1.3.50.1 25-Oct-2007  bouyer Sync with HEAD.
 1.3.46.1 06-Nov-2007  matt sync with HEAD
 1.3.44.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.3.30.1 23-Oct-2007  ad Sync with head.
 1.4.20.4 11-Aug-2010  yamt sync with head.
 1.4.20.3 11-Mar-2010  yamt sync with head
 1.4.20.2 04-May-2009  yamt sync with head.
 1.4.20.1 16-May-2008  yamt sync with head.
 1.4.18.1 18-May-2008  yamt sync with head.
 1.4.16.2 17-Jan-2009  mjf Sync with HEAD.
 1.4.16.1 02-Jun-2008  mjf Sync with HEAD.
 1.5.6.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.11.8.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.11.4.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.11.2.1 28-Apr-2009  skrll Sync with HEAD.
 1.14.4.3 21-Apr-2011  rmind sync with head
 1.14.4.2 05-Mar-2011  rmind sync with head
 1.14.4.1 30-May-2010  rmind sync with head
 1.14.2.2 17-Aug-2010  uebayasi Sync with HEAD.
 1.14.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.16.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.17.32.1 28-Aug-2017  skrll Sync with HEAD
 1.17.14.1 03-Dec-2017  jdolecek update from HEAD
 1.8 25-Jun-2014  njoly Add a few missing open(2) flags (LINUX_O_*). Fix alpha wrong values.
 1.7 02-Nov-2010  chs branches: 1.7.18; 1.7.32;
define LINUX_O_CLOEXEC.
sort definitions by value.
consistently use hex instead of octal for the values.
 1.6 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.5 28-Apr-2008  martin branches: 1.5.20; 1.5.22;
Remove clause 3 and 4 from TNF licenses
 1.4 30-Sep-2001  manu branches: 1.4.116; 1.4.118; 1.4.120;
Added initial support for fcntl64 system call (file locking is not
implemented)
 1.3 04-Oct-1998  fvdl branches: 1.3.24; 1.3.26; 1.3.28;
Assign my copyright to TNF. Merge with others were appropriate.
Regen syscall files after script change.
 1.2 01-Oct-1998  erh Split linux_fcntl.h into i386 and common parts.
 1.1 28-Feb-1995  fvdl Added Linux compat code.
 1.3.28.1 01-Oct-2001  fvdl Catch up with -current.
 1.3.26.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.3.24.1 08-Oct-2001  nathanw Catch up to -current.
 1.4.120.2 09-Oct-2010  yamt sync with head
 1.4.120.1 16-May-2008  yamt sync with head.
 1.4.118.1 18-May-2008  yamt sync with head.
 1.4.116.1 02-Jun-2008  mjf Sync with HEAD.
 1.5.22.1 05-Mar-2011  rmind sync with head
 1.5.20.2 06-Nov-2010  uebayasi Sync with HEAD.
 1.5.20.1 22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.7.32.1 10-Aug-2014  tls Rebase.
 1.7.18.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.11 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.10 10-Dec-2000  fvdl branches: 1.10.122; 1.10.124; 1.10.126;
The gist of the Linux _IOX definitions was the same for all platforms;
move it to the MI linux_ioctl.h and only leave the MD bits in the MD
header files.
 1.9 04-Oct-1998  fvdl branches: 1.9.12; 1.9.22;
Assign my copyright to TNF. Merge with others were appropriate.
Regen syscall files after script change.
 1.8 01-Oct-1998  erh Split compat/linux/linux_ioctl.h into i386 and common parts.
 1.7 15-Jan-1998  christos PR/4794: Urban Boquist: Linux cdrom ioctls are missing
 1.6 04-Apr-1997  augustss * Move the Linux audio emulation into its own directory and rename it
OSS (aka VoxWare) audio emulation.
* Use the OSS audio emulation for Linux and FreeBSD.
* Add mixer emulation to the OSS emulator.
 1.5 19-Mar-1997  mycroft Emulate the SOUND_PCM_WRITE_CHANNELS ioctl. From PR 3356, by Lennart
Augustsson. Also add hooks for mixer ioctls.
 1.4 05-Apr-1996  christos Prototyping changes.
 1.3 08-Mar-1996  mycroft Separate ioctl emulation by group. Add (minimal) audio emulation.
 1.2 16-Aug-1995  mycroft Convert 230400 baud.
 1.1 28-Feb-1995  fvdl Added Linux compat code.
 1.9.22.1 30-Mar-2001  he Pull up revision 1.10 (requested by fvdl):
Add some required Linux emulation bits to support the Linux
version of VMware.
 1.9.12.1 13-Dec-2000  bouyer Sync with HEAD (for UBC fixes).
 1.10.126.1 16-May-2008  yamt sync with head.
 1.10.124.1 18-May-2008  yamt sync with head.
 1.10.122.1 02-Jun-2008  mjf Sync with HEAD.
 1.169 01-Nov-2021  thorpej Use "stack_t" instead of "struct sigaltstack", as the former is the
newer standardized name. NFC.
 1.168 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.167 09-Aug-2021  andvar fix typos in asymmetry, asymmetric(al), symmetrical.
 1.166 19-May-2019  maxv branches: 1.166.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.165 17-Sep-2017  maxv branches: 1.165.4;
Remove the second argument from USERMODE and KERNELMODE, it is unused
now that we don't have vm86 anymore.
 1.164 12-Aug-2017  maxv Remove vm86. Simplifies a number of critical places.

Pass 2.
 1.163 05-Feb-2017  maxv branches: 1.163.4; 1.163.6;
Rename ldt->ldtstore and gdt->gdtstore on i386. It reduces the diff with
amd64, and makes it easier to track down these variables on nxr - 'ldt'
and 'gdt' being common keywords.
 1.162 13-Jul-2016  maxv branches: 1.162.2; 1.162.4;
x86_alldisks can be NULL, so don't dereference it. Not tested, but obvious
enough.
 1.161 08-Dec-2015  christos Fix DIOCGPARTINFO
 1.160 08-Dec-2015  christos Replace DIOCGPART -> DIOCGPARTINFO which returns the data needed instead of
pointers.
 1.159 09-Nov-2014  maxv branches: 1.159.2;
Do not uselessly include <sys/malloc.h>.
 1.158 19-Feb-2014  dsl branches: 1.158.4;
Add explicit #include <x86/fpu.h> instead of relying on pcb.h including it.
 1.157 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.156 26-Jan-2014  dsl Remove support for 'external' floating point units and the MS-DOS
compatible method of handling floating point exceptions.
Make kernel support for teh fpu non-optional (486SX should still work).
Only 386 cpus support external fpu, and i386 support was removed years ago.
This means that the npx code no longer uses port 0xf0 or interupt 13.
All the "npx at isa" lines go from the configs, arch/i386/isa/npx.c
is now mandatory for all i386 kernels.
I've renamed npxinit() to fpuinit() and npxinit_cpu() to fpuinit_cpu()
to match the very similar amd64 functions.
The fpu of the boot cpu is now initialised by a direct call from
cpu_configure(), this enables FP emulation for a 486SX.
(for amd64 the cr0 values are set in locore.S and similar).
This fixes a long-standing bug in linux_setregs() - which did not
save the fpu regsiters if they were active.
I've test booted a single cpu i386 kernel (using anita).
amd64 builds - none of teh changes should affect it.
The i386 XEN kernels build, but I'm not sure where they set cr0, and
it might have got lost!
 1.155 19-Jan-2014  dsl Flatten the floating point register structures bu moving the
'environment' registers into the main strcuture.
There are x87 instructions that only affect the environment, but that
is no real excuse for all the sub-structures.
Rename fields so that there are far fewer collisions between the two
sets of field names.
 1.154 09-Dec-2013  dsl Missing change to the fxsave structure rename
 1.153 01-Dec-2013  christos revert fpu/pcu changes until we figure out what's wrong; they cause random
freezes
 1.152 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.151 18-Nov-2011  christos branches: 1.151.10; 1.151.14;
- add sigtimedwait support.
- merge the siginfo population code.
 1.150 04-Mar-2011  joerg branches: 1.150.4;
Refactor ps_strings access. Based on PK_32, write either the normal
version or the 32bit compat layout in execve1. Introduce a new function
copyin_psstrings for reading it back from userland and converting it to
the native layout. Refactor procfs to share most of the code with the
kern.proc_args sysctl handler.

This material is based upon work partially supported by
The NetBSD Foundation under a contract with Joerg Sonnenberger.
 1.149 07-Jul-2010  chs branches: 1.149.2; 1.149.4;
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.148 03-Feb-2010  wiz branches: 1.148.2; 1.148.4;
Remove extra parenthesis. Found by cppcheck, reported by
Henning Petersen in PR 42732.
 1.147 05-Jan-2010  mbalmer Remove extra semicolon.
 1.146 23-Nov-2009  rmind Use lwp_getpcb() in compat code, clean from struct user.
 1.145 29-May-2009  njoly Add native to linux siginfo si_status translation, used on i386 and
amd64.
 1.144 23-Apr-2009  njoly Convert si_code value from native to linux.
 1.143 21-Mar-2009  ad PR port-i386/40143 Viewing an mpeg transport stream with mplayer causes crash

Fix numerous problems:

1. LDT updates are not atomic.

2. Number of processes running with private LDTs and/or I/O bitmaps
is not capped. System with high maxprocs can be paniced.

3. LDTR can be leaked over context switch.

4. GDT slot allocations can race, giving the same LDT slot to two procs.

5. Incomplete interrupt/trap frames can be stacked.

6. In some rare cases segment faults are not handled correctly.
 1.142 11-Jan-2009  christos branches: 1.142.2;
merge christos-time_t
 1.141 25-Oct-2008  christos branches: 1.141.2; 1.141.4; 1.141.6;
Add preliminary tls support for i386. Does not work yet. From FreeBSD.
 1.140 21-Oct-2008  njoly Do not use native_to_linux_si_code() outside LINUX_NPTL; until i
figure a better way to handle it.
 1.139 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.138 18-Sep-2008  christos Define a PSL_CLEARSIG macro for the psl flags to be cleared on signal delivery
and use it everywhere.
 1.137 19-May-2008  njoly branches: 1.137.4;
Fix free() argument in linux_read_ldt.
 1.136 28-Apr-2008  martin branches: 1.136.2;
Remove clause 3 and 4 from TNF licenses
 1.135 24-Apr-2008  ad branches: 1.135.2;
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.134 21-Mar-2008  ad branches: 1.134.2;
Catch up with descriptor handling changes. See kern_descrip.c revision
1.173 for details.
 1.133 20-Dec-2007  dsl branches: 1.133.6;
Convert all the system call entry points from:
int foo(struct lwp *l, void *v, register_t *retval)
to:
int foo(struct lwp *l, const struct foo_args *uap, register_t *retval)
Fixup compat code to not write into 'uap' and (in some cases) to actually
pass a correctly formatted 'uap' structure with the right name to the
next routine.
A few 'compat' routines that just call standard ones have been deleted.
All the 'compat' code compiles (along with the kernels required to test
build it).
98% done by automated scripts.
 1.132 08-Dec-2007  dsl branches: 1.132.4;
ANSIfy most of the function definitions in sys/compat (but not ndis).
All by the magic of sed ...
 1.131 04-Dec-2007  dsl Remove all the __P
 1.130 19-Oct-2007  ad branches: 1.130.2; 1.130.4;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.129 30-Jun-2007  dsl branches: 1.129.6; 1.129.8; 1.129.12;
Call fp->f_ops->fo_ioctl() directly (not by sys_ioctl() for LINUX_VT_GETMODE
and LINUX_VT_SETMODE. One fewer use of the stackgap.
 1.128 23-Jun-2007  dsl Read and write the ldt without using the stackgap.
 1.127 13-Jun-2007  christos Get ready for NPTL but don't turn it on as of yet.
 1.126 21-May-2007  christos rename si_sigval -> si_value to match POSIX RTS.
 1.125 10-May-2007  christos - linux uname -m on x86 returns i{3,4,5,6}86 make it so.
- delete the machine sysctl that never worked, and gc linux_machine.
 1.124 16-Apr-2007  ad Share the sysarch stuff between the x86 ports. PR kern/36046.
 1.123 04-Mar-2007  christos branches: 1.123.2; 1.123.4;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.122 09-Feb-2007  ad branches: 1.122.2;
Merge newlock2 to head.
 1.121 29-Jan-2007  hubertf 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.120 26-Dec-2006  elad Adapt to recent machdep scope changes.

Pointed out by Kouichirou Hiratsuka, thanks!
 1.119 16-Nov-2006  christos branches: 1.119.2;
__unused removal on arguments; approved by core.
 1.118 14-Nov-2006  elad Clean some KAUTH_GENERIC_ISSUSER usage in compat code.
 1.117 14-Oct-2006  christos sprinkle __unused.
 1.116 12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.115 13-Sep-2006  christos branches: 1.115.2;
avoid empty if
 1.114 23-Jul-2006  ad branches: 1.114.4;
Use the LWP cached credentials where sane.
 1.113 14-May-2006  elad integrate kauth.
 1.112 11-Dec-2005  christos branches: 1.112.4; 1.112.6; 1.112.8; 1.112.10; 1.112.12;
merge ktrace-lwp.
 1.111 21-Aug-2005  yamt linux_machdepioctl: remove duplicated FILE_USE/UNUSE.
 1.110 25-Jun-2005  christos branches: 1.110.2;
- include <sys/wait.h> so that this compile
- use the code field directly, instead of redoing the logic.
- XXX: the status field must be wrong. I think that the _WSTATUS()
should not be used directly.
 1.109 24-Jun-2005  manu More accurate SIGCHLD code and status for siginfo
 1.108 22-Jun-2005  manu report the right process status
 1.107 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.106 26-Feb-2005  perry branches: 1.106.2;
nuke trailing whitespace
 1.105 13-Nov-2004  christos branches: 1.105.4; 1.105.6;
Remove setup stack function. It moved to linux_exec_machdep.c.
 1.104 13-Nov-2004  christos Add ptyfs pty device number translation.
 1.103 20-Oct-2004  thorpej Move boot device detection code from i386 and amd64 ports to x86_autoconf.c.
Rename i386_alldisks and x86_64_alldisks to x86_alldisks, adjust other
references to compensate.
 1.102 28-Jan-2004  yamt rename i386 mdlwp flags from MDP_ to MDL_
to avoid confusion with mdproc flags which also have MDP_ prefixes.
 1.101 08-Dec-2003  christos remove error(1) comment.
 1.100 06-Oct-2003  christos Catch up with chuck's stack changes. Don't map the linux stuff executable
and avoid mapping segments that have 0 size.
 1.99 25-Sep-2003  christos constify sendsig/trapsignal
 1.98 21-Sep-2003  jdolecek make compile after last change (!)
 1.97 21-Sep-2003  christos Now that we have siginfo, use it, instead of pretending to have one.
 1.96 06-Sep-2003  christos SA_SIGINFO changes
 1.95 24-Aug-2003  chs add support for non-executable mappings (where the hardware allows this)
and make the stack and heap non-executable by default. the changes
fall into two basic catagories:

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

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

originally from openbsd, adapted for netbsd by me.
 1.94 21-Aug-2003  hannken Fix syscall_vm86 argument:
struct trapframe -> struct trapframe *
 1.93 09-Aug-2003  christos Explain a diagnostic message a bit better, and make it a debug only message.
 1.92 08-Aug-2003  christos - GC all the setup_stack functions
- add one for linux/i386
 1.91 02-Aug-2003  jdolecek use copyout() instead of subyte()
 1.90 03-Jul-2003  christos Implement linux_rt_sigreturn for real. Add a hack for more plausible siginfo.
The java segv handler still segv's again inside the signal handler, but our
sample test program now works [gets the proper ucontext].
 1.89 29-Jun-2003  fvdl branches: 1.89.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.88 28-Jun-2003  darrenr Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records. The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V
 1.87 21-Mar-2003  dsl Change 'data' argument to fo_ioctl and fo_fcntl from 'caddr_t' to 'void *'.
Avoids a lot of casting and removes the need for some line breaks.
Removed a load of (caddr_t) casts from calls to copyin/copyout as well.
(approved by christos - he has a plan to remove caddr_t...)
 1.86 27-Feb-2003  yamt make compat_linux struct file interlock friendly.
 1.85 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.84 06-Dec-2002  junyoung Fix compile error.
 1.83 06-Dec-2002  christos add a linux_rt_sigframe to support SA_SIGINFO, and use it when SA_SIGINFO
is requested. This appears to be how linuxthreads decides which signal handler
to use.
 1.82 26-Nov-2002  christos rename sa_ -> linux_sa_
first attempt at providing siginfo_t to the signal handler.
 1.81 09-Oct-2002  junyoung Get rid of pcb_flags which is no longer existent.
 1.80 25-Sep-2002  thorpej Don't include <sys/map.h>.
 1.79 06-Sep-2002  gehenna Merge the gehenna-devsw branch into the trunk.

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

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

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

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

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

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

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

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

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

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

Changes to libc to use the new facility will be checked in later. Kernel
version not bumped; we will ride the 1.6C bump made recently.
 1.77 20-May-2002  jdolecek Fix bug introduced in rev. 1.69 - linux_fakedev() returned always
zero for nontranslated raw devices.
This fixes recently discovered jdb /dev/dsp stdin problem, reported
on current-users by Mark Davies.
 1.76 13-May-2002  simonb branches: 1.76.2;
Remove an unreachable "return 0;".
 1.75 02-Apr-2002  christos save/restore fs and gs; this should be pulled up.
 1.74 31-Mar-2002  christos make signal array handling uniform, and put signal arrays in a separate
file. This is simular to errno array handling.
 1.73 29-Mar-2002  christos 1. fill in the ldt.sd_xx field, for total compat with linux.
2. in setregs, use gdt's instead of ldt's because linux wants to play with
all the ldts. Apparently linuxthreads uses ldt's to allocate space for
pthread_t's.
 1.72 22-Mar-2002  christos sync with current reality and fix debugging.
 1.71 16-Mar-2002  christos make the stackgap_{init,alloc} functions MP friendly (i.e. pass struct proc *
in, instead of using curproc). While there add an optional size argument to
stackgap_init.
 1.70 16-Feb-2002  christos 1. load cr2 now that we have it.
2. ldt_info.base_addr == 0 && ldt_info.limit == 0 means zero the ldt
From Robert V. Barron's wabi patch.
 1.69 15-Feb-2002  christos - add a real linux_sys___sysctl because the mib numbers are different.
implement only the kernel version getting entries.
- make the signal conversion functions consistent; dest is arg 1.
- make linux_fakedev deal with block and char devices differently.
- add linux_sys_ugetrlimit, and flesh out the regular get/setrlimit so
that they work properly.
- add linux_mmap2 [untested].
- bump kernel to 2.4.18, and make the date be valentine's day :-)
- linux_sys_*stat64 family was totally busted. Fix it.

tested only on i386.

Status:
gdb, telnet, work
jdk-1.4.0 extractor works, jdk still coredumps.

christos
 1.68 13-Nov-2001  lukem add RCSIDs (including regeneration of files as appropriate)
 1.67 02-Aug-2001  thorpej Deal with the SSE FPU save format.
 1.66 15-Jul-2001  jdolecek execute signal handlers on separate signal stack, if it's been provided
 1.65 17-Jun-2001  sommerfeld branches: 1.65.2;
Add %fs/%gs to trap frame and save/restore them on
trap/interrupt/syscall entry from userspace.

Remove special-case "by hand" validation of fs/gs register values as
well as special handling of them in various signal handling paths.

Now, like %ds and %es, they are validated by the hardware on return to
userland.

This paves the way for the use of %fs for per-cpu data on
multiprocessor systems, and fixes an otherwise difficult-to-fix
interaction between threads/clone(2) and USER_LDT.

Discussed in advance with Frank van der Linden.
 1.64 14-Jun-2001  thorpej Fix a partial construction problem that can cause race conditions
between creation of a file descriptor and close(2) when using kernel
assisted threads. What we do is stick descriptors in the table, but
mark them as "larval". This causes essentially everything to treat
it as a non-existent descriptor, except for fdalloc(), which sees a
filled slot so that it won't (incorrectly) allocate it again. When
a descriptor is fully constructed, the code that has constructed it
marks it as "mature" (which actually clears the "larval" flag), and
things continue to work as normal.

While here, gather all the code that gets a descriptor from the table
into a fd_getfile() function, and call it, rather than having the
same (sometimes incorrect) code copied all over the place.
 1.63 30-May-2001  mrg use _KERNEL_OPT.
 1.62 26-Jan-2001  manu branches: 1.62.2;
Moved include <sys/ioctl.h> so that we can build without WSCONS enabled.
 1.61 18-Jan-2001  jdolecek constify
 1.60 18-Jan-2001  fvdl EINVAL -> ENOTTY
 1.59 09-Jan-2001  fvdl Add emulation of KIOCSOUND.
 1.58 29-Dec-2000  fvdl Implement KDGETMODE ioctl.
 1.57 29-Dec-2000  fvdl Under Linux it's possible to return values through the ioctl system
call directly (i.e. not a reference argument, but a direct return
value). So far I have only seen this with binaries that talk
to their own device modules, using non-standard ioctl calls.
Hence, allow for a pass-through ioctl call using PTIOCLINUX to
return EJUSTRETURN, signalling that the return value is in
the 'data' field of the structure, which can then be put in 'retval'.
 1.56 22-Dec-2000  jdolecek split off thread specific stuff from struct sigacts to struct sigctx, leaving
only signal handler array sharable between threads
move other random signal stuff from struct proc to struct sigctx

This addresses kern/10981 by Matthew Orgass.
 1.55 18-Dec-2000  fvdl For unknown ioctls, pass them through to a device using PTIOCLINUX,
so that it may deal with them if it knows them (i.e. LKMs which
deal with Linux binaries).
 1.54 12-Dec-2000  fvdl Allow for passing through of certain ranges of ioctl command values
directly to a device. The device has to be aware of how to handle
with these special ioctls. Useful for LKMs that deal with Linux
binaries.
 1.53 10-Dec-2000  thorpej Fix previous:
- EBADF, not NULL when a file descriptor can't be found.
- Check FIF_WANTCLOSE properly.
 1.52 10-Dec-2000  fvdl Add i386-specific code for a few ioctl calls.
 1.51 29-Nov-2000  jdolecek LKMify
 1.50 11-Jun-2000  veego branches: 1.50.2;
Remove the pcvt support.
 1.49 15-May-2000  jhawk branches: 1.49.2;
Remove conditionization upon XSERVER -- all the code
so conditionalized is already conditionalized on (NWSDISPLAY > 0),
so is wscons-specific. wscons has no conditionalization on XSERVER;
neither should the linux compatibility code.

Removing this is necessary to keep linux X server emulation functionining
after GENERIC rev 1.337 removing "options XSERVER" (relegating it
to the pccons/pcvt-specific, and therefore depricated).
 1.48 30-Mar-2000  augustss Kill register declarations.
 1.47 04-Oct-1999  fvdl branches: 1.47.2;
Handle the newer, larger sigset_t Linux now uses.
 1.46 08-Jan-1999  kleink Rearrange the emulation-specific setregs() entry to set up the FPU control
word *after* calling the native setregs(), which would clobber it again.
 1.45 04-Oct-1998  fvdl Assign my copyright to TNF. Merge with others were appropriate.
Regen syscall files after script change.
 1.44 03-Oct-1998  christos Attempt to fix the mess.
 1.43 01-Oct-1998  erh Moved here from arch/i386/i386/linux_machdep.c.
 1.42 11-Sep-1998  mycroft Substantial signal handling changes:
* Increase the size of sigset_t to accomodate 128 signals -- adding new
versions of sys_setprocmask(), sys_sigaction(), sys_sigpending() and
sys_sigsuspend() to handle the changed arguments.
* Abstract the guts of sys_sigaltstack(), sys_setprocmask(), sys_sigaction(),
sys_sigpending() and sys_sigsuspend() into separate functions, and call them
from all the emulations rather than hard-coding everything. (Avoids uses
the stackgap crap for these system calls.)
* Add a new flag (p_checksig) to indicate that a process may have signals
pending and userret() needs to do the full (slow) check.
* Eliminate SAS_ALTSTACK; it's exactly the inverse of SS_DISABLE.
* Correct emulation bugs with restoring SS_ONSTACK.
* Make the signal mask in the sigcontext always use the emulated mask format.
* Store signals internally in sigaction structures, rather than maintaining a
bunch of little sigsets for each SA_* bit.
* Keep track of where we put the signal trampoline, rather than figuring it out
in *_sendsig().
* Issue a warning when a non-emulated sigaction bit is observed.
* Add missing emulated signals, and a native SIGPWR (currently not used).
* Implement the `not reset when caught' semantics for relevant signals.

Note: Only code touched by the i386 port has been modified. Other ports and
emulations need to be updated.
 1.41 11-Jun-1998  drochner Since wscons can support VT_xxx ioctl()s, enable them if NWSDISPLAY > 0.
Implement KDGKBTYPE and KDGKBENT, this will make X servers happy.
 1.40 08-May-1998  kleink Fix some arithmetics lossage on typeless pointers.
 1.39 24-Jan-1998  mycroft Store the initial NPX control word appropriate for the emulation in the saved
FPU state, and use it when initializing the FPU on demand.
 1.38 24-Jan-1998  mycroft Need foo_exec.h.
 1.37 24-Jan-1998  mycroft Add local versions of setregs(), so I can tweak some registers later.
 1.36 22-Jan-1998  thorpej Generate dependencies on the USER_LDT option.
 1.35 15-Jan-1998  thorpej Generate dependencies on the VM86 option.
 1.34 16-Oct-1997  mycroft branches: 1.34.2;
Pull in vmparam.h as necessary.
 1.33 29-Oct-1996  sommerfe branches: 1.33.12;
Workaround for building linux-emulation LKM.
 1.32 13-Oct-1996  christos backout previous kprintf changes
 1.31 12-Oct-1996  thorpej Need <sys/exec.h> for the PS_STRINGS definition.
 1.30 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.29 03-May-1996  christos Prototype and gcc -Wall cleanups
 1.28 18-Apr-1996  mycroft Turn off the alignment check flag when entering a signal handler.
 1.27 12-Apr-1996  mycroft Turn off the trace flag when delivering a signal.
 1.26 11-Apr-1996  mycroft Export [gs]et_vflags(), and always use them when saving/restoring registers
in VM86 mode.
Allow changing of *all* PSL bits in VM86 mode; some applications don't work
right otherwise, and all the nasty bits are virtualized anyway.
Make sure PSL_VIF, PSL_VIP, and PSL_VM don't show up in the user's view of
the PSL.
 1.25 08-Mar-1996  mycroft Add a message to help us debug Linux compat.
 1.24 04-Jan-1996  jtc Changed name of sigaltstack's ss_base field to ss_sp to match XPG4.2 and
traditional usage.
 1.23 10-Oct-1995  mycroft Switch to user code and data selectors in the GDT while handling signals.
 1.22 10-Oct-1995  mycroft Add USERMODE() and KERNELMODE() macros, and use them.
 1.21 08-Oct-1995  fvdl Implement the KDGKBMODE ioctl for Linux (possible with pcvt 3.32).
 1.20 07-Oct-1995  mycroft Prefix names of system call implementation functions with `sys_'.
 1.19 19-Sep-1995  thorpej Make system calls conform to a standard prototype and bring those
prototypes into scope.
 1.18 08-Sep-1995  fvdl Fix PR #1445 (incorrect ifdef/else/endif), from Bill Sommerfeld via
John Kohl.
 1.17 07-Sep-1995  fvdl Get notion of VT number right.
 1.16 01-Sep-1995  mycroft SA_ONSTACK --> SS_ONSTACK
 1.15 31-Aug-1995  fvdl Only define some vars (one of pcvt-specific type) when pcvt is configured.
Fixes PR #1424 (from Mike Long)
 1.14 30-Aug-1995  fvdl Remove VT-switch disabling hack now that pcvt handles this.
 1.13 27-Aug-1995  fvdl Add some yucky code to emulate Linux VTs well enough to make svgalib
stuff work reasonably well.
 1.12 14-Aug-1995  mycroft Export bsd_to_linux_sig[], and use it.
 1.11 14-Aug-1995  mycroft Rearrange #includes.
 1.10 24-Jun-1995  christos Stackgap_init() now takes an p->p_emul argument.
 1.9 22-Jun-1995  fvdl Include file change.
 1.8 07-May-1995  mycroft Turn off a debugging printf().
 1.7 07-May-1995  mycroft Improve Linux signal emulation, and emulate the modify_ldt() call.
 1.6 06-May-1995  mycroft Add stub for linux_modify_ldt().
 1.5 01-May-1995  mycroft Fix typos.
 1.4 01-May-1995  mycroft Save and restore %fs and %gs across signals.
 1.3 01-May-1995  mycroft Update to match include files. Eliminate _ucodesel, _udatasel, and IdlePTD.
 1.2 22-Apr-1995  christos - added sunos_machdep.c for sun3, atari, amiga and mac68k.
- changed machdep.c and trap.c to use struct emul.
- remove ep_setup references.
- added struct emul to all emulations.
 1.1 07-Apr-1995  fvdl Changes because of proper Linux signal stackframe building, and
seperate signal trampoline code. Ugly hack in trap.c no longer
needed.
 1.33.12.1 08-Sep-1997  thorpej Significantly restructure the way signal state for a process is stored.
Rather than using bitmasks to redundantly store the information kept
in the process's sigacts (because the sigacts was kept in the u-area),
hang sigacts directly off the process, and access it directly.

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

Make sigacts sharable by adding reference counting.
 1.34.2.1 29-Jan-1998  mellon Pull up 1.37-1.39 (mycroft)
 1.47.2.6 11-Feb-2001  bouyer Sync with HEAD.
 1.47.2.5 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.47.2.4 05-Jan-2001  bouyer Sync with HEAD
 1.47.2.3 13-Dec-2000  bouyer Sync with HEAD (for UBC fixes).
 1.47.2.2 08-Dec-2000  bouyer Sync with HEAD.
 1.47.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.49.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.50.2.4 03-Apr-2002  he Pull up revision 1.75 (requested by christos):
Fix restoral of %fs / %gs in i386 emulation code.
 1.50.2.3 17-Jun-2001  he Pull up revision 1.65 (requested by sommerfeld):
Add %fs/%gs to trap frame and save/restore them on trap/interupt/
syscall entry from userspace.

Remove special-case ``by hand'' validation of %fs/%gs register
values s well as special handling of them in various signal
handling paths. Now, like %ds and %es, they are validated by
the hardware on return to userland.

This paves the way for the use of %fs for per-cpu data on multi-
processor systems, and fixes an otherwise difficult-to-fix
interaction between threads/clone(2) and USER_LDT.
 1.50.2.2 15-May-2001  he Pull up revision 1.62 (requested by drochner):
Fix a build problem where COMPAT_LINUX is defined, but wscons is
not present. Fixes PR#12886.
 1.50.2.1 30-Mar-2001  he Pull up revisions 1.52-1.60 (via patch, requested by fvdl):
Add some required Linux emulation bits to support the Linux
version of VMware.
 1.62.2.16 11-Dec-2002  thorpej Sync with HEAD.
 1.62.2.15 18-Oct-2002  nathanw Catch up to -current.
 1.62.2.14 17-Sep-2002  nathanw Catch up to -current.
 1.62.2.13 01-Aug-2002  nathanw Catch up to -current.
 1.62.2.12 12-Jul-2002  nathanw No longer need to pull in lwp.h; proc.h pulls it in for us.
 1.62.2.11 24-Jun-2002  nathanw Curproc->curlwp renaming.

Change uses of "curproc->l_proc" back to "curproc", which is more like the
original use. Bare uses of "curproc" are now "curlwp".

"curproc" is now #defined in proc.h as ((curlwp) ? (curlwp)->l_proc) : NULL)
so that it is always safe to reference curproc (*de*referencing curproc
is another story, but that's always been true).
 1.62.2.10 20-Jun-2002  nathanw Catch up to -current.
 1.62.2.9 29-May-2002  nathanw #include <sys/sa.h> before <sys/syscallargs.h>, to provide sa_upcall_t
now that <sys/param.h> doesn't include <sys/sa.h>.

(Behold the Power of Ed)
 1.62.2.8 17-Apr-2002  nathanw Catch up to -current.
 1.62.2.7 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.62.2.6 28-Feb-2002  nathanw p->p_addr ==> l->l_addr
 1.62.2.5 28-Feb-2002  nathanw Catch up to -current.
 1.62.2.4 14-Nov-2001  nathanw Catch up to -current.
 1.62.2.3 24-Aug-2001  nathanw Catch up with -current.
 1.62.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.62.2.1 05-Mar-2001  nathanw Initial commit of scheduler activations and lightweight process support.
 1.65.2.6 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.65.2.5 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.65.2.4 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.65.2.3 16-Mar-2002  jdolecek Catch up with -current.
 1.65.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.65.2.1 03-Aug-2001  lukem update to -current
 1.76.2.3 15-Jul-2002  gehenna catch up with -current.
 1.76.2.2 30-May-2002  gehenna Catch up with -current.
 1.76.2.1 16-May-2002  gehenna Replace the direct-access to devsw table with calling devsw API.
Replace the block major -> name conversion function with devsw API.
 1.89.2.8 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.89.2.7 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.89.2.6 14-Nov-2004  skrll Sync with HEAD.
 1.89.2.5 02-Nov-2004  skrll Sync with HEAD.
 1.89.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.89.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.89.2.2 03-Aug-2004  skrll Sync with HEAD
 1.89.2.1 02-Jul-2003  darrenr Apply the aborted ktrace-lwp changes to a specific branch. This is just for
others to review, I'm concerned that patch fuziness may have resulted in some
errant code being generated but I'll look at that later by comparing the diff
from the base to the branch with the file I attempt to apply to it. This will,
at the very least, put the changes in a better context for others to review
them and attempt to tinker with removing passing of 'struct lwp' through
the kernel.
 1.105.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.105.4.1 29-Apr-2005  kent sync with -current
 1.106.2.1 28-Aug-2005  tron Pull up following revision(s) (requested by yamt in ticket #701):
sys/compat/linux/arch/i386/linux_machdep.c: revision 1.111
linux_machdepioctl: remove duplicated FILE_USE/UNUSE.
 1.110.2.8 24-Mar-2008  yamt sync with head.
 1.110.2.7 21-Jan-2008  yamt sync with head
 1.110.2.6 07-Dec-2007  yamt sync with head
 1.110.2.5 27-Oct-2007  yamt sync with head.
 1.110.2.4 03-Sep-2007  yamt sync with head.
 1.110.2.3 26-Feb-2007  yamt sync with head.
 1.110.2.2 30-Dec-2006  yamt sync with head.
 1.110.2.1 21-Jun-2006  yamt sync with head.
 1.112.12.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.112.10.3 06-May-2006  christos - Move kauth_cred_t declaration to <sys/types.h>
- Cleanup struct ucred; forward declarations that are unused.
- Don't include <sys/kauth.h> in any header, but include it in the c files
that need it.

Approved by core.
 1.112.10.2 10-Mar-2006  elad generic_authorize() -> kauth_authorize_generic().
 1.112.10.1 08-Mar-2006  elad Adapt to kernel authorization KPI.
 1.112.8.3 14-Sep-2006  yamt sync with head.
 1.112.8.2 11-Aug-2006  yamt sync with head
 1.112.8.1 24-May-2006  yamt sync with head.
 1.112.6.1 01-Jun-2006  kardel Sync with head.
 1.112.4.1 09-Sep-2006  rpaulo sync with head
 1.114.4.7 01-Feb-2007  ad Sync with head.
 1.114.4.6 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.114.4.5 19-Jan-2007  ad Fix Linux compatability for i386, others to follow later.
 1.114.4.4 18-Jan-2007  yamt linux_restore_sigcontext: fix an unused variable in the case of !VM86.
 1.114.4.3 12-Jan-2007  ad Sync with head.
 1.114.4.2 18-Nov-2006  ad Sync with head.
 1.114.4.1 24-Oct-2006  ad - Redo LWP locking slightly and fix some races.
- Fix some locking botches.
- Make signal mask / stack per-proc for SA processes.
- Add _lwp_kill().
 1.115.2.2 10-Dec-2006  yamt sync with head.
 1.115.2.1 22-Oct-2006  yamt sync with head
 1.119.2.1 06-Jan-2007  bouyer Pull up following revision(s) (requested by elad in ticket #317):
sys/compat/linux/arch/i386/linux_machdep.c: revision 1.120
sys/dev/wscons/wsdisplay_compat_usl.c: revision 1.38
Adapt to recent machdep scope changes.
Pointed out by Kouichirou Hiratsuka, thanks!
 1.122.2.3 17-May-2007  yamt sync with head.
 1.122.2.2 07-May-2007  yamt sync with head.
 1.122.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.123.4.1 11-Jul-2007  mjf Sync with head.
 1.123.2.3 23-Oct-2007  ad Sync with head.
 1.123.2.2 15-Jul-2007  ad Sync with head.
 1.123.2.1 27-May-2007  ad Sync with head.
 1.129.12.1 25-Oct-2007  bouyer Sync with HEAD.
 1.129.8.2 09-Jan-2008  matt sync with HEAD
 1.129.8.1 06-Nov-2007  matt sync with HEAD
 1.129.6.2 09-Dec-2007  jmcneill Sync with HEAD.
 1.129.6.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.130.4.2 26-Dec-2007  ad Sync with head.
 1.130.4.1 08-Dec-2007  ad Sync with head.
 1.130.2.2 27-Dec-2007  mjf Sync with HEAD.
 1.130.2.1 08-Dec-2007  mjf Sync with HEAD.
 1.132.4.1 02-Jan-2008  bouyer Sync with HEAD
 1.133.6.4 17-Jan-2009  mjf Sync with HEAD.
 1.133.6.3 28-Sep-2008  mjf Sync with HEAD.
 1.133.6.2 02-Jun-2008  mjf Sync with HEAD.
 1.133.6.1 03-Apr-2008  mjf Sync with HEAD.
 1.134.2.2 04-Jun-2008  yamt sync with head
 1.134.2.1 18-May-2008  yamt sync with head.
 1.135.2.5 11-Aug-2010  yamt sync with head.
 1.135.2.4 11-Mar-2010  yamt sync with head
 1.135.2.3 20-Jun-2009  yamt sync with head
 1.135.2.2 04-May-2009  yamt sync with head.
 1.135.2.1 16-May-2008  yamt sync with head.
 1.136.2.5 24-Sep-2008  wrstuden Merge in changes between wrstuden-revivesa-base-2 and
wrstuden-revivesa-base-3.
 1.136.2.4 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.136.2.3 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.136.2.2 14-May-2008  wrstuden Per discussion with ad, remove most of the #include <sys/sa.h> lines
as they were including sa.h just for the type(s) needed for syscallargs.h.

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

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

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

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

Also, kern_sa.c has received partial cleanup. There's still more
to do, though.
 1.137.4.2 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.137.4.1 19-Oct-2008  haad Sync with HEAD.
 1.141.6.2 09-Nov-2008  christos account for major and minor being unsigned long long
 1.141.6.1 25-Oct-2008  christos file linux_machdep.c was added on branch christos-time_t on 2008-11-09 02:05:20 +0000
 1.141.4.1 04-Apr-2009  snj Pull up following revision(s) (requested by ad in ticket #656):
sys/arch/amd64/amd64/gdt.c: revision 1.21 via patch
sys/arch/amd64/amd64/machdep.c: revision 1.129 via patch
sys/arch/i386/i386/gdt.c: revision 1.47 via patch
sys/arch/i386/i386/kvm86.c: revision 1.17 via patch
sys/arch/i386/i386/locore.S: revision 1.85 via patch
sys/arch/i386/i386/machdep.c: revision 1.666 via patch
sys/arch/i386/i386/vector.S: revision 1.45 via patch
sys/arch/i386/include/pcb.h: revision 1.47 via patch
sys/arch/x86/include/pmap.h: revision 1.22 via patch
sys/arch/x86/include/sysarch.h: revision 1.8 via patch
sys/arch/x86/x86/pmap.c: revision 1.80 via patch
sys/arch/x86/x86/sys_machdep.c: revision 1.17 via patch
sys/compat/linux/arch/i386/linux_machdep.c: revision 1.143 via patch
sys/kern/init_main.c: revision 1.384 via patch
PR port-i386/40143 Viewing an mpeg transport stream with mplayer causes crash
Fix numerous problems:
1. LDT updates are not atomic.
2. Number of processes running with private LDTs and/or I/O bitmaps
is not capped. System with high maxprocs can be paniced.
3. LDTR can be leaked over context switch.
4. GDT slot allocations can race, giving the same LDT slot to two procs.
5. Incomplete interrupt/trap frames can be stacked.
6. In some rare cases segment faults are not handled correctly.
 1.141.2.2 28-Apr-2009  skrll Sync with HEAD.
 1.141.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.142.2.2 23-Jul-2009  jym Sync with HEAD.
 1.142.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.148.4.1 05-Mar-2011  rmind sync with head
 1.148.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.149.4.1 05-Mar-2011  bouyer Sync with HEAD
 1.149.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.150.4.2 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.150.4.1 17-Apr-2012  yamt sync with head
 1.151.14.1 18-May-2014  rmind sync with head
 1.151.10.2 03-Dec-2017  jdolecek update from HEAD
 1.151.10.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.158.4.1 17-Jan-2015  martin Pull up following revision(s) (requested by maxv in ticket #427):
sys/compat/svr4/svr4_schedctl.c: revision 1.8
sys/netinet/tcp_timer.c: revision 1.88
sys/miscfs/genfs/layer_vfsops.c: revision 1.45
sys/compat/svr4/svr4_ioctl.c: revision 1.37
sys/ufs/chfs/chfs_vfsops.c: revision 1.14
sys/miscfs/fdesc/fdesc_vfsops.c: revision 1.91
sys/compat/linux/arch/i386/linux_ptrace.c: revision 1.30
sys/compat/common/kern_time_50.c: revision 1.28
sys/netinet6/ip6_forward.c: revision 1.74
sys/miscfs/umapfs/umap_vnops.c: revision 1.57
sys/compat/svr4/svr4_fcntl.c: revision 1.74
distrib/sets/lists/comp/mi: revision 1.1931
sys/netinet6/udp6_output.c: revision 1.46
sys/fs/puffs/puffs_compat.c: revision 1.3
sys/fs/udf/udf_rename.c: revision 1.11
sys/compat/svr4/svr4_filio.c: revision 1.24
sys/fs/udf/udf_rename.c: revision 1.12
sys/netinet/tcp_usrreq.c: revision 1.202
sys/miscfs/umapfs/umap_subr.c: revision 1.29
sys/compat/linux/common/linux_fadvise64.c: revision 1.3
sys/netinet/if_atm.c: revision 1.34
sys/miscfs/procfs/procfs_subr.c: revision 1.106
sys/miscfs/genfs/layer_subr.c: revision 1.37
sys/netinet/tcp_sack.c: revision 1.30
sys/compat/freebsd/freebsd_misc.c: revision 1.33
sys/compat/freebsd/freebsd_file.c: revision 1.33
sys/ufs/chfs/chfs_vnode.c: revision 1.12
sys/compat/svr4/svr4_ttold.c: revision 1.34
sys/compat/linux/common/linux_file.c: revision 1.114
sys/compat/linux/arch/mips/linux_machdep.c: revision 1.43
sys/compat/linux/common/linux_signal.c: revision 1.76
sys/compat/common/compat_util.c: revision 1.46
sys/compat/linux/arch/arm/linux_ptrace.c: revision 1.18
sys/compat/svr4/svr4_sockio.c: revision 1.36
sys/compat/linux/arch/arm/linux_machdep.c: revision 1.32
sys/compat/svr4/svr4_signal.c: revision 1.66
sys/kern/kern_exec.c: revision 1.410
sys/fs/puffs/puffs_vfsops.c: revision 1.115
sys/compat/svr4/svr4_exec_elf64.c: revision 1.15
sys/compat/linux/arch/i386/linux_machdep.c: revision 1.159
sys/compat/linux/arch/alpha/linux_machdep.c: revision 1.50
sys/compat/linux32/common/linux32_misc.c: revision 1.24
sys/netinet/in_pcb.c: revision 1.153
sys/sys/malloc.h: revision 1.116
sys/compat/common/if_43.c: revision 1.9
share/man/man9/Makefile: revision 1.380
sys/netinet/tcp_vtw.c: revision 1.12
sys/miscfs/umapfs/umap_vfsops.c: revision 1.95
sys/ufs/ext2fs/ext2fs_vfsops.c: revision 1.186
sys/compat/common/uipc_syscalls_43.c: revision 1.46
sys/ufs/ext2fs/ext2fs_vnops.c: revision 1.115
sys/fs/puffs/puffs_msgif.c: revision 1.97
sys/compat/svr4/svr4_ipc.c: revision 1.27
sys/compat/linux/common/linux_exec.c: revision 1.117
sys/ufs/ext2fs/ext2fs_readwrite.c: revision 1.66
sys/netinet/tcp_output.c: revision 1.179
sys/compat/svr4/svr4_termios.c: revision 1.28
sys/fs/udf/udf_strat_bootstrap.c: revision 1.4
sys/fs/puffs/puffs_subr.c: revision 1.67
sys/fs/puffs/puffs_node.c: revision 1.36
sys/miscfs/overlay/overlay_vnops.c: revision 1.21
sys/fs/cd9660/cd9660_node.c: revision 1.34
sys/netinet/raw_ip.c: revision 1.146
sys/sys/mallocvar.h: revision 1.13
sys/miscfs/overlay/overlay_vfsops.c: revision 1.63
share/man/man9/malloc.9: revision 1.50
sys/netinet6/dest6.c: revision 1.18
sys/compat/linux/common/linux_uselib.c: revision 1.33
sys/compat/linux/common/linux_socket.c: revision 1.120
share/man/man9/malloc.9: revision 1.51
sys/netinet/tcp_subr.c: revision 1.257
sys/compat/linux/common/linux_socketcall.c: revision 1.45
sys/compat/linux/common/linux_fadvise64_64.c: revision 1.3
sys/compat/freebsd/freebsd_ipc.c: revision 1.17
sys/compat/linux/common/linux_misc_notalpha.c: revision 1.109
sys/compat/linux/arch/alpha/linux_pipe.c: revision 1.17
sys/netinet6/in6_pcb.c: revision 1.132
sys/netinet6/in6_ifattach.c: revision 1.94
sys/compat/svr4/svr4_exec_elf32.c: revision 1.15
sys/miscfs/nullfs/null_vfsops.c: revision 1.90
sys/fs/cd9660/cd9660_util.c: revision 1.12
sys/compat/linux/arch/powerpc/linux_machdep.c: revision 1.48
sys/compat/freebsd/freebsd_exec_elf32.c: revision 1.20
sys/miscfs/procfs/procfs_vfsops.c: revision 1.94
sys/compat/linux/arch/powerpc/linux_ptrace.c: revision 1.28
sys/compat/linux/common/linux_sched.c: revision 1.67
sys/compat/linux/common/linux_exec_aout.c: revision 1.67
sys/compat/linux/common/linux_pipe.c: revision 1.67
sys/compat/linux/common/linux_llseek.c: revision 1.34
sys/compat/linux/arch/mips/linux_ptrace.c: revision 1.10
Do not uselessly include <sys/malloc.h>.
Cleanup:
- remove struct kmembuckets (dead)
- correctly deadify MALLOC_XX
- remove MALLOC_DEFINE_LIMIT and MALLOC_JUSTDEFINE_LIMIT (dead)
- remove malloc_roundup(), malloc_type_setlimit(), MALLOC_DEFINE_LIMIT()
and MALLOC_JUSTDEFINE_LIMIT() from man 9 malloc
New sentence, new line. Bump date for previous.
Obsolete malloc_roundup(9), malloc_type_setlimit(9) and MALLOC_DEFINE_LIMIT(9)
man pages.
 1.159.2.3 28-Aug-2017  skrll Sync with HEAD
 1.159.2.2 05-Oct-2016  skrll Sync with HEAD
 1.159.2.1 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.162.4.1 21-Apr-2017  bouyer Sync with HEAD
 1.162.2.2 20-Mar-2017  pgoyette Sync with HEAD
 1.162.2.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.163.6.1 21-Jun-2023  martin Pull up following revision(s) (requested by riastradh in ticket #1836):

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

sys/compat: Memset zero before copyout.

Just in case of uninitialized padding which would lead to kernel
stack disclosure. If the compiler can prove the memset redundant
then it can optimize it away; otherwise better safe than sorry.
 1.163.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.165.4.1 10-Jun-2019  christos Sync with HEAD
 1.166.2.1 03-Aug-2022  martin Pull up following revision(s), all via patch
(requested by riastradh in ticket #1487):

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

sys/compat: Memset zero before copyout.

Just in case of uninitialized padding which would lead to kernel
stack disclosure. If the compiler can prove the memset redundant
then it can optimize it away; otherwise better safe than sorry.
 1.37 07-Jul-2010  chs many changes for COMPAT_LINUX:
- update the linux syscall table for each platform.
- support new-style (NPTL) linux pthreads on all platforms.
clone() with CLONE_THREAD uses 1 process with many LWPs
instead of separate processes.
- move the contents of sys__lwp_setprivate() into a new
lwp_setprivate() and use that everywhere.
- update linux_release[] and linux32_release[] to "2.6.18".
- adjust placement of emul fork/exec/exit hooks as needed
and adjust other emul code to match.
- convert all struct emul definitions to use named initializers.
- change the pid allocator to allow multiple pids to refer to the same proc.
- remove a few fields from struct proc that are no longer needed.
- disable the non-functional "vdso" code in linux32/amd64,
glibc works fine without it.
- fix a race in the futex code where we could miss a wakeup after
a requeue operation.
- redo futex locking to be a little more efficient.
 1.36 12-Nov-2008  ad branches: 1.36.6; 1.36.8;
Remove LKMs and switch to the module framework, pass 1.

Proposed on tech-kern@.
 1.35 26-Oct-2008  christos branches: 1.35.2;
use a symbolic constant instead of 6.
 1.34 25-Oct-2008  christos Add preliminary tls support for i386. Does not work yet. From FreeBSD.
 1.33 28-Apr-2008  martin branches: 1.33.6;
Remove clause 3 and 4 from TNF licenses
 1.32 13-Jun-2007  christos branches: 1.32.28; 1.32.30; 1.32.32;
Get ready for NPTL but don't turn it on as of yet.
 1.31 13-Jun-2007  christos cleanup some bitrot; from Matthew Orgass
 1.30 10-May-2007  christos - linux uname -m on x86 returns i{3,4,5,6}86 make it so.
- delete the machine sysctl that never worked, and gc linux_machine.
 1.29 11-Dec-2005  christos branches: 1.29.26; 1.29.30; 1.29.32;
merge ktrace-lwp.
 1.28 13-Nov-2004  christos branches: 1.28.12;
Add ptyfs pty device number translation.
 1.27 06-Sep-2003  christos SA_SIGINFO changes
 1.26 03-Jul-2003  christos Implement linux_rt_sigreturn for real. Add a hack for more plausible siginfo.
The java segv handler still segv's again inside the signal handler, but our
sample test program now works [gets the proper ucontext].
 1.25 06-Dec-2002  christos branches: 1.25.6;
add a linux_rt_sigframe to support SA_SIGINFO, and use it when SA_SIGINFO
is requested. This appears to be how linuxthreads decides which signal handler
to use.
 1.24 26-Nov-2002  christos rename sa_ -> linux_sa_
first attempt at providing siginfo_t to the signal handler.
 1.23 06-Sep-2002  gehenna Merge the gehenna-devsw branch into the trunk.

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

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

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

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

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

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

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

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

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

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

Changes to libc to use the new facility will be checked in later. Kernel
version not bumped; we will ride the 1.6C bump made recently.
 1.21 15-Feb-2002  christos branches: 1.21.8;
- add a real linux_sys___sysctl because the mib numbers are different.
implement only the kernel version getting entries.
- make the signal conversion functions consistent; dest is arg 1.
- make linux_fakedev deal with block and char devices differently.
- add linux_sys_ugetrlimit, and flesh out the regular get/setrlimit so
that they work properly.
- add linux_mmap2 [untested].
- bump kernel to 2.4.18, and make the date be valentine's day :-)
- linux_sys_*stat64 family was totally busted. Fix it.

tested only on i386.

Status:
gdb, telnet, work
jdk-1.4.0 extractor works, jdk still coredumps.

christos
 1.20 09-Jan-2001  fvdl branches: 1.20.2; 1.20.4;
Add emulation of KIOCSOUND.
 1.19 29-Dec-2000  fvdl Implement KDGETMODE ioctl.
 1.18 14-Dec-2000  mycroft Some namespace hiding I forgot before.
 1.17 12-Dec-2000  fvdl Allow for passing through of certain ranges of ioctl command values
directly to a device. The device has to be aware of how to handle
with these special ioctls. Useful for LKMs that deal with Linux
binaries.
 1.16 11-Dec-2000  mycroft Introduce 2 new flags in types.h:
* __HAVE_SYSCALL_INTERN. If this is defined, e_syscall is replaced by
e_syscall_intern, which is called at key places in the kernel. This can be
used to set a MD syscall handler pointer. This obsoletes and replaces the
*_HAS_SEPARATED_SYSCALL flags.
* __HAVE_MINIMAL_EMUL. If this is defined, certain (deprecated) elements in
struct emul are omitted.
 1.15 10-Dec-2000  fvdl Add i386-specific code for a few ioctl calls.
 1.14 09-Dec-2000  christos how many different prototypes does linux_syscall() need finally? sheesh!
 1.13 02-Dec-2000  jdolecek if machdep define LINUX_MACHDEP_HAS_SEPARATED_SYSCALL is defined, put
linux_syscall() to emul_linux
define LINUX_MACHDEP_HAS_SEPARATED_SYSCALL for i386
 1.12 11-Jun-2000  veego branches: 1.12.2;
Fix a comment.
 1.11 11-Jun-2000  veego Remove the pcvt support.
 1.10 04-Oct-1999  fvdl branches: 1.10.2; 1.10.10;
Handle the newer, larger sigset_t Linux now uses.
 1.9 04-Oct-1998  fvdl Assign my copyright to TNF. Merge with others were appropriate.
Regen syscall files after script change.
 1.8 01-Oct-1998  erh Moved here from arch/i386/include/linux_machdep.h.
 1.7 11-Sep-1998  mycroft Substantial signal handling changes:
* Increase the size of sigset_t to accomodate 128 signals -- adding new
versions of sys_setprocmask(), sys_sigaction(), sys_sigpending() and
sys_sigsuspend() to handle the changed arguments.
* Abstract the guts of sys_sigaltstack(), sys_setprocmask(), sys_sigaction(),
sys_sigpending() and sys_sigsuspend() into separate functions, and call them
from all the emulations rather than hard-coding everything. (Avoids uses
the stackgap crap for these system calls.)
* Add a new flag (p_checksig) to indicate that a process may have signals
pending and userret() needs to do the full (slow) check.
* Eliminate SAS_ALTSTACK; it's exactly the inverse of SS_DISABLE.
* Correct emulation bugs with restoring SS_ONSTACK.
* Make the signal mask in the sigcontext always use the emulated mask format.
* Store signals internally in sigaction structures, rather than maintaining a
bunch of little sigsets for each SA_* bit.
* Keep track of where we put the signal trampoline, rather than figuring it out
in *_sendsig().
* Issue a warning when a non-emulated sigaction bit is observed.
* Add missing emulated signals, and a native SIGPWR (currently not used).
* Implement the `not reset when caught' semantics for relevant signals.

Note: Only code touched by the i386 port has been modified. Other ports and
emulations need to be updated.
 1.6 11-Jun-1998  drochner Since wscons can support VT_xxx ioctl()s, enable them if NWSDISPLAY > 0.
Implement KDGKBTYPE and KDGKBENT, this will make X servers happy.
 1.5 03-May-1996  christos Add missing prototypes.
 1.4 27-Aug-1995  fvdl A couple of definitions added for previous changes.
 1.3 07-May-1995  mycroft Improve Linux signal emulation, and emulate the modify_ldt() call.
 1.2 22-Apr-1995  christos - added sunos_machdep.c for sun3, atari, amiga and mac68k.
- changed machdep.c and trap.c to use struct emul.
- remove ep_setup references.
- added struct emul to all emulations.
 1.1 07-Apr-1995  fvdl Arch dependant defs for Linux. Just signal stackframe definition for now.
 1.10.10.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.10.2.5 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.10.2.4 05-Jan-2001  bouyer Sync with HEAD
 1.10.2.3 13-Dec-2000  bouyer Sync with HEAD (for UBC fixes).
 1.10.2.2 08-Dec-2000  bouyer Sync with HEAD.
 1.10.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.12.2.1 30-Mar-2001  he Pull up revision 1.14-1.20 (via patch, requested by fvdl):
Add some required Linux emulation bits to support the Linux
version of VMware.
 1.20.4.3 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.20.4.2 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.20.4.1 16-Mar-2002  jdolecek Catch up with -current.
 1.20.2.4 11-Dec-2002  thorpej Sync with HEAD.
 1.20.2.3 17-Sep-2002  nathanw Catch up to -current.
 1.20.2.2 01-Aug-2002  nathanw Catch up to -current.
 1.20.2.1 28-Feb-2002  nathanw Catch up to -current.
 1.21.8.2 15-Jul-2002  gehenna catch up with -current.
 1.21.8.1 16-May-2002  gehenna Remove a hard-coded device major.
 1.25.6.4 14-Nov-2004  skrll Sync with HEAD.
 1.25.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.25.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.25.6.1 03-Aug-2004  skrll Sync with HEAD
 1.28.12.1 03-Sep-2007  yamt sync with head.
 1.29.32.1 11-Jul-2007  mjf Sync with head.
 1.29.30.2 15-Jul-2007  ad Sync with head.
 1.29.30.1 27-May-2007  ad Sync with head.
 1.29.26.1 17-May-2007  yamt sync with head.
 1.32.32.3 11-Aug-2010  yamt sync with head.
 1.32.32.2 04-May-2009  yamt sync with head.
 1.32.32.1 16-May-2008  yamt sync with head.
 1.32.30.1 18-May-2008  yamt sync with head.
 1.32.28.2 17-Jan-2009  mjf Sync with HEAD.
 1.32.28.1 02-Jun-2008  mjf Sync with HEAD.
 1.33.6.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.35.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.36.8.1 05-Mar-2011  rmind sync with head
 1.36.6.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.7 14-Mar-2015  njoly Support Linux MAP_LOCKED mmap flag.
 1.6 28-Apr-2008  martin branches: 1.6.44; 1.6.64;
Remove clause 3 and 4 from TNF licenses
 1.5 11-Dec-2005  christos branches: 1.5.70; 1.5.72; 1.5.74;
merge ktrace-lwp.
 1.4 28-Aug-2004  jdolecek g/c LINUX_MAP_IGNMASK define - it's not used anywhere
 1.3 04-Oct-1998  fvdl branches: 1.3.46;
Assign my copyright to TNF. Merge with others were appropriate.
Regen syscall files after script change.
 1.2 01-Oct-1998  erh Split compat/linux/linux_mmap.h into i386 and common parts.
 1.1 28-Feb-1995  fvdl Added Linux compat code.
 1.3.46.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.46.2 18-Sep-2004  skrll Sync with HEAD.
 1.3.46.1 03-Sep-2004  skrll Sync with HEAD
 1.5.74.1 16-May-2008  yamt sync with head.
 1.5.72.1 18-May-2008  yamt sync with head.
 1.5.70.1 02-Jun-2008  mjf Sync with HEAD.
 1.6.64.1 06-Apr-2015  skrll Sync with HEAD
 1.6.44.1 03-Dec-2017  jdolecek update from HEAD
 1.36 05-Sep-2022  tsutsui G/C ISSET() macro copies. It has been defined in <sys/types.h> since 2006.
 1.35 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.34 23-May-2020  ad Move proc_lock into the data segment. It was dynamically allocated because
at the time we had mutex_obj_alloc() but not __cacheline_aligned.
 1.33 03-Sep-2018  riastradh branches: 1.33.4;
Rename min/max -> uimin/uimax for better honesty.

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

HOWEVER! Some subsystems have

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

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

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

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

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

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

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate. But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all. (Who knows, maybe in some cases integer
truncation is actually intended!)
 1.32 28-Aug-2017  kamil branches: 1.32.2; 1.32.4;
Remove the filesystem tracing feature

This is a legacy interface from 4.4BSD, and it was
introduced to overcome shortcomings of ptrace(2) at that time, which are
no longer relevant (performance). Today /proc/#/ctl offers a narrow
subset of ptrace(2) commands and is not applicable for modern
applications use beyond simplistic tracing scenarios.

This removal will simplify kernel internals. Users will still be able to
use all the other /proc files.

This change won't affect other procfs files neither Linux compat
features within mount_procfs(8). /proc/#/ctl isn't available on Linux.

Remove:
- /proc/#/ctl from mount_procfs(8)
- P_FSTRACE note from the documentation of ps(1)
- /proc/#/ctl and filesystem tracing documentation from mount_procfs(8)
- KAUTH_REQ_PROCESS_PROCFS_CTL documentation from kauth(9)
- source code file miscfs/procfs/procfs_ctl.c
- PFSctl and procfs_doctl() from sys/miscfs/procfs/procfs.h
- KAUTH_REQ_PROCESS_PROCFS_CTL from sys/sys/kauth.h
- PSL_FSTRACE (0x00010000) from sys/sys/proc.h
- P_FSTRACE (0x00010000) from sys/sys/sysctl.h

Reduce code complexity after removal of this functionality.

Update TODO.ptrace accordingly: remove two entries about /proc tracing.

Do not keep legacy notes as comments in the headers about removed
PSL_FSTRACE / P_FSTRACE, as this interface had little number of users
(close or equal to zero).

Proposed on tech-kern@.

All filesystem tracing utility users are encouraged to switch to ptrace(2).

Sponsored by <The NetBSD Foundation>
 1.31 13-Oct-2015  pgoyette branches: 1.31.10;
Don't release proc_lock until we're done looking at things that are
protected by the lock, particularly p_stat and p_waited. Found by
Robert Elz.

XXX Pullup to NetBSD-7, -6, -6-0, and -6-1
 1.30 09-Nov-2014  maxv branches: 1.30.2;
Do not uselessly include <sys/malloc.h>.
 1.29 21-Sep-2014  christos fix leak
 1.28 15-Apr-2014  maxv branches: 1.28.2;
There are two times the same branches.

} else if (addr == LUSR_OFF(__signal)) {
error = ENOTSUP;
} else if (addr == LUSR_OFF(__signal)) {
error = ENOTSUP;
}

Just delete one of them. Spotted by my code scanner.

ok christos@
 1.27 04-Jan-2014  dsl branches: 1.27.2;
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.26 07-Jul-2010  chs branches: 1.26.8; 1.26.14; 1.26.18; 1.26.20; 1.26.22; 1.26.28;
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.25 01-Jul-2010  rmind Remove pfind() and pgfind(), fix locking in various broken uses of these.
Rename real routines to proc_find() and pgrp_find(), remove PFIND_* flags
and have consistent behaviour. Provide proc_find_raw() for special cases.
Fix memory leak in sysctl_proc_corename().

COMPAT_LINUX: rework ptrace() locking, minimise differences between
different versions per-arch.

Note: while this change adds some formal cosmetics for COMPAT_DARWIN and
COMPAT_IRIX - locking there is utterly broken (for ages).

Fixes PR/43176.
 1.24 21-Oct-2009  rmind branches: 1.24.2; 1.24.4;
Remove uarea swap-out functionality:

- Addresses the issue described in PR/38828.
- Some simplification in threading and sleepq subsystems.
- Eliminates pmap_collect() and, as a side note, allows pmap optimisations.
- Eliminates XS_CTL_DATA_ONSTACK in scsipi code.
- Avoids few scans on LWP list and thus potentially long holds of proc_lock.
- Cuts ~1.5k lines of code. Reduces amd64 kernel size by ~4k.
- Removes __SWAP_BROKEN cases.

Tested on x86, mips, acorn32 (thanks <mpumford>) and partly tested on
acorn26 (thanks to <bjh21>).

Discussed on <tech-kern>, reviewed by <ad>.
 1.23 17-Dec-2008  cegger kill MALLOC and FREE macros.
 1.22 28-Apr-2008  martin branches: 1.22.2; 1.22.8;
Remove clause 3 and 4 from TNF licenses
 1.21 23-Apr-2008  ad branches: 1.21.2;
Disable bitrotted linux ptrace interfaces, which are likely now a
security hole. Can be re-enabled at runtime. If you want to repair
them please look at the native implementation.
 1.20 20-Dec-2007  dsl branches: 1.20.6; 1.20.8;
Convert all the system call entry points from:
int foo(struct lwp *l, void *v, register_t *retval)
to:
int foo(struct lwp *l, const struct foo_args *uap, register_t *retval)
Fixup compat code to not write into 'uap' and (in some cases) to actually
pass a correctly formatted 'uap' structure with the right name to the
next routine.
A few 'compat' routines that just call standard ones have been deleted.
All the 'compat' code compiles (along with the kernels required to test
build it).
98% done by automated scripts.
 1.19 08-Dec-2007  dsl branches: 1.19.4;
ANSIfy most of the function definitions in sys/compat (but not ndis).
All by the magic of sed ...
 1.18 09-Jul-2007  ad branches: 1.18.6; 1.18.8; 1.18.16;
Merge some of the less invasive changes from the vmlocking branch:

- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
 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;
When calling PTRACE from an LKM, use sysent[SYS_ptrace].sy_call in case
the sys_ptrace symbol isn't present.
 1.14 30-Aug-2006  matt Update to deal with options PTRACE
 1.13 11-Dec-2005  christos branches: 1.13.4; 1.13.8;
merge ktrace-lwp.
 1.12 26-Feb-2005  perry branches: 1.12.4;
nuke trailing whitespace
 1.11 18-Jan-2003  thorpej branches: 1.11.2; 1.11.10; 1.11.12;
Merge the nathanw_sa branch.
 1.10 08-Dec-2002  junyoung - Rename struct linux_ctx to linux_fpctx.
- KNF.
 1.9 06-Dec-2002  tron Fix namespace collision caused by recent change to "linux_machdep.h".
 1.8 15-Nov-2001  lukem don't need <sys/types.h> when including <sys/param.h>
 1.7 13-Nov-2001  lukem add RCSIDs (including regeneration of files as appropriate)
 1.6 15-May-2001  lukem branches: 1.6.2;
delint: fix comments
 1.5 21-Nov-2000  jdolecek branches: 1.5.2;
implement PTRACE_{GET|SET}FPREGS and framework for PTRACE_{PEEK|POKE}USER

this makes it possible to attach to linux process with linux gdb and
see top-most function on traceback; lower functions are not available,
probably due to bad frame setup
it's not possible to setup breakpoints - Linux gdb uses hw breakpoints,
so support for them would need to be written
 1.4 01-Nov-2000  jdolecek branches: 1.4.2;
move definition of LINUX_PTRACE_{SET|GET}(FP)REGS flags to
sys/compat/linux/common/linux_ptrace.h, they seem to be actually MI
 1.3 16-Dec-1999  tron branches: 1.3.2;
Add support for reading and writing non FPU register with ptrace(2).
 1.2 12-Dec-1999  tron Support a few more request types in ptrace(2) emulation.
 1.1 12-Dec-1999  tron Incomplete but already working emulation of Linux's ptrace(2) for i386.
 1.3.2.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.4.2.3 22-Nov-2000  bouyer Sync with HEAD.
 1.4.2.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.4.2.1 01-Nov-2000  bouyer file linux_ptrace.c was added on branch thorpej_scsipi on 2000-11-20 18:08:19 +0000
 1.5.2.6 11-Dec-2002  thorpej Sync with HEAD.
 1.5.2.5 29-May-2002  nathanw #include <sys/sa.h> before <sys/syscallargs.h>, to provide sa_upcall_t
now that <sys/param.h> doesn't include <sys/sa.h>.

(Behold the Power of Ed)
 1.5.2.4 08-Jan-2002  nathanw Catch up to -current.
 1.5.2.3 14-Nov-2001  nathanw Catch up to -current.
 1.5.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.5.2.1 05-Mar-2001  nathanw Initial commit of scheduler activations and lightweight process support.
 1.6.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.11.12.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.11.10.1 29-Apr-2005  kent sync with -current
 1.11.2.1 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.12.4.4 21-Jan-2008  yamt sync with head
 1.12.4.3 03-Sep-2007  yamt sync with head.
 1.12.4.2 26-Feb-2007  yamt sync with head.
 1.12.4.1 30-Dec-2006  yamt sync with head.
 1.13.8.1 03-Sep-2006  yamt sync with head.
 1.13.4.1 09-Sep-2006  rpaulo sync with head
 1.15.2.3 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.15.2.2 29-Dec-2006  ad Checkpoint work in progress.
 1.15.2.1 17-Nov-2006  ad Checkpoint work in progress.
 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 05-Apr-2007  ad Compile fixes.
 1.18.16.1 26-Dec-2007  ad Sync with head.
 1.18.8.1 09-Jan-2008  matt sync with HEAD
 1.18.6.1 09-Dec-2007  jmcneill Sync with HEAD.
 1.19.4.1 02-Jan-2008  bouyer Sync with HEAD
 1.20.8.1 18-May-2008  yamt sync with head.
 1.20.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.20.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.21.2.4 11-Aug-2010  yamt sync with head.
 1.21.2.3 11-Mar-2010  yamt sync with head
 1.21.2.2 04-May-2009  yamt sync with head.
 1.21.2.1 16-May-2008  yamt sync with head.
 1.22.8.1 19-Jan-2009  skrll Sync with HEAD.
 1.22.2.2 14-May-2008  wrstuden Per discussion with ad, remove most of the #include <sys/sa.h> lines
as they were including sa.h just for the type(s) needed for syscallargs.h.

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

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

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

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

Also, kern_sa.c has received partial cleanup. There's still more
to do, though.
 1.24.4.2 05-Mar-2011  rmind sync with head
 1.24.4.1 03-Jul-2010  rmind sync with head
 1.24.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.26.28.1 15-Nov-2015  bouyer Pull up following revision(s) (requested by pgoyette in ticket #1335):
sys/compat/linux/arch/i386/linux_ptrace.c: revision 1.31
sys/compat/linux/arch/arm/linux_ptrace.c: revision 1.19
sys/compat/linux/arch/powerpc/linux_ptrace.c: revision 1.29
Don't release proc_lock until we're done looking at things that are
protected by the lock, particularly p_stat and p_waited. Found by
Robert Elz.
XXX Pullup to NetBSD-7, -6, -6-0, and -6-1
 1.26.22.1 18-May-2014  rmind sync with head
 1.26.20.1 15-Nov-2015  bouyer Pull up following revision(s) (requested by pgoyette in ticket #1335):
sys/compat/linux/arch/i386/linux_ptrace.c: revision 1.31
sys/compat/linux/arch/arm/linux_ptrace.c: revision 1.19
sys/compat/linux/arch/powerpc/linux_ptrace.c: revision 1.29
Don't release proc_lock until we're done looking at things that are
protected by the lock, particularly p_stat and p_waited. Found by
Robert Elz.
XXX Pullup to NetBSD-7, -6, -6-0, and -6-1
 1.26.18.2 03-Dec-2017  jdolecek update from HEAD
 1.26.18.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.26.14.1 15-Nov-2015  bouyer Pull up following revision(s) (requested by pgoyette in ticket #1335):
sys/compat/linux/arch/i386/linux_ptrace.c: revision 1.31
sys/compat/linux/arch/arm/linux_ptrace.c: revision 1.19
sys/compat/linux/arch/powerpc/linux_ptrace.c: revision 1.29
Don't release proc_lock until we're done looking at things that are
protected by the lock, particularly p_stat and p_waited. Found by
Robert Elz.
XXX Pullup to NetBSD-7, -6, -6-0, and -6-1
 1.26.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.27.2.1 10-Aug-2014  tls Rebase.
 1.28.2.3 05-Nov-2015  snj Pull up following revision(s) (requested by pgoyette in ticket #998):
sys/compat/linux/arch/arm/linux_ptrace.c: revision 1.19
sys/compat/linux/arch/i386/linux_ptrace.c: revision 1.31
sys/compat/linux/arch/powerpc/linux_ptrace.c: revision 1.29
Don't release proc_lock until we're done looking at things that are
protected by the lock, particularly p_stat and p_waited. Found by
Robert Elz.
 1.28.2.2 17-Jan-2015  martin branches: 1.28.2.2.2;
Pull up following revision(s) (requested by maxv in ticket #427):
sys/compat/svr4/svr4_schedctl.c: revision 1.8
sys/netinet/tcp_timer.c: revision 1.88
sys/miscfs/genfs/layer_vfsops.c: revision 1.45
sys/compat/svr4/svr4_ioctl.c: revision 1.37
sys/ufs/chfs/chfs_vfsops.c: revision 1.14
sys/miscfs/fdesc/fdesc_vfsops.c: revision 1.91
sys/compat/linux/arch/i386/linux_ptrace.c: revision 1.30
sys/compat/common/kern_time_50.c: revision 1.28
sys/netinet6/ip6_forward.c: revision 1.74
sys/miscfs/umapfs/umap_vnops.c: revision 1.57
sys/compat/svr4/svr4_fcntl.c: revision 1.74
distrib/sets/lists/comp/mi: revision 1.1931
sys/netinet6/udp6_output.c: revision 1.46
sys/fs/puffs/puffs_compat.c: revision 1.3
sys/fs/udf/udf_rename.c: revision 1.11
sys/compat/svr4/svr4_filio.c: revision 1.24
sys/fs/udf/udf_rename.c: revision 1.12
sys/netinet/tcp_usrreq.c: revision 1.202
sys/miscfs/umapfs/umap_subr.c: revision 1.29
sys/compat/linux/common/linux_fadvise64.c: revision 1.3
sys/netinet/if_atm.c: revision 1.34
sys/miscfs/procfs/procfs_subr.c: revision 1.106
sys/miscfs/genfs/layer_subr.c: revision 1.37
sys/netinet/tcp_sack.c: revision 1.30
sys/compat/freebsd/freebsd_misc.c: revision 1.33
sys/compat/freebsd/freebsd_file.c: revision 1.33
sys/ufs/chfs/chfs_vnode.c: revision 1.12
sys/compat/svr4/svr4_ttold.c: revision 1.34
sys/compat/linux/common/linux_file.c: revision 1.114
sys/compat/linux/arch/mips/linux_machdep.c: revision 1.43
sys/compat/linux/common/linux_signal.c: revision 1.76
sys/compat/common/compat_util.c: revision 1.46
sys/compat/linux/arch/arm/linux_ptrace.c: revision 1.18
sys/compat/svr4/svr4_sockio.c: revision 1.36
sys/compat/linux/arch/arm/linux_machdep.c: revision 1.32
sys/compat/svr4/svr4_signal.c: revision 1.66
sys/kern/kern_exec.c: revision 1.410
sys/fs/puffs/puffs_vfsops.c: revision 1.115
sys/compat/svr4/svr4_exec_elf64.c: revision 1.15
sys/compat/linux/arch/i386/linux_machdep.c: revision 1.159
sys/compat/linux/arch/alpha/linux_machdep.c: revision 1.50
sys/compat/linux32/common/linux32_misc.c: revision 1.24
sys/netinet/in_pcb.c: revision 1.153
sys/sys/malloc.h: revision 1.116
sys/compat/common/if_43.c: revision 1.9
share/man/man9/Makefile: revision 1.380
sys/netinet/tcp_vtw.c: revision 1.12
sys/miscfs/umapfs/umap_vfsops.c: revision 1.95
sys/ufs/ext2fs/ext2fs_vfsops.c: revision 1.186
sys/compat/common/uipc_syscalls_43.c: revision 1.46
sys/ufs/ext2fs/ext2fs_vnops.c: revision 1.115
sys/fs/puffs/puffs_msgif.c: revision 1.97
sys/compat/svr4/svr4_ipc.c: revision 1.27
sys/compat/linux/common/linux_exec.c: revision 1.117
sys/ufs/ext2fs/ext2fs_readwrite.c: revision 1.66
sys/netinet/tcp_output.c: revision 1.179
sys/compat/svr4/svr4_termios.c: revision 1.28
sys/fs/udf/udf_strat_bootstrap.c: revision 1.4
sys/fs/puffs/puffs_subr.c: revision 1.67
sys/fs/puffs/puffs_node.c: revision 1.36
sys/miscfs/overlay/overlay_vnops.c: revision 1.21
sys/fs/cd9660/cd9660_node.c: revision 1.34
sys/netinet/raw_ip.c: revision 1.146
sys/sys/mallocvar.h: revision 1.13
sys/miscfs/overlay/overlay_vfsops.c: revision 1.63
share/man/man9/malloc.9: revision 1.50
sys/netinet6/dest6.c: revision 1.18
sys/compat/linux/common/linux_uselib.c: revision 1.33
sys/compat/linux/common/linux_socket.c: revision 1.120
share/man/man9/malloc.9: revision 1.51
sys/netinet/tcp_subr.c: revision 1.257
sys/compat/linux/common/linux_socketcall.c: revision 1.45
sys/compat/linux/common/linux_fadvise64_64.c: revision 1.3
sys/compat/freebsd/freebsd_ipc.c: revision 1.17
sys/compat/linux/common/linux_misc_notalpha.c: revision 1.109
sys/compat/linux/arch/alpha/linux_pipe.c: revision 1.17
sys/netinet6/in6_pcb.c: revision 1.132
sys/netinet6/in6_ifattach.c: revision 1.94
sys/compat/svr4/svr4_exec_elf32.c: revision 1.15
sys/miscfs/nullfs/null_vfsops.c: revision 1.90
sys/fs/cd9660/cd9660_util.c: revision 1.12
sys/compat/linux/arch/powerpc/linux_machdep.c: revision 1.48
sys/compat/freebsd/freebsd_exec_elf32.c: revision 1.20
sys/miscfs/procfs/procfs_vfsops.c: revision 1.94
sys/compat/linux/arch/powerpc/linux_ptrace.c: revision 1.28
sys/compat/linux/common/linux_sched.c: revision 1.67
sys/compat/linux/common/linux_exec_aout.c: revision 1.67
sys/compat/linux/common/linux_pipe.c: revision 1.67
sys/compat/linux/common/linux_llseek.c: revision 1.34
sys/compat/linux/arch/mips/linux_ptrace.c: revision 1.10
Do not uselessly include <sys/malloc.h>.
Cleanup:
- remove struct kmembuckets (dead)
- correctly deadify MALLOC_XX
- remove MALLOC_DEFINE_LIMIT and MALLOC_JUSTDEFINE_LIMIT (dead)
- remove malloc_roundup(), malloc_type_setlimit(), MALLOC_DEFINE_LIMIT()
and MALLOC_JUSTDEFINE_LIMIT() from man 9 malloc
New sentence, new line. Bump date for previous.
Obsolete malloc_roundup(9), malloc_type_setlimit(9) and MALLOC_DEFINE_LIMIT(9)
man pages.
 1.28.2.1 30-Oct-2014  martin Pull up following revision(s) (requested by maxv in ticket #163):
sys/compat/linux/arch/i386/linux_ptrace.c: revision 1.29
sys/compat/linux/arch/powerpc/linux_ptrace.c: revision 1.26
sys/compat/linux/arch/powerpc/linux_ptrace.c: revision 1.27
Fix four memory leaks in compat/linux.
 1.28.2.2.2.1 05-Nov-2015  snj Pull up following revision(s) (requested by pgoyette in ticket #998):
sys/compat/linux/arch/arm/linux_ptrace.c: revision 1.19
sys/compat/linux/arch/i386/linux_ptrace.c: revision 1.31
sys/compat/linux/arch/powerpc/linux_ptrace.c: revision 1.29
Don't release proc_lock until we're done looking at things that are
protected by the lock, particularly p_stat and p_waited. Found by
Robert Elz.
 1.30.2.1 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.31.10.2 21-Jun-2023  martin Pull up following revision(s) (requested by riastradh in ticket #1836):

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

sys/compat: Memset zero before copyout.

Just in case of uninitialized padding which would lead to kernel
stack disclosure. If the compiler can prove the memset redundant
then it can optimize it away; otherwise better safe than sorry.
 1.31.10.1 12-Apr-2018  martin Pull up following revision(s) (requested by kamil in ticket #713):

sys/modules/procfs/Makefile: revision 1.4
sys/miscfs/procfs/procfs_vfsops.c: revision 1.98
bin/ps/ps.1: revision 1.108
sys/compat/linux/arch/i386/linux_ptrace.c: revision 1.32
sys/miscfs/procfs/procfs_vnops.c: revision 1.198
sys/kern/sys_ptrace_common.c: revision 1.23
sys/kern/sys_ptrace_common.c: revision 1.24
sbin/mount_procfs/mount_procfs.8: revision 1.36
sys/kern/sys_ptrace_common.c: revision 1.25
sys/kern/sys_ptrace.c: revision 1.5
sys/compat/linux/arch/powerpc/linux_ptrace.c: revision 1.30
sys/sys/proc.h: revision 1.342
sys/kern/sys_ptrace_common.c: revision 1.26
sys/miscfs/procfs/procfs_ctl.c: file removal
sys/kern/sys_ptrace_common.c: revision 1.27
sys/miscfs/procfs/procfs_subr.c: revision 1.109
sys/kern/sys_ptrace_common.c: revision 1.28
sys/secmodel/extensions/secmodel_extensions.c: revision 1.8
sys/kern/sys_ptrace_common.c: revision 1.29
sys/sys/ptrace.h: revision 1.62
sys/compat/netbsd32/netbsd32_signal.c: revision 1.45
share/man/man9/kauth.9: revision 1.109
sys/miscfs/procfs/files.procfs: revision 1.12
sys/compat/netbsd32/netbsd32.h: revision 1.115
sys/miscfs/procfs/procfs.h: revision 1.72
sys/compat/netbsd32/netbsd32_ptrace.c: revision 1.5
sys/kern/kern_sig.c: revision 1.337
sys/sys/kauth.h: revision 1.75
sys/sys/sysctl.h: revision 1.224
sys/kern/sys_ptrace_common.c: revision 1.30
sys/kern/sys_ptrace_common.c: revision 1.31
sys/kern/sys_ptrace_common.c: revision 1.32
sys/kern/sys_ptrace_common.c: revision 1.33
sys/compat/linux/arch/arm/linux_ptrace.c: revision 1.20
sys/kern/sys_ptrace_common.c: revision 1.34
sys/kern/sys_ptrace_common.c: revision 1.36
sys/kern/kern_proc.c: revision 1.207
sys/kern/kern_exit.c: revision 1.269
doc/TODO.ptrace: revision 1.29

Make {s,g}et{db,fp,}regs work again for PK_32 processes
XXX: pullup-8

add disgusting magic to handle compat_netbsd32 as a module.

use process_*reg32 instead of struct *reg32.

Remove the filesystem tracing feature

This is a legacy interface from 4.4BSD, and it was
introduced to overcome shortcomings of ptrace(2) at that time, which are
no longer relevant (performance). Today /proc/#/ctl offers a narrow
subset of ptrace(2) commands and is not applicable for modern
applications use beyond simplistic tracing scenarios.

This removal will simplify kernel internals. Users will still be able to
use all the other /proc files.

This change won't affect other procfs files neither Linux compat
features within mount_procfs(8). /proc/#/ctl isn't available on Linux.

Remove:
- /proc/#/ctl from mount_procfs(8)
- P_FSTRACE note from the documentation of ps(1)
- /proc/#/ctl and filesystem tracing documentation from mount_procfs(8)
- KAUTH_REQ_PROCESS_PROCFS_CTL documentation from kauth(9)
- source code file miscfs/procfs/procfs_ctl.c
- PFSctl and procfs_doctl() from sys/miscfs/procfs/procfs.h
- KAUTH_REQ_PROCESS_PROCFS_CTL from sys/sys/kauth.h
- PSL_FSTRACE (0x00010000) from sys/sys/proc.h
- P_FSTRACE (0x00010000) from sys/sys/sysctl.h

Reduce code complexity after removal of this functionality.

Update TODO.ptrace accordingly: remove two entries about /proc tracing.

Do not keep legacy notes as comments in the headers about removed

PSL_FSTRACE / P_FSTRACE, as this interface had little number of users
(close or equal to zero).
Proposed on tech-kern@.

All filesystem tracing utility users are encouraged to switch to ptrace(2).

Sponsored by <The NetBSD Foundation>

untangle the mess:
- factor out common code
- break each ptrace subcall to its own sub-function
.. more to come ...
- reduce ifdef ugliness by moving it up top.
- factor out PT_IO and make PT_{READ,WRITE}_{I,D} use it
- factor out PT_DUMPCORE
- factor out sendsig code
.. more to come ...

handle siginfo requests for ptrace32

ptrace: Partially undo PT_{READ,WRITE}_{I,D} and unbreak these commands

The refactored code did not work and was generating EFAULT.

Sponsored by <The NetBSD Foundation>

Merge the code back; the problem was that since we are reading/writing
to a kernel address for PT_{READ,WRITE}_{I,D} we need the kernel vmspace.
provide separate read and write functions to accomodate register functions
that need a size argument.

don't ignore error from copyout_piod

Use the proper process (the tracee) to get information about lwps and
registers and the tracer for vmspace.

Add new sysctl(3) entry: security.models.extensions.user_set_dbregs

Model this new sysctl(3) entry after "user_set_cpu_affinity" in the same
level of sysctl(3) switches.

Allow to read unconditionally Debug Registers (no change here). This is
convenient as even if a user of a debugger does not use hardware assisted
watchpoints/breakpoints, a debugger can still prompt these values to store
in an internal cache with context of registers. Reading them should have
no security concerns.

Add a paranoid MI switch that prohibits by default setting these registers
by a regular user (non-superuser). Make this switch disabled by default.
There are enough reserved bits out there to allow using them
unconditionally on hardened hosts.

Features shipped with Debug Registers are optional features in debuggers.
There is no reduction in elementary functionality.

Reviewed by <christos>

Sponsored by <The NetBSD Foundation>
 1.32.4.1 10-Jun-2019  christos Sync with HEAD
 1.32.2.1 06-Sep-2018  pgoyette Sync with HEAD

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

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

sys/compat: Memset zero before copyout.

Just in case of uninitialized padding which would lead to kernel
stack disclosure. If the compiler can prove the memset redundant
then it can optimize it away; otherwise better safe than sorry.
 1.25 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.24 10-Apr-2002  itojun branches: 1.24.108; 1.24.110; 1.24.112;
revert previous
 1.23 10-Apr-2002  itojun make it compile (missing includes)
 1.22 31-Mar-2002  christos bring the reverse signal mapping array into linux_signo.c
 1.21 31-Mar-2002  christos make signal array handling uniform, and put signal arrays in a separate
file. This is simular to errno array handling.
 1.20 19-Mar-2002  christos - Now that RT-signals fit, fix the array to deliver them. [i386 only].
- jdk-1.4 works perfectly now. :-)
 1.19 13-Nov-2001  lukem add RCSIDs (including regeneration of files as appropriate)
 1.18 18-Jan-2001  jdolecek branches: 1.18.2; 1.18.4;
constify
 1.17 04-Oct-1999  fvdl branches: 1.17.2;
Handle the newer, larger sigset_t Linux now uses.
 1.16 04-Oct-1998  fvdl Assign my copyright to TNF. Merge with others were appropriate.
Regen syscall files after script change.
 1.15 03-Oct-1998  christos Attempt to fix the mess.
 1.14 01-Oct-1998  erh Split compat/linux/linux_signal.c into i386, common and multi-architecture parts.
 1.13 29-Sep-1998  tv Bracket stray printf()s by #ifdef DEBUG.
 1.12 11-Sep-1998  mycroft Substantial signal handling changes:
* Increase the size of sigset_t to accomodate 128 signals -- adding new
versions of sys_setprocmask(), sys_sigaction(), sys_sigpending() and
sys_sigsuspend() to handle the changed arguments.
* Abstract the guts of sys_sigaltstack(), sys_setprocmask(), sys_sigaction(),
sys_sigpending() and sys_sigsuspend() into separate functions, and call them
from all the emulations rather than hard-coding everything. (Avoids uses
the stackgap crap for these system calls.)
* Add a new flag (p_checksig) to indicate that a process may have signals
pending and userret() needs to do the full (slow) check.
* Eliminate SAS_ALTSTACK; it's exactly the inverse of SS_DISABLE.
* Correct emulation bugs with restoring SS_ONSTACK.
* Make the signal mask in the sigcontext always use the emulated mask format.
* Store signals internally in sigaction structures, rather than maintaining a
bunch of little sigsets for each SA_* bit.
* Keep track of where we put the signal trampoline, rather than figuring it out
in *_sendsig().
* Issue a warning when a non-emulated sigaction bit is observed.
* Add missing emulated signals, and a native SIGPWR (currently not used).
* Implement the `not reset when caught' semantics for relevant signals.

Note: Only code touched by the i386 port has been modified. Other ports and
emulations need to be updated.
 1.11 09-Aug-1998  perry bzero->memset, bcopy->memcpy, bcmp->memcmp
 1.10 04-Apr-1996  christos - Add missing prototypes
- Fix bugs with reversed arguments that prototyping discovered
 1.9 07-Oct-1995  mycroft Prefix names of system call implementation functions with `sys_'.
 1.8 19-Sep-1995  thorpej Make system calls conform to a standard prototype and bring those
prototypes into scope.
 1.7 14-Aug-1995  mycroft Move signal types into signal.h.
 1.6 13-Aug-1995  mycroft Convert SA_NOMASK and SA_ONESHOT.
Clean up this code a bit.
 1.5 24-Jun-1995  christos Use compat_util.[ch].
 1.4 22-Jun-1995  fvdl * Changed to use generic ELF code from kern/exec_elf.c (which was taken
from the svr4 exec code plus the linux compat mods)
* Include file change
* Add multicast sockopts (from John Brezak)
 1.3 10-Mar-1995  fvdl Add the Linux pause() system call. Fix the arguments to sigsuspend().
 1.2 08-Mar-1995  fvdl Fix typo in comment.
 1.1 28-Feb-1995  fvdl Added Linux compat code.
 1.17.2.1 11-Feb-2001  bouyer Sync with HEAD.
 1.18.4.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.18.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.18.2.3 17-Apr-2002  nathanw Catch up to -current.
 1.18.2.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.18.2.1 14-Nov-2001  nathanw Catch up to -current.
 1.24.112.1 16-May-2008  yamt sync with head.
 1.24.110.1 18-May-2008  yamt sync with head.
 1.24.108.1 02-Jun-2008  mjf Sync with HEAD.
 1.8 18-Nov-2011  christos - add sigtimedwait support.
- merge the siginfo population code.
 1.7 23-Nov-2008  njoly branches: 1.7.16;
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.6 25-Oct-2008  christos branches: 1.6.2;
Add preliminary tls support for i386. Does not work yet. From FreeBSD.
 1.5 28-Apr-2008  martin branches: 1.5.6;
Remove clause 3 and 4 from TNF licenses
 1.4 11-Dec-2005  christos branches: 1.4.70; 1.4.72; 1.4.74;
merge ktrace-lwp.
 1.3 26-Feb-2005  perry nuke trailing whitespace
 1.2 03-Jul-2003  christos branches: 1.2.8; 1.2.10;
Implement linux_rt_sigreturn for real. Add a hack for more plausible siginfo.
The java segv handler still segv's again inside the signal handler, but our
sample test program now works [gets the proper ucontext].
 1.1 05-Sep-2002  christos branches: 1.1.2; 1.1.4; 1.1.10;
Make this match reality [not used yet]
 1.1.10.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.1.10.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.10.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.10.1 03-Aug-2004  skrll Sync with HEAD
 1.1.4.2 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.1.4.1 05-Sep-2002  jdolecek file linux_siginfo.h was added on branch kqueue on 2002-10-10 18:38:00 +0000
 1.1.2.2 17-Sep-2002  nathanw Catch up to -current.
 1.1.2.1 05-Sep-2002  nathanw file linux_siginfo.h was added on branch nathanw_sa on 2002-09-17 21:19:00 +0000
 1.2.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.2.8.1 29-Apr-2005  kent sync with -current
 1.4.74.2 04-May-2009  yamt sync with head.
 1.4.74.1 16-May-2008  yamt sync with head.
 1.4.72.1 18-May-2008  yamt sync with head.
 1.4.70.2 17-Jan-2009  mjf Sync with HEAD.
 1.4.70.1 02-Jun-2008  mjf Sync with HEAD.
 1.5.6.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.6.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.7.16.1 17-Apr-2012  yamt sync with head
 1.16 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.15 04-Dec-2007  dsl branches: 1.15.12; 1.15.14; 1.15.16;
Remove all the __P
 1.14 11-Dec-2005  christos branches: 1.14.44; 1.14.46; 1.14.52; 1.14.56;
merge ktrace-lwp.
 1.13 19-Sep-2005  christos MINSIGSTKSZ on linux is different depending on the platform and usually
smaller than ours.
 1.12 26-Nov-2002  christos branches: 1.12.6; 1.12.22;
rename sa_ -> linux_sa_
first attempt at providing siginfo_t to the signal handler.
 1.11 19-Mar-2002  christos - Now that RT-signals fit, fix the array to deliver them. [i386 only].
- jdk-1.4 works perfectly now. :-)
 1.10 15-Feb-2002  christos - add a real linux_sys___sysctl because the mib numbers are different.
implement only the kernel version getting entries.
- make the signal conversion functions consistent; dest is arg 1.
- make linux_fakedev deal with block and char devices differently.
- add linux_sys_ugetrlimit, and flesh out the regular get/setrlimit so
that they work properly.
- add linux_mmap2 [untested].
- bump kernel to 2.4.18, and make the date be valentine's day :-)
- linux_sys_*stat64 family was totally busted. Fix it.

tested only on i386.

Status:
gdb, telnet, work
jdk-1.4.0 extractor works, jdk still coredumps.

christos
 1.9 23-Aug-2000  christos branches: 1.9.2; 1.9.4;
add support for syscall 186 [sigaltstack]
 1.8 04-Oct-1999  fvdl branches: 1.8.2;
Handle the newer, larger sigset_t Linux now uses.
 1.7 04-Oct-1998  fvdl Assign my copyright to TNF. Merge with others were appropriate.
Regen syscall files after script change.
 1.6 01-Oct-1998  erh Split compat/linux/linux_signal.h into i386 and common parts.
 1.5 11-Sep-1998  mycroft Substantial signal handling changes:
* Increase the size of sigset_t to accomodate 128 signals -- adding new
versions of sys_setprocmask(), sys_sigaction(), sys_sigpending() and
sys_sigsuspend() to handle the changed arguments.
* Abstract the guts of sys_sigaltstack(), sys_setprocmask(), sys_sigaction(),
sys_sigpending() and sys_sigsuspend() into separate functions, and call them
from all the emulations rather than hard-coding everything. (Avoids uses
the stackgap crap for these system calls.)
* Add a new flag (p_checksig) to indicate that a process may have signals
pending and userret() needs to do the full (slow) check.
* Eliminate SAS_ALTSTACK; it's exactly the inverse of SS_DISABLE.
* Correct emulation bugs with restoring SS_ONSTACK.
* Make the signal mask in the sigcontext always use the emulated mask format.
* Store signals internally in sigaction structures, rather than maintaining a
bunch of little sigsets for each SA_* bit.
* Keep track of where we put the signal trampoline, rather than figuring it out
in *_sendsig().
* Issue a warning when a non-emulated sigaction bit is observed.
* Add missing emulated signals, and a native SIGPWR (currently not used).
* Implement the `not reset when caught' semantics for relevant signals.

Note: Only code touched by the i386 port has been modified. Other ports and
emulations need to be updated.
 1.4 27-Aug-1995  fvdl Add a hook for MD ioctl calls, plus a couple of more changes to make
svgalib binaries work on the i386
 1.3 14-Aug-1995  mycroft Export bsd_to_linux_sig[], and use it.
 1.2 14-Aug-1995  mycroft Move signal types into signal.h.
 1.1 28-Feb-1995  fvdl Added Linux compat code.
 1.8.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.9.4.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.9.4.1 16-Mar-2002  jdolecek Catch up with -current.
 1.9.2.3 11-Dec-2002  thorpej Sync with HEAD.
 1.9.2.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.9.2.1 28-Feb-2002  nathanw Catch up to -current.
 1.12.22.2 07-Dec-2007  yamt sync with head
 1.12.22.1 21-Jun-2006  yamt sync with head.
 1.12.6.1 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.14.56.1 08-Dec-2007  ad Sync with head.
 1.14.52.1 08-Dec-2007  mjf Sync with HEAD.
 1.14.46.1 09-Jan-2008  matt sync with HEAD
 1.14.44.1 09-Dec-2007  jmcneill Sync with HEAD.
 1.15.16.1 16-May-2008  yamt sync with head.
 1.15.14.1 18-May-2008  yamt sync with head.
 1.15.12.1 02-Jun-2008  mjf Sync with HEAD.
 1.9 25-Jan-2014  njoly 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.8 28-Apr-2008  martin branches: 1.8.34; 1.8.44; 1.8.50;
Remove clause 3 and 4 from TNF licenses
 1.7 11-Dec-2005  christos branches: 1.7.70; 1.7.72; 1.7.74;
merge ktrace-lwp.
 1.6 26-Jul-2003  jdolecek add LINUX_SO_PEERNAME, LINUX_SO_TIMESTAMP where it has been missing
fix value for LINUX_SO_DETACH_FILTER on couple places (unused anyway)

g/c LINUX_SCM_TIMESTAMP definition for some archs, it will be defined
in generic linux_socket.h
 1.5 04-Oct-1998  fvdl branches: 1.5.46;
Assign my copyright to TNF. Merge with others were appropriate.
Regen syscall files after script change.
 1.4 01-Oct-1998  erh Split linux_socket.h into i386 and common parts.
 1.3 28-May-1995  mycroft Convert TCP socket options.
 1.2 28-May-1995  mycroft Convert IP socket options.
 1.1 28-Feb-1995  fvdl Added Linux compat code.
 1.5.46.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.5.46.2 18-Sep-2004  skrll Sync with HEAD.
 1.5.46.1 03-Aug-2004  skrll Sync with HEAD
 1.7.74.1 16-May-2008  yamt sync with head.
 1.7.72.1 18-May-2008  yamt sync with head.
 1.7.70.1 02-Jun-2008  mjf Sync with HEAD.
 1.8.50.1 18-May-2014  rmind sync with head
 1.8.44.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.8.34.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.5 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.4 14-Nov-2008  ad branches: 1.4.4; 1.4.6; 1.4.8;
Unneeded ifdef
 1.3 26-Oct-2008  jmcneill branches: 1.3.2; 1.3.4;
Need opt_multiprocessor.h for MULTIPROCESSOR definition.
 1.2 26-Oct-2008  christos multiprocessor fixes, from rmind
 1.1 26-Oct-2008  christos futex support fixes from FreeBSD via cube+pengo.
 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.2 03-Mar-2009  skrll Sync with HEAD.
 1.3.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.4.8.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.4.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.4.6.1 14-Nov-2008  mjf file linux_support.S was added on branch mjf-devfs2 on 2009-01-17 13:28:43 +0000
 1.4.4.2 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.4.4.1 14-Nov-2008  haad file linux_support.S was added on branch haad-dm on 2008-12-13 01:13:53 +0000
 1.129 28-Sep-2024  christos regen
 1.128 01-Jul-2024  christos regen
 1.127 29-Jun-2024  christos branches: 1.127.2;
regen
 1.126 19-Aug-2023  christos regen
 1.125 18-Aug-2023  christos regen
 1.124 29-Jul-2023  christos regen
 1.123 28-Jul-2023  christos regen
 1.122 10-Jul-2023  christos regen
 1.121 02-Dec-2021  ryo regen
 1.120 20-Sep-2021  thorpej Regen for preadv(2) / pwritev(2).
 1.119 20-Sep-2021  thorpej Regen for eventfd.
 1.118 19-Sep-2021  thorpej Regen for timerfd.
 1.117 19-Sep-2021  thorpej Regen for POSIX timer syscalls.
 1.116 26-Apr-2020  thorpej branches: 1.116.2;
Regen for native futex calls.
 1.115 09-Nov-2019  jdolecek regen
 1.114 10-Aug-2018  pgoyette Regen
 1.113 10-May-2017  riastradh branches: 1.113.8; 1.113.10;
regen
 1.112 16-Jan-2017  christos branches: 1.112.4;
regen all
 1.111 13-Jan-2017  christos branches: 1.111.2;
regen
 1.110 02-Jan-2017  martin Regen (something apparently went wrong in previous)
 1.109 02-Jan-2017  manu Regen
 1.108 24-Jul-2016  njoly Regen for readlink/readlinkat signatures.
 1.107 24-Sep-2015  christos branches: 1.107.2;
regen
 1.106 23-Mar-2015  ozaki-r Regen
 1.105 07-Mar-2015  christos regen
 1.104 22-Nov-2014  njoly branches: 1.104.2;
Regen for ppoll signature fix
 1.103 31-May-2014  njoly branches: 1.103.2;
Regen for munmap(2) signature.
 1.102 29-May-2014  njoly Regen for utimes(2) change.
 1.101 20-May-2014  njoly Regen for getgroups/setgroups update.
 1.100 17-May-2014  njoly Regen for fadvise64 offset types changes.
 1.99 04-May-2014  njoly Regen for pread/pwrite 64bit offset argument.
 1.98 08-Apr-2014  njoly Regen.
 1.97 18-Nov-2013  chs branches: 1.97.2;
regen
 1.96 07-Nov-2013  njoly Regen for dup/dup2/dup3 argument types fix.
 1.95 24-Sep-2013  njoly Regen for utimensat(2).
 1.94 08-Apr-2013  pooka branches: 1.94.4;
regen for utimes
 1.93 19-Sep-2012  pooka regen for ppoll (and, apparently, SYCALL_ARG_PTR)
 1.92 18-Nov-2011  christos branches: 1.92.10;
- add sigtimedwait support.
- merge the siginfo population code.
 1.91 30-May-2011  alnsn branches: 1.91.4;
Regenerate files to pick up correct RCS Ids. Suggested by Chris Badura.
 1.90 30-May-2011  alnsn Add fadvise64 and fadvise64_64 syscalls to compat_linux and compat_linux32.
 1.89 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.88 07-Jul-2010  chs branches: 1.88.2;
regen
 1.87 23-Apr-2010  chs regen
 1.86 14-Dec-2009  matt branches: 1.86.2; 1.86.4;
Regen (new makesyscalls.sh)
 1.85 24-Nov-2009  njoly Regen for personality(2) update.
 1.84 08-Jun-2009  njoly Regen for rt_queueinfo(2) update.
 1.83 17-Jan-2009  njoly branches: 1.83.2;
Regen for wait4 update.
 1.82 13-Jan-2009  pooka Regen to prove I didn't screw up the conversion: purely RCSID changes.
 1.81 11-Jan-2009  christos merge christos-time_t
 1.80 19-Nov-2008  ad Regen.
 1.79 19-Nov-2008  njoly Regen for futex timeout argument cleanup/fix.
 1.78 12-Nov-2008  njoly Regen for nanosleep(2) fix.
 1.77 26-Oct-2008  christos branches: 1.77.2; 1.77.4;
regen
 1.76 26-Oct-2008  christos regen
 1.75 23-Apr-2008  ad branches: 1.75.2; 1.75.4; 1.75.8;
Regen.
 1.74 04-Apr-2008  njoly branches: 1.74.2;
Regen for linux_sys_msync removal.
 1.73 15-Jan-2008  njoly branches: 1.73.6; 1.73.8;
Regen.
 1.72 24-Dec-2007  njoly Regen for linux_sys_getpgid removal.
 1.71 21-Dec-2007  njoly Regen for getfsuid/setfsgid syscall exchange.
 1.70 20-Dec-2007  dsl regen
 1.69 16-Nov-2007  njoly branches: 1.69.2; 1.69.6;
Regen, for syscalls cleanup.
 1.68 13-Jun-2007  christos branches: 1.68.6; 1.68.8; 1.68.12; 1.68.14;
regen
 1.67 13-Jun-2007  christos regen.
 1.66 04-Mar-2007  christos branches: 1.66.2; 1.66.4;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.65 01-Sep-2006  matt branches: 1.65.8;
Regen.
 1.64 30-Aug-2006  matt Regen
 1.63 10-Jun-2006  christos regen
 1.62 11-Dec-2005  christos branches: 1.62.4; 1.62.8; 1.62.14;
merge ktrace-lwp.
 1.61 06-Nov-2005  manu regen
 1.60 06-Nov-2005  tron Regen with correct RCS Ids.
 1.59 05-Nov-2005  dogcow mirror manu's amd64 changes to implement linux sched_{seg,get}affinity;
the kernel and linux lkm now compile again.
 1.58 18-Oct-2005  joerg Regen.
 1.57 16-May-2005  fvdl branches: 1.57.2;
Regen.
 1.56 16-May-2005  fvdl Regen.
 1.55 26-Feb-2005  perry regen
 1.54 20-Sep-2004  jdolecek branches: 1.54.4; 1.54.6;
regen:
implement support for Linux statfs64() syscall - 64bit variant of statfs()
 1.53 08-Sep-2004  jdolecek regen: add exit_group(2)
 1.52 01-Aug-2004  jdolecek regen - sync syscall lists with Linux kernel 2.6.7
 1.51 01-Aug-2004  jdolecek regen:

connect madvise(2) and mincore(2) - apparently the newer Linux libs
don't stub it anymore, so allow the application to take advantage
of them

the Linux calls appear to be compatible in the flag values and semantics,
so a wrapper is not necessary
 1.50 01-Aug-2004  jdolecek connect madvise(2) and mincore(2) - apparently the newer Linux libs
don't stub it anymore, so allow the application to take advantage
of them

the Linux calls appear to be compatible in the flag values and semantics,
so a wrapper is not necessary
 1.49 10-Aug-2003  jdolecek regen - added wrapper for Linux ftruncate64()
 1.48 03-Jul-2003  christos Regen.
 1.47 23-Jun-2003  christos branches: 1.47.2;
Regen.
 1.46 18-Jan-2003  thorpej Regen for correct RCS IDs.
 1.45 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.44 10-Apr-2002  christos branches: 1.44.4;
regen
 1.43 22-Mar-2002  christos regen
 1.42 15-Feb-2002  christos regen
 1.41 15-Feb-2002  christos - add a real linux_sys___sysctl because the mib numbers are different.
implement only the kernel version getting entries.
- make the signal conversion functions consistent; dest is arg 1.
- make linux_fakedev deal with block and char devices differently.
- add linux_sys_ugetrlimit, and flesh out the regular get/setrlimit so
that they work properly.
- add linux_mmap2 [untested].
- bump kernel to 2.4.18, and make the date be valentine's day :-)
- linux_sys_*stat64 family was totally busted. Fix it.

tested only on i386.

Status:
gdb, telnet, work
jdk-1.4.0 extractor works, jdk still coredumps.

christos
 1.40 13-Nov-2001  lukem add RCSIDs (including regeneration of files as appropriate)
 1.39 30-Sep-2001  manu Fixes my last commit: only mips really need fcntl64 to work now. i386 and
powerpc could use it later if needed. m68k and alpha should never need it.
 1.38 30-May-2001  mrg branches: 1.38.2; 1.38.4;
use _KERNEL_OPT.
 1.37 13-May-2001  manu Improved the accuracy of gettimeofday/settimeofday: Linux stores a srtuct
timezone in the kernel. We now keep track of it for emulated processes.
Tested for powerpc and i386. Untested on m68k, but it should be ok
Alpha has a particular implementation (osf1_sys_gettimeofday), and it has
therefore not been touched.
 1.36 30-Mar-2001  jdolecek regen
 1.35 30-Mar-2001  jdolecek regen
 1.34 27-Jan-2001  thorpej branches: 1.34.2;
Regen; getpid(2) is MP-safe.
 1.33 27-Jan-2001  thorpej Regen; add sy_flags.
 1.32 29-Dec-2000  fvdl Regen.
 1.31 27-Dec-2000  fvdl Regen.
 1.30 18-Dec-2000  fvdl Regen.
 1.29 13-Dec-2000  augustss Regen.
 1.28 12-Dec-2000  jdolecek regen
 1.27 12-Dec-2000  jdolecek regen
 1.26 11-Dec-2000  mycroft Regen.
 1.25 09-Dec-2000  jdolecek regen
 1.24 09-Dec-2000  mycroft Regen.
 1.23 02-Dec-2000  jdolecek regen after addition of linux_sys_swapoff()
 1.22 01-Dec-2000  jdolecek regen
 1.21 01-Nov-2000  jdolecek regen
 1.20 23-Aug-2000  christos regen
 1.19 18-Aug-2000  cgd update for changed makesyscalls.master
 1.18 18-Aug-2000  cgd update for new makesyscalls.sh, and also for correct ids for changed
syscalls.master files. (you need to regenerate after checking in
syscalls.master to get the correct ids.)
 1.17 18-Mar-2000  erh branches: 1.17.4;
Regen.
 1.16 03-Feb-2000  abs regen
 1.15 12-Dec-1999  tron Regen.
 1.14 05-Dec-1999  tron Regen.
 1.13 04-Dec-1999  tron Regen.
 1.12 04-Oct-1999  tron branches: 1.12.2; 1.12.8;
Regen from "syscalls.master".
 1.11 16-Aug-1999  tron Regen.
 1.10 14-May-1999  thorpej Regen.
 1.9 13-May-1999  thorpej Regen.
 1.8 30-Mar-1999  abs branches: 1.8.2; 1.8.4;
Regenerate (with poll())
 1.7 27-Mar-1999  tron Regen.
 1.6 23-Mar-1999  thorpej Regen; pread(2) and pwrite(2).
 1.5 09-Feb-1999  christos Regen
 1.4 10-Dec-1998  christos Regen
 1.3 04-Oct-1998  fvdl Assign my copyright to TNF. Merge with others were appropriate.
Regen syscall files after script change.
 1.2 03-Oct-1998  christos Attempt to fix the mess.
 1.1 01-Oct-1998  erh Regen.
 1.8.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.8.2.2 15-Aug-2000  he Pull up regenerated files (requested by abs):
Enable basic versions of Linux fsuid calls.
 1.8.2.1 31-Jan-2000  he Pull up generated files (requested by abs):
Enable emulation of vfork(2).
 1.12.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.12.2.7 21-Apr-2001  bouyer Sync with HEAD
 1.12.2.6 11-Feb-2001  bouyer Sync with HEAD.
 1.12.2.5 05-Jan-2001  bouyer Sync with HEAD
 1.12.2.4 13-Dec-2000  bouyer Sync with HEAD (for UBC fixes).
 1.12.2.3 08-Dec-2000  bouyer Sync with HEAD.
 1.12.2.2 22-Nov-2000  bouyer Sync with HEAD.
 1.12.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.17.4.2 01-May-2001  he Pull up regenerated files (requested by jdolecek):
Make it possible to use a different function for unimplemented
syscalls than sys_nosys(), so that the Linux emulation can avoid
posting SIGSYS and instead just return ENOSYS.
 1.17.4.1 30-Mar-2001  he Pull up regenerated files (requested by fvdl):
Add some required Linux emulation bits to support the Linux
version of VMware.
 1.34.2.9 29-May-2002  nathanw Regen.
 1.34.2.8 17-Apr-2002  nathanw Catch up to -current.
 1.34.2.7 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.34.2.6 28-Feb-2002  nathanw Catch up to -current.
 1.34.2.5 14-Nov-2001  nathanw Catch up to -current.
 1.34.2.4 08-Oct-2001  nathanw Catch up to -current.
 1.34.2.3 21-Jun-2001  nathanw Catch up to -current.
 1.34.2.2 09-Apr-2001  nathanw Catch up with -current.
 1.34.2.1 05-Mar-2001  nathanw Initial commit of scheduler activations and lightweight process support.
 1.38.4.1 01-Oct-2001  fvdl Catch up with -current.
 1.38.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.38.2.2 16-Mar-2002  jdolecek Catch up with -current.
 1.38.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.44.4.3 14-Jun-2004  jmc Regen for changes in ticket #1708
 1.44.4.2 11-May-2004  tron Regen for ticket 1686.
 1.44.4.1 22-Oct-2003  jmc Regen files (requested by tv in ticket #1427)

Proper support for mmap2
 1.47.2.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.47.2.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.47.2.4 24-Sep-2004  skrll Sync with HEAD.
 1.47.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.47.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.47.2.1 03-Aug-2004  skrll Sync with HEAD
 1.54.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.54.4.1 29-Apr-2005  kent sync with -current
 1.57.2.5 21-Jan-2008  yamt sync with head
 1.57.2.4 07-Dec-2007  yamt sync with head
 1.57.2.3 03-Sep-2007  yamt sync with head.
 1.57.2.2 30-Dec-2006  yamt sync with head.
 1.57.2.1 21-Jun-2006  yamt sync with head.
 1.62.14.1 19-Jun-2006  chap Sync with head.
 1.62.8.2 03-Sep-2006  yamt sync with head.
 1.62.8.1 26-Jun-2006  yamt sync with head.
 1.62.4.1 09-Sep-2006  rpaulo sync with head
 1.65.8.1 12-Mar-2007  rmind Sync with HEAD.
 1.66.4.1 11-Jul-2007  mjf Sync with head.
 1.66.2.1 15-Jul-2007  ad Sync with head.
 1.68.14.3 18-Feb-2008  mjf Sync with HEAD.
 1.68.14.2 27-Dec-2007  mjf Sync with HEAD.
 1.68.14.1 19-Nov-2007  mjf Sync with HEAD.
 1.68.12.1 18-Nov-2007  bouyer Sync with HEAD
 1.68.8.2 23-Mar-2008  matt sync with HEAD
 1.68.8.1 09-Jan-2008  matt sync with HEAD
 1.68.6.1 21-Nov-2007  joerg Sync with HEAD.
 1.69.6.2 19-Jan-2008  bouyer Sync with HEAD
 1.69.6.1 02-Jan-2008  bouyer Sync with HEAD
 1.69.2.1 26-Dec-2007  ad Sync with head.
 1.73.8.3 20-Nov-2008  christos merge with head.
 1.73.8.2 01-Nov-2008  christos Sync with head.
 1.73.8.1 29-Mar-2008  christos Welcome to the time_t=long long dev_t=uint64_t branch.
 1.73.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.73.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.74.2.1 18-May-2008  yamt sync with head.
 1.75.8.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.75.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.75.2.4 11-Aug-2010  yamt sync with head.
 1.75.2.3 11-Mar-2010  yamt sync with head
 1.75.2.2 20-Jun-2009  yamt sync with head
 1.75.2.1 04-May-2009  yamt sync with head.
 1.77.4.1 20-Nov-2008  snj Regen for ticket 81.
 1.77.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.83.2.1 23-Jul-2009  jym Sync with HEAD.
 1.86.4.4 31-May-2011  rmind sync with head
 1.86.4.3 21-Apr-2011  rmind sync with head
 1.86.4.2 05-Mar-2011  rmind sync with head
 1.86.4.1 30-May-2010  rmind sync with head
 1.86.2.2 17-Aug-2010  uebayasi Sync with HEAD.
 1.86.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.88.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.91.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.91.4.2 30-Oct-2012  yamt sync with head
 1.91.4.1 17-Apr-2012  yamt sync with head
 1.92.10.4 03-Dec-2017  jdolecek update from HEAD
 1.92.10.3 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.92.10.2 23-Jun-2013  tls resync from head
 1.92.10.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.94.4.1 18-May-2014  rmind sync with head
 1.97.2.1 10-Aug-2014  tls Rebase.
 1.103.2.1 17-Apr-2017  snj regen for ticket 1354
 1.104.2.3 05-Feb-2017  skrll Sync with HEAD
 1.104.2.2 05-Oct-2016  skrll Sync with HEAD
 1.104.2.1 06-Apr-2015  skrll Sync with HEAD
 1.107.2.3 20-Mar-2017  pgoyette Sync with HEAD
 1.107.2.2 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.107.2.1 26-Jul-2016  pgoyette Sync with HEAD
 1.111.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.112.4.1 11-May-2017  pgoyette Sync with HEAD
 1.113.10.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.113.10.1 10-Jun-2019  christos Sync with HEAD
 1.113.8.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.116.2.2 17-Dec-2020  thorpej Regen for preadv(2) and pwritev(2).
 1.116.2.1 15-Dec-2020  thorpej Regen for eventfd, timerfd, POSIX timers.
 1.127.2.1 02-Aug-2025  perseant Sync with HEAD
 1.129 28-Sep-2024  christos regen
 1.128 01-Jul-2024  christos regen
 1.127 29-Jun-2024  christos branches: 1.127.2;
regen
 1.126 19-Aug-2023  christos regen
 1.125 18-Aug-2023  christos regen
 1.124 29-Jul-2023  christos regen
 1.123 28-Jul-2023  christos regen
 1.122 10-Jul-2023  christos regen
 1.121 02-Dec-2021  ryo regen
 1.120 20-Sep-2021  thorpej Regen for preadv(2) / pwritev(2).
 1.119 20-Sep-2021  thorpej Regen for eventfd.
 1.118 19-Sep-2021  thorpej Regen for timerfd.
 1.117 19-Sep-2021  thorpej Regen for POSIX timer syscalls.
 1.116 26-Apr-2020  thorpej branches: 1.116.2;
Regen for native futex calls.
 1.115 09-Nov-2019  jdolecek regen
 1.114 10-Aug-2018  pgoyette Regen
 1.113 10-May-2017  riastradh branches: 1.113.8; 1.113.10;
regen
 1.112 16-Jan-2017  christos branches: 1.112.4;
regen all
 1.111 13-Jan-2017  christos branches: 1.111.2;
regen
 1.110 02-Jan-2017  martin Regen (something apparently went wrong in previous)
 1.109 02-Jan-2017  manu Regen
 1.108 24-Jul-2016  njoly Regen for readlink/readlinkat signatures.
 1.107 24-Sep-2015  christos branches: 1.107.2;
regen
 1.106 23-Mar-2015  ozaki-r Regen
 1.105 07-Mar-2015  christos regen
 1.104 22-Nov-2014  njoly branches: 1.104.2;
Regen for ppoll signature fix
 1.103 31-May-2014  njoly branches: 1.103.2;
Regen for munmap(2) signature.
 1.102 29-May-2014  njoly Regen for utimes(2) change.
 1.101 20-May-2014  njoly Regen for getgroups/setgroups update.
 1.100 17-May-2014  njoly Regen for fadvise64 offset types changes.
 1.99 04-May-2014  njoly Regen for pread/pwrite 64bit offset argument.
 1.98 08-Apr-2014  njoly Regen.
 1.97 18-Nov-2013  chs branches: 1.97.2;
regen
 1.96 07-Nov-2013  njoly Regen for dup/dup2/dup3 argument types fix.
 1.95 24-Sep-2013  njoly Regen for utimensat(2).
 1.94 08-Apr-2013  pooka branches: 1.94.4;
regen for utimes
 1.93 19-Sep-2012  pooka regen for ppoll (and, apparently, SYCALL_ARG_PTR)
 1.92 18-Nov-2011  christos branches: 1.92.10;
- add sigtimedwait support.
- merge the siginfo population code.
 1.91 30-May-2011  alnsn branches: 1.91.4;
Regenerate files to pick up correct RCS Ids. Suggested by Chris Badura.
 1.90 30-May-2011  alnsn Add fadvise64 and fadvise64_64 syscalls to compat_linux and compat_linux32.
 1.89 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.88 07-Jul-2010  chs branches: 1.88.2;
regen
 1.87 23-Apr-2010  chs regen
 1.86 14-Dec-2009  matt branches: 1.86.2; 1.86.4;
Regen (new makesyscalls.sh)
 1.85 24-Nov-2009  njoly Regen for personality(2) update.
 1.84 08-Jun-2009  njoly Regen for rt_queueinfo(2) update.
 1.83 17-Jan-2009  njoly branches: 1.83.2;
Regen for wait4 update.
 1.82 13-Jan-2009  pooka Regen to prove I didn't screw up the conversion: purely RCSID changes.
 1.81 11-Jan-2009  christos merge christos-time_t
 1.80 19-Nov-2008  ad Regen.
 1.79 19-Nov-2008  njoly Regen for futex timeout argument cleanup/fix.
 1.78 12-Nov-2008  njoly Regen for nanosleep(2) fix.
 1.77 26-Oct-2008  christos branches: 1.77.2; 1.77.4;
regen
 1.76 26-Oct-2008  christos regen
 1.75 23-Apr-2008  ad branches: 1.75.2; 1.75.4; 1.75.8;
Regen.
 1.74 04-Apr-2008  njoly branches: 1.74.2;
Regen for linux_sys_msync removal.
 1.73 15-Jan-2008  njoly branches: 1.73.6; 1.73.8;
Regen.
 1.72 24-Dec-2007  njoly Regen for linux_sys_getpgid removal.
 1.71 21-Dec-2007  njoly Regen for getfsuid/setfsgid syscall exchange.
 1.70 20-Dec-2007  dsl regen
 1.69 16-Nov-2007  njoly branches: 1.69.2; 1.69.6;
Regen, for syscalls cleanup.
 1.68 13-Jun-2007  christos branches: 1.68.6; 1.68.8; 1.68.12; 1.68.14;
regen
 1.67 13-Jun-2007  christos regen.
 1.66 04-Mar-2007  christos branches: 1.66.2; 1.66.4;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.65 01-Sep-2006  matt branches: 1.65.8;
Regen.
 1.64 30-Aug-2006  matt Regen
 1.63 10-Jun-2006  christos regen
 1.62 11-Dec-2005  christos branches: 1.62.4; 1.62.8; 1.62.14;
merge ktrace-lwp.
 1.61 06-Nov-2005  manu regen
 1.60 06-Nov-2005  tron Regen with correct RCS Ids.
 1.59 05-Nov-2005  dogcow mirror manu's amd64 changes to implement linux sched_{seg,get}affinity;
the kernel and linux lkm now compile again.
 1.58 18-Oct-2005  joerg Regen.
 1.57 16-May-2005  fvdl branches: 1.57.2;
Regen.
 1.56 16-May-2005  fvdl Regen.
 1.55 26-Feb-2005  perry regen
 1.54 20-Sep-2004  jdolecek branches: 1.54.4; 1.54.6;
regen:
implement support for Linux statfs64() syscall - 64bit variant of statfs()
 1.53 08-Sep-2004  jdolecek regen: add exit_group(2)
 1.52 01-Aug-2004  jdolecek regen - sync syscall lists with Linux kernel 2.6.7
 1.51 01-Aug-2004  jdolecek regen:

connect madvise(2) and mincore(2) - apparently the newer Linux libs
don't stub it anymore, so allow the application to take advantage
of them

the Linux calls appear to be compatible in the flag values and semantics,
so a wrapper is not necessary
 1.50 01-Aug-2004  jdolecek connect madvise(2) and mincore(2) - apparently the newer Linux libs
don't stub it anymore, so allow the application to take advantage
of them

the Linux calls appear to be compatible in the flag values and semantics,
so a wrapper is not necessary
 1.49 10-Aug-2003  jdolecek regen - added wrapper for Linux ftruncate64()
 1.48 03-Jul-2003  christos Regen.
 1.47 23-Jun-2003  christos branches: 1.47.2;
Regen.
 1.46 18-Jan-2003  thorpej Regen for correct RCS IDs.
 1.45 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.44 10-Apr-2002  christos branches: 1.44.4;
regen
 1.43 22-Mar-2002  christos regen
 1.42 15-Feb-2002  christos regen
 1.41 15-Feb-2002  christos - add a real linux_sys___sysctl because the mib numbers are different.
implement only the kernel version getting entries.
- make the signal conversion functions consistent; dest is arg 1.
- make linux_fakedev deal with block and char devices differently.
- add linux_sys_ugetrlimit, and flesh out the regular get/setrlimit so
that they work properly.
- add linux_mmap2 [untested].
- bump kernel to 2.4.18, and make the date be valentine's day :-)
- linux_sys_*stat64 family was totally busted. Fix it.

tested only on i386.

Status:
gdb, telnet, work
jdk-1.4.0 extractor works, jdk still coredumps.

christos
 1.40 13-Nov-2001  lukem add RCSIDs (including regeneration of files as appropriate)
 1.39 30-Sep-2001  manu Fixes my last commit: only mips really need fcntl64 to work now. i386 and
powerpc could use it later if needed. m68k and alpha should never need it.
 1.38 30-May-2001  mrg branches: 1.38.2; 1.38.4;
use _KERNEL_OPT.
 1.37 13-May-2001  manu Improved the accuracy of gettimeofday/settimeofday: Linux stores a srtuct
timezone in the kernel. We now keep track of it for emulated processes.
Tested for powerpc and i386. Untested on m68k, but it should be ok
Alpha has a particular implementation (osf1_sys_gettimeofday), and it has
therefore not been touched.
 1.36 30-Mar-2001  jdolecek regen
 1.35 30-Mar-2001  jdolecek regen
 1.34 27-Jan-2001  thorpej branches: 1.34.2;
Regen; getpid(2) is MP-safe.
 1.33 27-Jan-2001  thorpej Regen; add sy_flags.
 1.32 29-Dec-2000  fvdl Regen.
 1.31 27-Dec-2000  fvdl Regen.
 1.30 18-Dec-2000  fvdl Regen.
 1.29 13-Dec-2000  augustss Regen.
 1.28 12-Dec-2000  jdolecek regen
 1.27 12-Dec-2000  jdolecek regen
 1.26 11-Dec-2000  mycroft Regen.
 1.25 09-Dec-2000  jdolecek regen
 1.24 09-Dec-2000  mycroft Regen.
 1.23 02-Dec-2000  jdolecek regen after addition of linux_sys_swapoff()
 1.22 01-Dec-2000  jdolecek regen
 1.21 01-Nov-2000  jdolecek regen
 1.20 23-Aug-2000  christos regen
 1.19 18-Aug-2000  cgd update for changed makesyscalls.master
 1.18 18-Aug-2000  cgd update for new makesyscalls.sh, and also for correct ids for changed
syscalls.master files. (you need to regenerate after checking in
syscalls.master to get the correct ids.)
 1.17 18-Mar-2000  erh branches: 1.17.4;
Regen.
 1.16 03-Feb-2000  abs regen
 1.15 12-Dec-1999  tron Regen.
 1.14 05-Dec-1999  tron Regen.
 1.13 04-Dec-1999  tron Regen.
 1.12 04-Oct-1999  tron branches: 1.12.2; 1.12.8;
Regen from "syscalls.master".
 1.11 16-Aug-1999  tron Regen.
 1.10 14-May-1999  thorpej Regen.
 1.9 13-May-1999  thorpej Regen.
 1.8 30-Mar-1999  abs branches: 1.8.2; 1.8.4;
Regenerate (with poll())
 1.7 27-Mar-1999  tron Regen.
 1.6 23-Mar-1999  thorpej Regen; pread(2) and pwrite(2).
 1.5 09-Feb-1999  christos Regen
 1.4 10-Dec-1998  christos Regen
 1.3 04-Oct-1998  fvdl Assign my copyright to TNF. Merge with others were appropriate.
Regen syscall files after script change.
 1.2 03-Oct-1998  christos Attempt to fix the mess.
 1.1 01-Oct-1998  erh Regen.
 1.8.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.8.2.2 15-Aug-2000  he Pull up regenerated files (requested by abs):
Enable basic versions of Linux fsuid calls.
 1.8.2.1 31-Jan-2000  he Pull up generated files (requested by abs):
Enable emulation of vfork(2).
 1.12.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.12.2.7 21-Apr-2001  bouyer Sync with HEAD
 1.12.2.6 11-Feb-2001  bouyer Sync with HEAD.
 1.12.2.5 05-Jan-2001  bouyer Sync with HEAD
 1.12.2.4 13-Dec-2000  bouyer Sync with HEAD (for UBC fixes).
 1.12.2.3 08-Dec-2000  bouyer Sync with HEAD.
 1.12.2.2 22-Nov-2000  bouyer Sync with HEAD.
 1.12.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.17.4.2 01-May-2001  he Pull up regenerated files (requested by jdolecek):
Make it possible to use a different function for unimplemented
syscalls than sys_nosys(), so that the Linux emulation can avoid
posting SIGSYS and instead just return ENOSYS.
 1.17.4.1 30-Mar-2001  he Pull up regenerated files (requested by fvdl):
Add some required Linux emulation bits to support the Linux
version of VMware.
 1.34.2.9 29-May-2002  nathanw Regen.
 1.34.2.8 17-Apr-2002  nathanw Catch up to -current.
 1.34.2.7 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.34.2.6 28-Feb-2002  nathanw Catch up to -current.
 1.34.2.5 14-Nov-2001  nathanw Catch up to -current.
 1.34.2.4 08-Oct-2001  nathanw Catch up to -current.
 1.34.2.3 21-Jun-2001  nathanw Catch up to -current.
 1.34.2.2 09-Apr-2001  nathanw Catch up with -current.
 1.34.2.1 05-Mar-2001  nathanw Initial commit of scheduler activations and lightweight process support.
 1.38.4.1 01-Oct-2001  fvdl Catch up with -current.
 1.38.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.38.2.2 16-Mar-2002  jdolecek Catch up with -current.
 1.38.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.44.4.3 14-Jun-2004  jmc Regen for changes in ticket #1708
 1.44.4.2 11-May-2004  tron Regen for ticket 1686.
 1.44.4.1 22-Oct-2003  jmc Regen files (requested by tv in ticket #1427)

Proper support for mmap2
 1.47.2.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.47.2.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.47.2.4 24-Sep-2004  skrll Sync with HEAD.
 1.47.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.47.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.47.2.1 03-Aug-2004  skrll Sync with HEAD
 1.54.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.54.4.1 29-Apr-2005  kent sync with -current
 1.57.2.5 21-Jan-2008  yamt sync with head
 1.57.2.4 07-Dec-2007  yamt sync with head
 1.57.2.3 03-Sep-2007  yamt sync with head.
 1.57.2.2 30-Dec-2006  yamt sync with head.
 1.57.2.1 21-Jun-2006  yamt sync with head.
 1.62.14.1 19-Jun-2006  chap Sync with head.
 1.62.8.2 03-Sep-2006  yamt sync with head.
 1.62.8.1 26-Jun-2006  yamt sync with head.
 1.62.4.1 09-Sep-2006  rpaulo sync with head
 1.65.8.1 12-Mar-2007  rmind Sync with HEAD.
 1.66.4.1 11-Jul-2007  mjf Sync with head.
 1.66.2.1 15-Jul-2007  ad Sync with head.
 1.68.14.3 18-Feb-2008  mjf Sync with HEAD.
 1.68.14.2 27-Dec-2007  mjf Sync with HEAD.
 1.68.14.1 19-Nov-2007  mjf Sync with HEAD.
 1.68.12.1 18-Nov-2007  bouyer Sync with HEAD
 1.68.8.2 23-Mar-2008  matt sync with HEAD
 1.68.8.1 09-Jan-2008  matt sync with HEAD
 1.68.6.1 21-Nov-2007  joerg Sync with HEAD.
 1.69.6.2 19-Jan-2008  bouyer Sync with HEAD
 1.69.6.1 02-Jan-2008  bouyer Sync with HEAD
 1.69.2.1 26-Dec-2007  ad Sync with head.
 1.73.8.3 20-Nov-2008  christos merge with head.
 1.73.8.2 01-Nov-2008  christos Sync with head.
 1.73.8.1 29-Mar-2008  christos Welcome to the time_t=long long dev_t=uint64_t branch.
 1.73.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.73.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.74.2.1 18-May-2008  yamt sync with head.
 1.75.8.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.75.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.75.2.4 11-Aug-2010  yamt sync with head.
 1.75.2.3 11-Mar-2010  yamt sync with head
 1.75.2.2 20-Jun-2009  yamt sync with head
 1.75.2.1 04-May-2009  yamt sync with head.
 1.77.4.1 20-Nov-2008  snj Regen for ticket 81.
 1.77.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.83.2.1 23-Jul-2009  jym Sync with HEAD.
 1.86.4.4 31-May-2011  rmind sync with head
 1.86.4.3 21-Apr-2011  rmind sync with head
 1.86.4.2 05-Mar-2011  rmind sync with head
 1.86.4.1 30-May-2010  rmind sync with head
 1.86.2.2 17-Aug-2010  uebayasi Sync with HEAD.
 1.86.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.88.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.91.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.91.4.2 30-Oct-2012  yamt sync with head
 1.91.4.1 17-Apr-2012  yamt sync with head
 1.92.10.4 03-Dec-2017  jdolecek update from HEAD
 1.92.10.3 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.92.10.2 23-Jun-2013  tls resync from head
 1.92.10.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.94.4.1 18-May-2014  rmind sync with head
 1.97.2.1 10-Aug-2014  tls Rebase.
 1.103.2.1 17-Apr-2017  snj regen for ticket 1354
 1.104.2.4 28-Aug-2017  skrll Sync with HEAD
 1.104.2.3 05-Feb-2017  skrll Sync with HEAD
 1.104.2.2 05-Oct-2016  skrll Sync with HEAD
 1.104.2.1 06-Apr-2015  skrll Sync with HEAD
 1.107.2.3 20-Mar-2017  pgoyette Sync with HEAD
 1.107.2.2 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.107.2.1 26-Jul-2016  pgoyette Sync with HEAD
 1.111.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.112.4.1 11-May-2017  pgoyette Sync with HEAD
 1.113.10.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.113.10.1 10-Jun-2019  christos Sync with HEAD
 1.113.8.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.116.2.2 17-Dec-2020  thorpej Regen for preadv(2) and pwritev(2).
 1.116.2.1 15-Dec-2020  thorpej Regen for eventfd, timerfd, POSIX timers.
 1.127.2.1 02-Aug-2025  perseant Sync with HEAD
 1.130 28-Sep-2024  christos regen
 1.129 01-Jul-2024  christos regen
 1.128 29-Jun-2024  christos branches: 1.128.2;
regen
 1.127 19-Aug-2023  christos regen
 1.126 18-Aug-2023  christos regen
 1.125 29-Jul-2023  christos regen
 1.124 28-Jul-2023  christos regen
 1.123 10-Jul-2023  christos regen
 1.122 02-Dec-2021  ryo regen
 1.121 20-Sep-2021  thorpej Regen for preadv(2) / pwritev(2).
 1.120 20-Sep-2021  thorpej Regen for eventfd.
 1.119 19-Sep-2021  thorpej Regen for timerfd.
 1.118 19-Sep-2021  thorpej Regen for POSIX timer syscalls.
 1.117 26-Apr-2020  thorpej branches: 1.117.2;
Regen for native futex calls.
 1.116 09-Nov-2019  jdolecek regen
 1.115 10-Aug-2018  pgoyette Regen
 1.114 10-May-2017  riastradh branches: 1.114.8; 1.114.10;
regen
 1.113 16-Jan-2017  christos branches: 1.113.4;
regen all
 1.112 13-Jan-2017  christos branches: 1.112.2;
regen
 1.111 02-Jan-2017  martin Regen (something apparently went wrong in previous)
 1.110 02-Jan-2017  manu Regen
 1.109 24-Jul-2016  njoly Regen for readlink/readlinkat signatures.
 1.108 24-Sep-2015  christos branches: 1.108.2;
regen
 1.107 23-Mar-2015  ozaki-r Regen
 1.106 07-Mar-2015  christos regen
 1.105 22-Nov-2014  njoly branches: 1.105.2;
Regen for ppoll signature fix
 1.104 31-May-2014  njoly branches: 1.104.2;
Regen for munmap(2) signature.
 1.103 29-May-2014  njoly Regen for utimes(2) change.
 1.102 20-May-2014  njoly Regen for getgroups/setgroups update.
 1.101 17-May-2014  njoly Regen for fadvise64 offset types changes.
 1.100 04-May-2014  njoly Regen for pread/pwrite 64bit offset argument.
 1.99 08-Apr-2014  njoly Regen.
 1.98 18-Nov-2013  chs branches: 1.98.2;
regen
 1.97 07-Nov-2013  njoly Regen for dup/dup2/dup3 argument types fix.
 1.96 24-Sep-2013  njoly Regen for utimensat(2).
 1.95 08-Apr-2013  pooka branches: 1.95.4;
regen for utimes
 1.94 19-Sep-2012  pooka regen for ppoll (and, apparently, SYCALL_ARG_PTR)
 1.93 18-Nov-2011  christos branches: 1.93.10;
- add sigtimedwait support.
- merge the siginfo population code.
 1.92 30-May-2011  alnsn branches: 1.92.4;
Regenerate files to pick up correct RCS Ids. Suggested by Chris Badura.
 1.91 30-May-2011  alnsn Add fadvise64 and fadvise64_64 syscalls to compat_linux and compat_linux32.
 1.90 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.89 07-Jul-2010  chs branches: 1.89.2;
regen
 1.88 23-Apr-2010  chs regen
 1.87 14-Dec-2009  matt branches: 1.87.2; 1.87.4;
Regen (new makesyscalls.sh)
 1.86 24-Nov-2009  njoly Regen for personality(2) update.
 1.85 08-Jun-2009  njoly Regen for rt_queueinfo(2) update.
 1.84 17-Jan-2009  njoly branches: 1.84.2;
Regen for wait4 update.
 1.83 13-Jan-2009  pooka Regen to prove I didn't screw up the conversion: purely RCSID changes.
 1.82 11-Jan-2009  christos merge christos-time_t
 1.81 19-Nov-2008  ad Regen.
 1.80 19-Nov-2008  njoly Regen for futex timeout argument cleanup/fix.
 1.79 12-Nov-2008  njoly Regen for nanosleep(2) fix.
 1.78 26-Oct-2008  christos branches: 1.78.2; 1.78.4;
regen
 1.77 26-Oct-2008  christos regen
 1.76 23-Apr-2008  ad branches: 1.76.2; 1.76.4; 1.76.8;
Regen.
 1.75 04-Apr-2008  njoly branches: 1.75.2;
Regen for linux_sys_msync removal.
 1.74 15-Jan-2008  njoly branches: 1.74.6; 1.74.8;
Regen.
 1.73 24-Dec-2007  njoly Regen for linux_sys_getpgid removal.
 1.72 21-Dec-2007  njoly Regen for getfsuid/setfsgid syscall exchange.
 1.71 20-Dec-2007  dsl regen
 1.70 16-Nov-2007  njoly branches: 1.70.2; 1.70.6;
Regen, for syscalls cleanup.
 1.69 13-Jun-2007  christos branches: 1.69.6; 1.69.8; 1.69.12; 1.69.14;
regen
 1.68 13-Jun-2007  christos regen.
 1.67 09-Feb-2007  ad branches: 1.67.6; 1.67.8;
Merge newlock2 to head.
 1.66 01-Sep-2006  matt branches: 1.66.2;
Regen.
 1.65 30-Aug-2006  matt Regen
 1.64 10-Jun-2006  christos regen
 1.63 11-Dec-2005  christos branches: 1.63.4; 1.63.8; 1.63.14;
merge ktrace-lwp.
 1.62 06-Nov-2005  manu regen
 1.61 06-Nov-2005  tron Regen with correct RCS Ids.
 1.60 05-Nov-2005  dogcow mirror manu's amd64 changes to implement linux sched_{seg,get}affinity;
the kernel and linux lkm now compile again.
 1.59 18-Oct-2005  joerg Regen.
 1.58 16-May-2005  fvdl branches: 1.58.2;
Regen.
 1.57 16-May-2005  fvdl Regen.
 1.56 26-Feb-2005  perry regen
 1.55 20-Sep-2004  jdolecek branches: 1.55.4; 1.55.6;
regen:
implement support for Linux statfs64() syscall - 64bit variant of statfs()
 1.54 08-Sep-2004  jdolecek regen: add exit_group(2)
 1.53 01-Aug-2004  jdolecek regen - sync syscall lists with Linux kernel 2.6.7
 1.52 01-Aug-2004  jdolecek regen:

connect madvise(2) and mincore(2) - apparently the newer Linux libs
don't stub it anymore, so allow the application to take advantage
of them

the Linux calls appear to be compatible in the flag values and semantics,
so a wrapper is not necessary
 1.51 01-Aug-2004  jdolecek connect madvise(2) and mincore(2) - apparently the newer Linux libs
don't stub it anymore, so allow the application to take advantage
of them

the Linux calls appear to be compatible in the flag values and semantics,
so a wrapper is not necessary
 1.50 10-Aug-2003  jdolecek regen - added wrapper for Linux ftruncate64()
 1.49 03-Jul-2003  christos Regen.
 1.48 23-Jun-2003  christos branches: 1.48.2;
Regen.
 1.47 18-Jan-2003  thorpej Regen for correct RCS IDs.
 1.46 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.45 10-Apr-2002  christos branches: 1.45.4;
regen
 1.44 22-Mar-2002  christos regen
 1.43 15-Feb-2002  christos regen
 1.42 15-Feb-2002  christos - add a real linux_sys___sysctl because the mib numbers are different.
implement only the kernel version getting entries.
- make the signal conversion functions consistent; dest is arg 1.
- make linux_fakedev deal with block and char devices differently.
- add linux_sys_ugetrlimit, and flesh out the regular get/setrlimit so
that they work properly.
- add linux_mmap2 [untested].
- bump kernel to 2.4.18, and make the date be valentine's day :-)
- linux_sys_*stat64 family was totally busted. Fix it.

tested only on i386.

Status:
gdb, telnet, work
jdk-1.4.0 extractor works, jdk still coredumps.

christos
 1.41 13-Nov-2001  lukem add RCSIDs (including regeneration of files as appropriate)
 1.40 30-Sep-2001  manu Fixes my last commit: only mips really need fcntl64 to work now. i386 and
powerpc could use it later if needed. m68k and alpha should never need it.
 1.39 30-May-2001  mrg branches: 1.39.2; 1.39.4;
use _KERNEL_OPT.
 1.38 13-May-2001  manu Improved the accuracy of gettimeofday/settimeofday: Linux stores a srtuct
timezone in the kernel. We now keep track of it for emulated processes.
Tested for powerpc and i386. Untested on m68k, but it should be ok
Alpha has a particular implementation (osf1_sys_gettimeofday), and it has
therefore not been touched.
 1.37 30-Mar-2001  jdolecek regen
 1.36 30-Mar-2001  jdolecek regen
 1.35 27-Jan-2001  thorpej branches: 1.35.2;
Regen; getpid(2) is MP-safe.
 1.34 27-Jan-2001  thorpej Regen; add sy_flags.
 1.33 29-Dec-2000  fvdl Regen.
 1.32 27-Dec-2000  fvdl Regen.
 1.31 18-Dec-2000  fvdl Regen.
 1.30 13-Dec-2000  augustss Regen.
 1.29 12-Dec-2000  jdolecek regen
 1.28 12-Dec-2000  jdolecek regen
 1.27 11-Dec-2000  mycroft Regen.
 1.26 09-Dec-2000  jdolecek regen
 1.25 09-Dec-2000  mycroft Regen.
 1.24 02-Dec-2000  jdolecek regen after addition of linux_sys_swapoff()
 1.23 01-Dec-2000  jdolecek regen
 1.22 13-Nov-2000  jdolecek change the type of *syscallnames[] array to 'const char * const foo[]'
 1.21 01-Nov-2000  jdolecek regen
 1.20 23-Aug-2000  christos regen
 1.19 18-Aug-2000  cgd update for changed makesyscalls.master
 1.18 18-Aug-2000  cgd update for new makesyscalls.sh, and also for correct ids for changed
syscalls.master files. (you need to regenerate after checking in
syscalls.master to get the correct ids.)
 1.17 18-Mar-2000  erh branches: 1.17.4;
Regen.
 1.16 03-Feb-2000  abs regen
 1.15 12-Dec-1999  tron Regen.
 1.14 05-Dec-1999  tron Regen.
 1.13 04-Dec-1999  tron Regen.
 1.12 04-Oct-1999  tron branches: 1.12.2; 1.12.8;
Regen from "syscalls.master".
 1.11 16-Aug-1999  tron Regen.
 1.10 14-May-1999  thorpej Regen.
 1.9 13-May-1999  thorpej Regen.
 1.8 30-Mar-1999  abs branches: 1.8.2; 1.8.4;
Regenerate (with poll())
 1.7 27-Mar-1999  tron Regen.
 1.6 23-Mar-1999  thorpej Regen; pread(2) and pwrite(2).
 1.5 09-Feb-1999  christos Regen
 1.4 10-Dec-1998  christos Regen
 1.3 04-Oct-1998  fvdl Assign my copyright to TNF. Merge with others were appropriate.
Regen syscall files after script change.
 1.2 03-Oct-1998  christos Attempt to fix the mess.
 1.1 01-Oct-1998  erh Regen.
 1.8.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.8.2.2 15-Aug-2000  he Pull up regenerated files (requested by abs):
Enable basic versions of Linux fsuid calls.
 1.8.2.1 31-Jan-2000  he Pull up generated files (requested by abs):
Enable emulation of vfork(2).
 1.12.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.12.2.7 21-Apr-2001  bouyer Sync with HEAD
 1.12.2.6 11-Feb-2001  bouyer Sync with HEAD.
 1.12.2.5 05-Jan-2001  bouyer Sync with HEAD
 1.12.2.4 13-Dec-2000  bouyer Sync with HEAD (for UBC fixes).
 1.12.2.3 08-Dec-2000  bouyer Sync with HEAD.
 1.12.2.2 22-Nov-2000  bouyer Sync with HEAD.
 1.12.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.17.4.2 01-May-2001  he Pull up regenerated files (requested by jdolecek):
Make it possible to use a different function for unimplemented
syscalls than sys_nosys(), so that the Linux emulation can avoid
posting SIGSYS and instead just return ENOSYS.
 1.17.4.1 30-Mar-2001  he Pull up regenerated files (requested by fvdl):
Add some required Linux emulation bits to support the Linux
version of VMware.
 1.35.2.9 29-May-2002  nathanw Regen.
 1.35.2.8 17-Apr-2002  nathanw Catch up to -current.
 1.35.2.7 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.35.2.6 28-Feb-2002  nathanw Catch up to -current.
 1.35.2.5 14-Nov-2001  nathanw Catch up to -current.
 1.35.2.4 08-Oct-2001  nathanw Catch up to -current.
 1.35.2.3 21-Jun-2001  nathanw Catch up to -current.
 1.35.2.2 09-Apr-2001  nathanw Catch up with -current.
 1.35.2.1 05-Mar-2001  nathanw Initial commit of scheduler activations and lightweight process support.
 1.39.4.1 01-Oct-2001  fvdl Catch up with -current.
 1.39.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.39.2.2 16-Mar-2002  jdolecek Catch up with -current.
 1.39.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.45.4.3 14-Jun-2004  jmc Regen for changes in ticket #1708
 1.45.4.2 11-May-2004  tron Regen for ticket 1686.
 1.45.4.1 22-Oct-2003  jmc Regen files (requested by tv in ticket #1427)

Proper support for mmap2
 1.48.2.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.48.2.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.48.2.4 24-Sep-2004  skrll Sync with HEAD.
 1.48.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.48.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.48.2.1 03-Aug-2004  skrll Sync with HEAD
 1.55.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.55.4.1 29-Apr-2005  kent sync with -current
 1.58.2.6 21-Jan-2008  yamt sync with head
 1.58.2.5 07-Dec-2007  yamt sync with head
 1.58.2.4 03-Sep-2007  yamt sync with head.
 1.58.2.3 26-Feb-2007  yamt sync with head.
 1.58.2.2 30-Dec-2006  yamt sync with head.
 1.58.2.1 21-Jun-2006  yamt sync with head.
 1.63.14.1 19-Jun-2006  chap Sync with head.
 1.63.8.2 03-Sep-2006  yamt sync with head.
 1.63.8.1 26-Jun-2006  yamt sync with head.
 1.63.4.1 09-Sep-2006  rpaulo sync with head
 1.66.2.1 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.67.8.1 11-Jul-2007  mjf Sync with head.
 1.67.6.1 15-Jul-2007  ad Sync with head.
 1.69.14.3 18-Feb-2008  mjf Sync with HEAD.
 1.69.14.2 27-Dec-2007  mjf Sync with HEAD.
 1.69.14.1 19-Nov-2007  mjf Sync with HEAD.
 1.69.12.1 18-Nov-2007  bouyer Sync with HEAD
 1.69.8.2 23-Mar-2008  matt sync with HEAD
 1.69.8.1 09-Jan-2008  matt sync with HEAD
 1.69.6.1 21-Nov-2007  joerg Sync with HEAD.
 1.70.6.2 19-Jan-2008  bouyer Sync with HEAD
 1.70.6.1 02-Jan-2008  bouyer Sync with HEAD
 1.70.2.1 26-Dec-2007  ad Sync with head.
 1.74.8.3 20-Nov-2008  christos merge with head.
 1.74.8.2 01-Nov-2008  christos Sync with head.
 1.74.8.1 29-Mar-2008  christos Welcome to the time_t=long long dev_t=uint64_t branch.
 1.74.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.74.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.75.2.1 18-May-2008  yamt sync with head.
 1.76.8.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.76.4.2 14-May-2008  wrstuden Per discussion with ad, remove most of the #include <sys/sa.h> lines
as they were including sa.h just for the type(s) needed for syscallargs.h.

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

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

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

I think this reduction is very good thing.
 1.76.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.76.2.4 11-Aug-2010  yamt sync with head.
 1.76.2.3 11-Mar-2010  yamt sync with head
 1.76.2.2 20-Jun-2009  yamt sync with head
 1.76.2.1 04-May-2009  yamt sync with head.
 1.78.4.1 20-Nov-2008  snj Regen for ticket 81.
 1.78.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.84.2.1 23-Jul-2009  jym Sync with HEAD.
 1.87.4.4 31-May-2011  rmind sync with head
 1.87.4.3 21-Apr-2011  rmind sync with head
 1.87.4.2 05-Mar-2011  rmind sync with head
 1.87.4.1 30-May-2010  rmind sync with head
 1.87.2.2 17-Aug-2010  uebayasi Sync with HEAD.
 1.87.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.89.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.92.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.92.4.2 30-Oct-2012  yamt sync with head
 1.92.4.1 17-Apr-2012  yamt sync with head
 1.93.10.4 03-Dec-2017  jdolecek update from HEAD
 1.93.10.3 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.93.10.2 23-Jun-2013  tls resync from head
 1.93.10.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.95.4.1 18-May-2014  rmind sync with head
 1.98.2.1 10-Aug-2014  tls Rebase.
 1.104.2.1 17-Apr-2017  snj regen for ticket 1354
 1.105.2.4 05-Feb-2017  skrll Sync with HEAD
 1.105.2.3 05-Oct-2016  skrll Sync with HEAD
 1.105.2.2 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.105.2.1 06-Apr-2015  skrll Sync with HEAD
 1.108.2.3 20-Mar-2017  pgoyette Sync with HEAD
 1.108.2.2 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.108.2.1 26-Jul-2016  pgoyette Sync with HEAD
 1.112.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.113.4.1 11-May-2017  pgoyette Sync with HEAD
 1.114.10.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.114.10.1 10-Jun-2019  christos Sync with HEAD
 1.114.8.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.117.2.2 17-Dec-2020  thorpej Regen for preadv(2) and pwritev(2).
 1.117.2.1 15-Dec-2020  thorpej Regen for eventfd, timerfd, POSIX timers.
 1.128.2.1 02-Aug-2025  perseant Sync with HEAD
 1.129 28-Sep-2024  christos regen
 1.128 01-Jul-2024  christos regen
 1.127 29-Jun-2024  christos branches: 1.127.2;
regen
 1.126 19-Aug-2023  christos regen
 1.125 18-Aug-2023  christos regen
 1.124 29-Jul-2023  christos regen
 1.123 28-Jul-2023  christos regen
 1.122 10-Jul-2023  christos regen
 1.121 02-Dec-2021  ryo regen
 1.120 20-Sep-2021  thorpej Regen for preadv(2) / pwritev(2).
 1.119 20-Sep-2021  thorpej Regen for eventfd.
 1.118 19-Sep-2021  thorpej Regen for timerfd.
 1.117 19-Sep-2021  thorpej Regen for POSIX timer syscalls.
 1.116 26-Apr-2020  thorpej branches: 1.116.2;
Regen for native futex calls.
 1.115 09-Nov-2019  jdolecek regen
 1.114 10-Aug-2018  pgoyette Regen
 1.113 10-May-2017  riastradh branches: 1.113.8; 1.113.10;
regen
 1.112 16-Jan-2017  christos branches: 1.112.4;
regen all
 1.111 13-Jan-2017  christos branches: 1.111.2;
regen
 1.110 02-Jan-2017  martin Regen (something apparently went wrong in previous)
 1.109 02-Jan-2017  manu Regen
 1.108 24-Jul-2016  njoly Regen for readlink/readlinkat signatures.
 1.107 24-Sep-2015  christos branches: 1.107.2;
regen
 1.106 23-Mar-2015  ozaki-r Regen
 1.105 07-Mar-2015  christos regen
 1.104 22-Nov-2014  njoly branches: 1.104.2;
Regen for ppoll signature fix
 1.103 31-May-2014  njoly branches: 1.103.2;
Regen for munmap(2) signature.
 1.102 29-May-2014  njoly Regen for utimes(2) change.
 1.101 20-May-2014  njoly Regen for getgroups/setgroups update.
 1.100 17-May-2014  njoly Regen for fadvise64 offset types changes.
 1.99 04-May-2014  njoly Regen for pread/pwrite 64bit offset argument.
 1.98 08-Apr-2014  njoly Regen.
 1.97 18-Nov-2013  chs branches: 1.97.2;
regen
 1.96 07-Nov-2013  njoly Regen for dup/dup2/dup3 argument types fix.
 1.95 24-Sep-2013  njoly Regen for utimensat(2).
 1.94 08-Apr-2013  pooka branches: 1.94.4;
regen for utimes
 1.93 19-Sep-2012  pooka regen for ppoll (and, apparently, SYCALL_ARG_PTR)
 1.92 18-Nov-2011  christos branches: 1.92.10;
- add sigtimedwait support.
- merge the siginfo population code.
 1.91 30-May-2011  alnsn branches: 1.91.4;
Regenerate files to pick up correct RCS Ids. Suggested by Chris Badura.
 1.90 30-May-2011  alnsn Add fadvise64 and fadvise64_64 syscalls to compat_linux and compat_linux32.
 1.89 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.88 07-Jul-2010  chs branches: 1.88.2;
regen
 1.87 23-Apr-2010  chs regen
 1.86 14-Dec-2009  matt branches: 1.86.2; 1.86.4;
Regen (new makesyscalls.sh)
 1.85 24-Nov-2009  njoly Regen for personality(2) update.
 1.84 08-Jun-2009  njoly Regen for rt_queueinfo(2) update.
 1.83 17-Jan-2009  njoly branches: 1.83.2;
Regen for wait4 update.
 1.82 13-Jan-2009  pooka Regen to prove I didn't screw up the conversion: purely RCSID changes.
 1.81 11-Jan-2009  christos merge christos-time_t
 1.80 19-Nov-2008  ad Regen.
 1.79 19-Nov-2008  njoly Regen for futex timeout argument cleanup/fix.
 1.78 12-Nov-2008  njoly Regen for nanosleep(2) fix.
 1.77 26-Oct-2008  christos branches: 1.77.2; 1.77.4;
regen
 1.76 26-Oct-2008  christos regen
 1.75 23-Apr-2008  ad branches: 1.75.2; 1.75.4; 1.75.8;
Regen.
 1.74 04-Apr-2008  njoly branches: 1.74.2;
Regen for linux_sys_msync removal.
 1.73 15-Jan-2008  njoly branches: 1.73.6; 1.73.8;
Regen.
 1.72 24-Dec-2007  njoly Regen for linux_sys_getpgid removal.
 1.71 21-Dec-2007  njoly Regen for getfsuid/setfsgid syscall exchange.
 1.70 20-Dec-2007  dsl regen
 1.69 16-Nov-2007  njoly branches: 1.69.2; 1.69.6;
Regen, for syscalls cleanup.
 1.68 13-Jun-2007  christos branches: 1.68.6; 1.68.8; 1.68.12; 1.68.14;
regen
 1.67 13-Jun-2007  christos regen.
 1.66 09-Feb-2007  ad branches: 1.66.6; 1.66.8;
Merge newlock2 to head.
 1.65 01-Sep-2006  matt branches: 1.65.2;
Regen.
 1.64 30-Aug-2006  matt Regen
 1.63 10-Jun-2006  christos regen
 1.62 11-Dec-2005  christos branches: 1.62.4; 1.62.8; 1.62.14;
merge ktrace-lwp.
 1.61 06-Nov-2005  manu regen
 1.60 06-Nov-2005  tron Regen with correct RCS Ids.
 1.59 05-Nov-2005  dogcow mirror manu's amd64 changes to implement linux sched_{seg,get}affinity;
the kernel and linux lkm now compile again.
 1.58 18-Oct-2005  joerg Regen.
 1.57 16-May-2005  fvdl branches: 1.57.2;
Regen.
 1.56 16-May-2005  fvdl Regen.
 1.55 26-Feb-2005  perry regen
 1.54 20-Sep-2004  jdolecek branches: 1.54.4; 1.54.6;
regen:
implement support for Linux statfs64() syscall - 64bit variant of statfs()
 1.53 08-Sep-2004  jdolecek regen: add exit_group(2)
 1.52 01-Aug-2004  jdolecek regen - sync syscall lists with Linux kernel 2.6.7
 1.51 01-Aug-2004  jdolecek regen:

connect madvise(2) and mincore(2) - apparently the newer Linux libs
don't stub it anymore, so allow the application to take advantage
of them

the Linux calls appear to be compatible in the flag values and semantics,
so a wrapper is not necessary
 1.50 01-Aug-2004  jdolecek connect madvise(2) and mincore(2) - apparently the newer Linux libs
don't stub it anymore, so allow the application to take advantage
of them

the Linux calls appear to be compatible in the flag values and semantics,
so a wrapper is not necessary
 1.49 10-Aug-2003  jdolecek regen - added wrapper for Linux ftruncate64()
 1.48 03-Jul-2003  christos Regen.
 1.47 23-Jun-2003  christos branches: 1.47.2;
Regen.
 1.46 18-Jan-2003  thorpej Regen for correct RCS IDs.
 1.45 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.44 10-Apr-2002  christos branches: 1.44.4;
regen
 1.43 22-Mar-2002  christos regen
 1.42 15-Feb-2002  christos regen
 1.41 15-Feb-2002  christos - add a real linux_sys___sysctl because the mib numbers are different.
implement only the kernel version getting entries.
- make the signal conversion functions consistent; dest is arg 1.
- make linux_fakedev deal with block and char devices differently.
- add linux_sys_ugetrlimit, and flesh out the regular get/setrlimit so
that they work properly.
- add linux_mmap2 [untested].
- bump kernel to 2.4.18, and make the date be valentine's day :-)
- linux_sys_*stat64 family was totally busted. Fix it.

tested only on i386.

Status:
gdb, telnet, work
jdk-1.4.0 extractor works, jdk still coredumps.

christos
 1.40 13-Nov-2001  lukem add RCSIDs (including regeneration of files as appropriate)
 1.39 30-Sep-2001  manu Fixes my last commit: only mips really need fcntl64 to work now. i386 and
powerpc could use it later if needed. m68k and alpha should never need it.
 1.38 30-May-2001  mrg branches: 1.38.2; 1.38.4;
use _KERNEL_OPT.
 1.37 13-May-2001  manu Improved the accuracy of gettimeofday/settimeofday: Linux stores a srtuct
timezone in the kernel. We now keep track of it for emulated processes.
Tested for powerpc and i386. Untested on m68k, but it should be ok
Alpha has a particular implementation (osf1_sys_gettimeofday), and it has
therefore not been touched.
 1.36 30-Mar-2001  jdolecek regen
 1.35 30-Mar-2001  jdolecek regen
 1.34 27-Jan-2001  thorpej branches: 1.34.2;
Regen; getpid(2) is MP-safe.
 1.33 27-Jan-2001  thorpej Regen; add sy_flags.
 1.32 29-Dec-2000  fvdl Regen.
 1.31 27-Dec-2000  fvdl Regen.
 1.30 18-Dec-2000  fvdl Regen.
 1.29 13-Dec-2000  augustss Regen.
 1.28 12-Dec-2000  jdolecek regen
 1.27 12-Dec-2000  jdolecek regen
 1.26 11-Dec-2000  mycroft Regen.
 1.25 09-Dec-2000  jdolecek regen
 1.24 09-Dec-2000  mycroft Regen.
 1.23 02-Dec-2000  jdolecek regen after addition of linux_sys_swapoff()
 1.22 01-Dec-2000  jdolecek regen
 1.21 01-Nov-2000  jdolecek regen
 1.20 23-Aug-2000  christos regen
 1.19 18-Aug-2000  cgd update for changed makesyscalls.master
 1.18 18-Aug-2000  cgd update for new makesyscalls.sh, and also for correct ids for changed
syscalls.master files. (you need to regenerate after checking in
syscalls.master to get the correct ids.)
 1.17 18-Mar-2000  erh branches: 1.17.4;
Regen.
 1.16 03-Feb-2000  abs regen
 1.15 12-Dec-1999  tron Regen.
 1.14 05-Dec-1999  tron Regen.
 1.13 04-Dec-1999  tron Regen.
 1.12 04-Oct-1999  tron branches: 1.12.2; 1.12.8;
Regen from "syscalls.master".
 1.11 16-Aug-1999  tron Regen.
 1.10 14-May-1999  thorpej Regen.
 1.9 13-May-1999  thorpej Regen.
 1.8 30-Mar-1999  abs branches: 1.8.2; 1.8.4;
Regenerate (with poll())
 1.7 27-Mar-1999  tron Regen.
 1.6 23-Mar-1999  thorpej Regen; pread(2) and pwrite(2).
 1.5 09-Feb-1999  christos Regen
 1.4 10-Dec-1998  christos Regen
 1.3 04-Oct-1998  fvdl Assign my copyright to TNF. Merge with others were appropriate.
Regen syscall files after script change.
 1.2 03-Oct-1998  christos Attempt to fix the mess.
 1.1 01-Oct-1998  erh Regen.
 1.8.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.8.2.2 15-Aug-2000  he Pull up regenerated files (requested by abs):
Enable basic versions of Linux fsuid calls.
 1.8.2.1 31-Jan-2000  he Pull up generated files (requested by abs):
Enable emulation of vfork(2).
 1.12.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.12.2.7 21-Apr-2001  bouyer Sync with HEAD
 1.12.2.6 11-Feb-2001  bouyer Sync with HEAD.
 1.12.2.5 05-Jan-2001  bouyer Sync with HEAD
 1.12.2.4 13-Dec-2000  bouyer Sync with HEAD (for UBC fixes).
 1.12.2.3 08-Dec-2000  bouyer Sync with HEAD.
 1.12.2.2 22-Nov-2000  bouyer Sync with HEAD.
 1.12.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.17.4.2 01-May-2001  he Pull up regenerated files (requested by jdolecek):
Make it possible to use a different function for unimplemented
syscalls than sys_nosys(), so that the Linux emulation can avoid
posting SIGSYS and instead just return ENOSYS.
 1.17.4.1 30-Mar-2001  he Pull up regenerated files (requested by fvdl):
Add some required Linux emulation bits to support the Linux
version of VMware.
 1.34.2.9 29-May-2002  nathanw Regen.
 1.34.2.8 17-Apr-2002  nathanw Catch up to -current.
 1.34.2.7 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.34.2.6 28-Feb-2002  nathanw Catch up to -current.
 1.34.2.5 14-Nov-2001  nathanw Catch up to -current.
 1.34.2.4 08-Oct-2001  nathanw Catch up to -current.
 1.34.2.3 21-Jun-2001  nathanw Catch up to -current.
 1.34.2.2 09-Apr-2001  nathanw Catch up with -current.
 1.34.2.1 05-Mar-2001  nathanw Initial commit of scheduler activations and lightweight process support.
 1.38.4.1 01-Oct-2001  fvdl Catch up with -current.
 1.38.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.38.2.2 16-Mar-2002  jdolecek Catch up with -current.
 1.38.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.44.4.3 14-Jun-2004  jmc Regen for changes in ticket #1708
 1.44.4.2 11-May-2004  tron Regen for ticket 1686.
 1.44.4.1 22-Oct-2003  jmc Regen files (requested by tv in ticket #1427)

Proper support for mmap2
 1.47.2.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.47.2.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.47.2.4 24-Sep-2004  skrll Sync with HEAD.
 1.47.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.47.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.47.2.1 03-Aug-2004  skrll Sync with HEAD
 1.54.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.54.4.1 29-Apr-2005  kent sync with -current
 1.57.2.6 21-Jan-2008  yamt sync with head
 1.57.2.5 07-Dec-2007  yamt sync with head
 1.57.2.4 03-Sep-2007  yamt sync with head.
 1.57.2.3 26-Feb-2007  yamt sync with head.
 1.57.2.2 30-Dec-2006  yamt sync with head.
 1.57.2.1 21-Jun-2006  yamt sync with head.
 1.62.14.1 19-Jun-2006  chap Sync with head.
 1.62.8.2 03-Sep-2006  yamt sync with head.
 1.62.8.1 26-Jun-2006  yamt sync with head.
 1.62.4.1 09-Sep-2006  rpaulo sync with head
 1.65.2.1 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.66.8.1 11-Jul-2007  mjf Sync with head.
 1.66.6.1 15-Jul-2007  ad Sync with head.
 1.68.14.3 18-Feb-2008  mjf Sync with HEAD.
 1.68.14.2 27-Dec-2007  mjf Sync with HEAD.
 1.68.14.1 19-Nov-2007  mjf Sync with HEAD.
 1.68.12.1 18-Nov-2007  bouyer Sync with HEAD
 1.68.8.2 23-Mar-2008  matt sync with HEAD
 1.68.8.1 09-Jan-2008  matt sync with HEAD
 1.68.6.1 21-Nov-2007  joerg Sync with HEAD.
 1.69.6.2 19-Jan-2008  bouyer Sync with HEAD
 1.69.6.1 02-Jan-2008  bouyer Sync with HEAD
 1.69.2.1 26-Dec-2007  ad Sync with head.
 1.73.8.3 20-Nov-2008  christos merge with head.
 1.73.8.2 01-Nov-2008  christos Sync with head.
 1.73.8.1 29-Mar-2008  christos Welcome to the time_t=long long dev_t=uint64_t branch.
 1.73.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.73.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.74.2.1 18-May-2008  yamt sync with head.
 1.75.8.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.75.4.2 14-May-2008  wrstuden Per discussion with ad, remove most of the #include <sys/sa.h> lines
as they were including sa.h just for the type(s) needed for syscallargs.h.

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

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

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

I think this reduction is very good thing.
 1.75.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.75.2.4 11-Aug-2010  yamt sync with head.
 1.75.2.3 11-Mar-2010  yamt sync with head
 1.75.2.2 20-Jun-2009  yamt sync with head
 1.75.2.1 04-May-2009  yamt sync with head.
 1.77.4.1 20-Nov-2008  snj Regen for ticket 81.
 1.77.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.83.2.1 23-Jul-2009  jym Sync with HEAD.
 1.86.4.4 31-May-2011  rmind sync with head
 1.86.4.3 21-Apr-2011  rmind sync with head
 1.86.4.2 05-Mar-2011  rmind sync with head
 1.86.4.1 30-May-2010  rmind sync with head
 1.86.2.2 17-Aug-2010  uebayasi Sync with HEAD.
 1.86.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.88.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.91.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.91.4.2 30-Oct-2012  yamt sync with head
 1.91.4.1 17-Apr-2012  yamt sync with head
 1.92.10.4 03-Dec-2017  jdolecek update from HEAD
 1.92.10.3 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.92.10.2 23-Jun-2013  tls resync from head
 1.92.10.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.94.4.1 18-May-2014  rmind sync with head
 1.97.2.1 10-Aug-2014  tls Rebase.
 1.103.2.1 17-Apr-2017  snj regen for ticket 1354
 1.104.2.3 05-Feb-2017  skrll Sync with HEAD
 1.104.2.2 05-Oct-2016  skrll Sync with HEAD
 1.104.2.1 06-Apr-2015  skrll Sync with HEAD
 1.107.2.3 20-Mar-2017  pgoyette Sync with HEAD
 1.107.2.2 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.107.2.1 26-Jul-2016  pgoyette Sync with HEAD
 1.111.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.112.4.1 11-May-2017  pgoyette Sync with HEAD
 1.113.10.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.113.10.1 10-Jun-2019  christos Sync with HEAD
 1.113.8.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.116.2.2 17-Dec-2020  thorpej Regen for preadv(2) and pwritev(2).
 1.116.2.1 15-Dec-2020  thorpej Regen for eventfd, timerfd, POSIX timers.
 1.127.2.1 02-Aug-2025  perseant Sync with HEAD
 1.24 28-Sep-2024  christos regen
 1.23 01-Jul-2024  christos regen
 1.22 29-Jun-2024  christos branches: 1.22.2;
regen
 1.21 19-Aug-2023  christos regen
 1.20 18-Aug-2023  christos regen
 1.19 29-Jul-2023  christos regen
 1.18 28-Jul-2023  christos regen
 1.17 10-Jul-2023  christos regen
 1.16 02-Dec-2021  ryo regen
 1.15 20-Sep-2021  thorpej Regen for preadv(2) / pwritev(2).
 1.14 20-Sep-2021  thorpej Regen for eventfd.
 1.13 19-Sep-2021  thorpej Regen for timerfd.
 1.12 19-Sep-2021  thorpej Regen for POSIX timer syscalls.
 1.11 26-Apr-2020  thorpej branches: 1.11.2;
Regen for native futex calls.
 1.10 09-Nov-2019  jdolecek regen
 1.9 10-Aug-2018  pgoyette Regen
 1.8 10-May-2017  riastradh branches: 1.8.8; 1.8.10; 1.8.12;
regen
 1.7 16-Jan-2017  christos branches: 1.7.4;
regen all
 1.6 13-Jan-2017  christos branches: 1.6.2;
regen
 1.5 02-Jan-2017  martin Regen (something apparently went wrong in previous)
 1.4 24-Jul-2016  njoly Regen for readlink/readlinkat signatures.
 1.3 24-Sep-2015  christos branches: 1.3.2;
regen
 1.2 23-Mar-2015  ozaki-r branches: 1.2.2;
Regen
 1.1 07-Mar-2015  christos regen
 1.2.2.4 05-Feb-2017  skrll Sync with HEAD
 1.2.2.3 05-Oct-2016  skrll Sync with HEAD
 1.2.2.2 06-Apr-2015  skrll Sync with HEAD
 1.2.2.1 23-Mar-2015  skrll file linux_systrace_args.c was added on branch nick-nhusb on 2015-04-06 15:18:06 +0000
 1.3.2.3 20-Mar-2017  pgoyette Sync with HEAD
 1.3.2.2 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.3.2.1 26-Jul-2016  pgoyette Sync with HEAD
 1.6.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.7.4.1 11-May-2017  pgoyette Sync with HEAD
 1.8.12.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.8.12.1 10-Jun-2019  christos Sync with HEAD
 1.8.10.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.8.8.2 03-Dec-2017  jdolecek update from HEAD
 1.8.8.1 10-May-2017  jdolecek file linux_systrace_args.c was added on branch tls-maxphys on 2017-12-03 11:36:54 +0000
 1.11.2.2 17-Dec-2020  thorpej Regen for preadv(2) and pwritev(2).
 1.11.2.1 15-Dec-2020  thorpej Regen for eventfd, timerfd, POSIX timers.
 1.22.2.1 02-Aug-2025  perseant Sync with HEAD
 1.10 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.9 26-Mar-2007  njoly branches: 1.9.30; 1.9.32; 1.9.34;
Update i386 LINUX_{TIOCGPTN,TIOCSPTLCK} definitions for latest
linux_ioctl_termios() changes.
 1.8 22-Sep-2006  christos branches: 1.8.4; 1.8.8; 1.8.10; 1.8.12;
Pretend to implement TIOCSPTLCK. Although failing is harmless, there is no
point in doing so.
 1.7 11-Dec-2005  christos branches: 1.7.20; 1.7.22;
merge ktrace-lwp.
 1.6 13-Nov-2004  christos branches: 1.6.12;
add LINUX_TIOCGPTN
 1.5 26-Aug-2001  manu branches: 1.5.20;
Moved LINUX_NCCS from MI file to MD file, because the value is different
on MIPS and sparc machines.
 1.4 20-Jan-2001  manu branches: 1.4.2; 1.4.4;
Moved architecure dependent part of struct linux_termio to architecture
dependent header files.
 1.3 01-Oct-1998  erh branches: 1.3.12;
Split compat/linux/linux_termios.h into i386 and common parts.
 1.2 05-Jan-1998  perry RCSID Police.
 1.1 08-Mar-1996  mycroft Separate ioctl emulation by group. Add (minimal) audio emulation.
 1.3.12.1 11-Feb-2001  bouyer Sync with HEAD.
 1.4.4.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.4.2.1 21-Sep-2001  nathanw Catch up to -current.
 1.5.20.1 14-Nov-2004  skrll Sync with HEAD.
 1.6.12.2 03-Sep-2007  yamt sync with head.
 1.6.12.1 30-Dec-2006  yamt sync with head.
 1.7.22.1 22-Oct-2006  yamt sync with head
 1.7.20.1 18-Nov-2006  ad Sync with head.
 1.8.12.1 29-Mar-2007  reinoud Pullup to -current
 1.8.10.1 11-Jul-2007  mjf Sync with head.
 1.8.8.1 10-Apr-2007  ad Sync with head.
 1.8.4.1 15-Apr-2007  yamt sync with head.
 1.9.34.1 16-May-2008  yamt sync with head.
 1.9.32.1 18-May-2008  yamt sync with head.
 1.9.30.1 02-Jun-2008  mjf Sync with HEAD.
 1.17 11-Jan-2009  christos merge christos-time_t
 1.16 28-Apr-2008  martin branches: 1.16.8;
Remove clause 3 and 4 from TNF licenses
 1.15 11-Dec-2005  christos branches: 1.15.70; 1.15.72; 1.15.74; 1.15.76;
merge ktrace-lwp.
 1.14 10-Mar-2005  christos revert part of previous commit (the block size type and the pad renumbering).
tron says it breaks compat mode.
 1.13 10-Mar-2005  christos Add nanosecond handling on the stat and stat64 code for the i386.
 1.12 20-Sep-2004  jdolecek branches: 1.12.4; 1.12.6;
move definition of linux_fsid_t to common/linux_types.h - it's identical
across all Linux archs
 1.11 19-Sep-2004  jdolecek move definition of struct linux_stafs to common/linux_types.h, and use
explicit size types - the structure definition is actually identical
on currently support COMPAT_LINUX archs, so no point to have 6 copies of it
in the tree
 1.10 19-May-2002  jdolecek branches: 1.10.8;
On archs with broken linux struct stat64 st_ino, rename linux_stat64's
lst_ino to __lst_ino and lst_ino64 to lst_ino, and define
LINUX_STAT64_HAS_BROKEN_ST_INO. Only assign __lst_ino if this define
is present.

This fixes compile on powerpc archs, and hence port-powerpc/16893.
 1.9 15-Feb-2002  christos branches: 1.9.8;
- add a real linux_sys___sysctl because the mib numbers are different.
implement only the kernel version getting entries.
- make the signal conversion functions consistent; dest is arg 1.
- make linux_fakedev deal with block and char devices differently.
- add linux_sys_ugetrlimit, and flesh out the regular get/setrlimit so
that they work properly.
- add linux_mmap2 [untested].
- bump kernel to 2.4.18, and make the date be valentine's day :-)
- linux_sys_*stat64 family was totally busted. Fix it.

tested only on i386.

Status:
gdb, telnet, work
jdk-1.4.0 extractor works, jdk still coredumps.

christos
 1.8 12-Dec-2000  jdolecek branches: 1.8.2; 1.8.4;
define struct linux_stat64 used by linux_sys_*stat64()
 1.7 04-Oct-1998  fvdl branches: 1.7.12;
Assign my copyright to TNF. Merge with others were appropriate.
Regen syscall files after script change.
 1.6 01-Oct-1998  erh Split linux_types.h into i386, common and multi-architechture parts.
 1.5 20-May-1996  fvdl Update list of Linux syscalls and implement the ones that are likely to be
used and doable.
 1.4 21-Aug-1995  mycroft Implement the old and older uname(2) calls.
 1.3 14-Aug-1995  mycroft Move signal types into signal.h.
 1.2 05-Mar-1995  fvdl Added a few more system calls.
More consistent alternate root file semantics throughout.
 1.1 28-Feb-1995  fvdl Added Linux compat code.
 1.7.12.1 13-Dec-2000  bouyer Sync with HEAD (for UBC fixes).
 1.8.4.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.8.4.1 16-Mar-2002  jdolecek Catch up with -current.
 1.8.2.2 20-Jun-2002  nathanw Catch up to -current.
 1.8.2.1 28-Feb-2002  nathanw Catch up to -current.
 1.9.8.1 30-May-2002  gehenna Catch up with -current.
 1.10.8.2 01-Apr-2005  skrll Sync with HEAD.
 1.10.8.1 24-Sep-2004  skrll Sync with HEAD.
 1.12.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.12.4.1 29-Apr-2005  kent sync with -current
 1.15.76.2 04-May-2009  yamt sync with head.
 1.15.76.1 16-May-2008  yamt sync with head.
 1.15.74.1 18-May-2008  yamt sync with head.
 1.15.72.3 30-Dec-2008  christos it is suseconds_t we want.
 1.15.72.2 01-Nov-2008  christos Sync with head.
 1.15.72.1 29-Mar-2008  christos Welcome to the time_t=long long dev_t=uint64_t branch.
 1.15.70.2 17-Jan-2009  mjf Sync with HEAD.
 1.15.70.1 02-Jun-2008  mjf Sync with HEAD.
 1.16.8.1 19-Jan-2009  skrll Sync with HEAD.
 1.7 07-Mar-2015  christos Add systrace output file
 1.6 11-Dec-2005  christos branches: 1.6.120; 1.6.140;
merge ktrace-lwp.
 1.5 01-Aug-2004  jdolecek sync the syscall lists with Linux kernel 2.6.7
 1.4 30-Mar-2001  jdolecek branches: 1.4.22;
Implement linux_sys_nosys() and use it instead of sys_nosys() for
unimplemented syscalls. Difference is that linux_sys_nosys() doesn't
post SIGSYS to the process. Linux doesn't do that and thus glibc (and
probably other Linux code) doesn't deal with SIGSYS, even through it
generally contains fallback code for ENOSYS case.

This also addresses port-i386/12503, though the issue was already discussed
earlier.
 1.3 11-Dec-2000  mycroft branches: 1.3.2;
Round up sysent table size.
 1.2 01-Oct-1998  erh branches: 1.2.12; 1.2.22;
Moved from compat/linux.
 1.1 28-Feb-1995  fvdl Added Linux compat code.
 1.2.22.1 01-May-2001  he Pull up revision 1.4 (via patch, requested by jdolecek):
Make it possible to use a different function for unimplemented
syscalls than sys_nosys(), so that the Linux emulation can avoid
posting SIGSYS and instead just return ENOSYS.
 1.2.12.2 21-Apr-2001  bouyer Sync with HEAD
 1.2.12.1 13-Dec-2000  bouyer Sync with HEAD (for UBC fixes).
 1.3.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.4.22.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.22.2 18-Sep-2004  skrll Sync with HEAD.
 1.4.22.1 03-Aug-2004  skrll Sync with HEAD
 1.6.140.1 06-Apr-2015  skrll Sync with HEAD
 1.6.120.1 03-Dec-2017  jdolecek update from HEAD
 1.137 28-Sep-2024  christos Linux GSoC-2024: renameat2, clone3, sync_file_range, syncfs (Shivraj Jamgade)
 1.136 01-Jul-2024  christos Add linux POSIX message queue support (Ricardo Branco)
 1.135 29-Jun-2024  christos branches: 1.135.2;
From gsoc 2024: Implement faccessat2 and getcpu (Shivraz)
 1.134 19-Aug-2023  christos Add inotify* syscalls GSoC 2023 (Theodore Preduta)
 1.133 18-Aug-2023  christos Add linux waitid(2) from GSoC 2023 (Theodore Preduta)
 1.132 29-Jul-2023  christos Add/fix statx, readahead, close_range. From GSoC 2023 by Theodore Preduta
 1.131 28-Jul-2023  christos add epoll syscalls
 1.130 10-Jul-2023  christos Add new syscalls
 1.129 02-Dec-2021  ryo add prlimit64(2) syscall to COMPAT_LINUX and COMPAT_LINUX32
 1.128 20-Sep-2021  thorpej Add preadv(2) and pwritev(2) system calls to COMPAT_LINUX and COMPAT_LINUX32.
 1.127 20-Sep-2021  thorpej Add the eventfd system calls to COMPAT_LINUX and COMPAT_LINUX32.
 1.126 19-Sep-2021  thorpej Add the timerfd syscalls to COMPAT_LINUX and COMPAT_LINUX32.
 1.125 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.124 26-Apr-2020  thorpej branches: 1.124.2;
Add a NetBSD native futex implementation, mostly written by riastradh@.
Map the COMPAT_LINUX futex calls to the native ones.
 1.123 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.122 02-Jan-2017  manu branches: 1.122.16;
Add pselect6 Linux system call.
This lets Matlab R2016A run on NetBSD/amd64
 1.121 24-Jul-2016  njoly Small cleanup. Adjust readlink/readlinkat signatures to reduce diffs with
native.
 1.120 23-Mar-2015  ozaki-r branches: 1.120.2;
Fix inconsistent argument names
 1.119 22-Nov-2014  njoly branches: 1.119.2;
Fix ppoll signature (int ->u_int)
 1.118 31-May-2014  njoly branches: 1.118.2;
Fix munmap(2) signature.
 1.117 29-May-2014  njoly For utimes(2), use compat_50_sys_utimes() instead of local version.
 1.116 20-May-2014  njoly Fix getgroups/setgroups signature.
 1.115 17-May-2014  njoly Fix fadvise64 syscalls to use 64bit offset types.
 1.114 04-May-2014  njoly Fix pread/pwrite syscalls which need a 64bit offset argument.
 1.113 08-Apr-2014  njoly Adjust read/write/readv/writev signature to match native versions.
 1.112 18-Nov-2013  chs branches: 1.112.2;
implement the *at() syscalls.
bring the unimplemented syscall list up to date.
 1.111 07-Nov-2013  njoly Fix dup/dup2/dup3 argument types (u_int -> int).
 1.110 24-Sep-2013  njoly Add utimensat(2) for compat linux.
 1.109 08-Apr-2013  pooka branches: 1.109.4;
support utimes on non-alpha linux platforms
 1.108 19-Sep-2012  pooka emulate ppoll which is essentially our pollts
 1.107 18-Nov-2011  christos branches: 1.107.10;
add sigtimedwait
 1.106 09-Jul-2011  christos branches: 1.106.2;
the first argument of {g,s}etitimer() is int not u_int.
 1.105 30-May-2011  alnsn Add fadvise64 and fadvise64_64 syscalls to compat_linux and compat_linux32.
 1.104 10-Apr-2011  christos add pipe2 and dup3
 1.103 07-Jul-2010  chs branches: 1.103.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.102 23-Apr-2010  chs add missing argument to clone(). the symptom of this was that pthread_join()
would sometimes get stuck, such as in our "mutex2" regression test.
 1.101 24-Nov-2009  njoly branches: 1.101.2; 1.101.4;
Update personality(2) to match Linux definition where the argument is an
unsigned long.
 1.100 08-Jun-2009  njoly Update rt_queueinfo(2) definition, and kill a corresponding comment.
 1.99 17-Jan-2009  njoly branches: 1.99.2;
Convert linux/linux32 wait(4) to use a compat50 rusage structure.
 1.98 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.97 11-Jan-2009  christos merge christos-time_t
 1.96 19-Nov-2008  ad Make the emulations, exec formats, coredump, NFS, and the NFS server
into modules. By and large this commit:

- shuffles header files and ifdefs
- splits code out where necessary to be modular
- adds module glue for each of the components
- adds/replaces hooks for things that can be installed at runtime
 1.95 19-Nov-2008  njoly 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.94 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.93 26-Oct-2008  christos branches: 1.93.2; 1.93.4;
futex support fixes from FreeBSD via cube+pengo.
 1.92 25-Oct-2008  christos Add preliminary tls support for i386. Does not work yet. From FreeBSD.
 1.91 23-Apr-2008  ad branches: 1.91.2; 1.91.4; 1.91.8;
-SYCALL_MPSAFE
 1.90 04-Apr-2008  njoly branches: 1.90.2;
Cleanup. Kill linux_sys_msync and use sys___msync13 instead.
No functional changes expected.
 1.89 15-Jan-2008  njoly branches: 1.89.6; 1.89.8;
compat linux (and linux32) uid16 functions cleanup and fixes.

- Move uid16 functions to their own file linux_uid16.c, included by
needed archs (arm, i386 and m68k).
- Add new MI types linux_{u,g}id16_t.
- Add macros to handle linux_uid16_t and uid_t conversions.
- Add linux_sys_getres{uid,gid}16 syscalls, to fix an overflow with
bad sizes given to copyout when linux_sys_getres{uid,gid} are used.
- Update arm syscall table to use more uid16 functions.
 1.88 24-Dec-2007  njoly Kill unneeded linux_sys_getpgid and use native sys_getpgid instead.
 1.87 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.86 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.85 16-Nov-2007  njoly branches: 1.85.2; 1.85.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.84 13-Jun-2007  christos branches: 1.84.6; 1.84.8; 1.84.12; 1.84.14;
Get ready for NPTL but don't turn it on as of yet.
 1.83 13-Jun-2007  christos Add futex.
 1.82 04-Mar-2007  christos branches: 1.82.2; 1.82.4;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.81 09-Feb-2007  ad branches: 1.81.2;
Merge newlock2 to head.
 1.80 01-Sep-2006  matt branches: 1.80.2;
Don't conditionalize *sys_ptrace. The lack of sys_ptrace will be dealt
with differently.
 1.79 30-Aug-2006  matt Update to deal with options PTRACE
 1.78 10-Jun-2006  christos linux getpriority is off-by-20 so use our own function.
From PR/33671: Nicolas Joly
 1.77 11-Dec-2005  christos branches: 1.77.4; 1.77.8; 1.77.14;
merge ktrace-lwp.
 1.76 06-Nov-2005  manu Back out sched_{set|get}affinity addition because it breaks the
build again on i386 now it is fixed for other archs (Tom's fix and
mine got in colision)
 1.75 05-Nov-2005  dogcow mirror manu's amd64 changes to implement linux sched_{seg,get}affinity;
the kernel and linux lkm now compile again.
 1.74 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.73 16-May-2005  fvdl branches: 1.73.2;
Add clock_* POSIX functions.
 1.72 16-May-2005  fvdl Add *xattr functions (they all return EOPNOTSUPP).
 1.71 20-Sep-2004  jdolecek implement support for Linux statfs64() syscall - 64bit variant of statfs()
 1.70 08-Sep-2004  jdolecek implement basic exit_group(2), which just terminates calling thread;
apparently not many apps use thread groups yet, at least not with default
SuSE 9.1 libraries, so this is enough for now
 1.69 01-Aug-2004  jdolecek sync the syscall lists with Linux kernel 2.6.7
 1.68 01-Aug-2004  jdolecek connect madvise(2) and mincore(2) - apparently the newer Linux libs
don't stub it anymore, so allow the application to take advantage
of them

the Linux calls appear to be compatible in the flag values and semantics,
so a wrapper is not necessary
 1.67 10-Aug-2003  jdolecek add Linux compat arg wrapper for ftruncate64(), and change linux compat
truncate64() wrapper to translate args structure
NetBSD truncate() and ftrucate() have hidden 'pad' argument, so we have
to do the argument translation

Problem found and patch supplied in PR kern/22360 by Ales Krenek

This is the last of syscalls with hidden 'pad' arg we didn't have
wrapper for; all the others (lseek, mmap, pwrite, pread) already had
wrapper before.
 1.66 03-Jul-2003  christos Implement linux_rt_sigreturn for real. Add a hack for more plausible siginfo.
The java segv handler still segv's again inside the signal handler, but our
sample test program now works [gets the proper ucontext].
 1.65 23-Jun-2003  christos branches: 1.65.2;
PR/21937: Todd Vierling: Proper support for mmap2
 1.64 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.63 10-Apr-2002  christos branches: 1.63.4;
add getdents64
 1.62 22-Mar-2002  christos 1. make sure lines don't wrap
2. fix mmap and call it mmap like other ports do, not mmap2
3. implement fcntl64
4. implement mprotect because linux treats args slightly differently.
 1.61 15-Feb-2002  christos - add a real linux_sys___sysctl because the mib numbers are different.
implement only the kernel version getting entries.
- make the signal conversion functions consistent; dest is arg 1.
- make linux_fakedev deal with block and char devices differently.
- add linux_sys_ugetrlimit, and flesh out the regular get/setrlimit so
that they work properly.
- add linux_mmap2 [untested].
- bump kernel to 2.4.18, and make the date be valentine's day :-)
- linux_sys_*stat64 family was totally busted. Fix it.

tested only on i386.

Status:
gdb, telnet, work
jdk-1.4.0 extractor works, jdk still coredumps.

christos
 1.60 30-Sep-2001  manu Fixes my last commit: only mips really need fcntl64 to work now. i386 and
powerpc could use it later if needed. m68k and alpha should never need it.
 1.59 30-Sep-2001  martin Make i386 kernels compile again.
fcntl64 was still marked UNIMPL, but the implementation existed, causing
a missing prototype warning.
XXX I have no clue if this is the correct fix - someone able to test this
please review it!
 1.58 30-May-2001  mrg branches: 1.58.2; 1.58.4;
use _KERNEL_OPT.
 1.57 13-May-2001  manu Improved the accuracy of gettimeofday/settimeofday: Linux stores a srtuct
timezone in the kernel. We now keep track of it for emulated processes.
Tested for powerpc and i386. Untested on m68k, but it should be ok
Alpha has a particular implementation (osf1_sys_gettimeofday), and it has
therefore not been touched.
 1.56 30-Mar-2001  jdolecek Add new syscalls from Linux 2.4.3 to the lists. Not implemented ATM.
 1.55 30-Mar-2001  jdolecek Implement linux_sys_nosys() and use it instead of sys_nosys() for
unimplemented syscalls. Difference is that linux_sys_nosys() doesn't
post SIGSYS to the process. Linux doesn't do that and thus glibc (and
probably other Linux code) doesn't deal with SIGSYS, even through it
generally contains fallback code for ENOSYS case.

This also addresses port-i386/12503, though the issue was already discussed
earlier.
 1.54 27-Jan-2001  thorpej branches: 1.54.2;
getpid(2) is MP-safe.
 1.53 29-Dec-2000  fvdl Don't pass through link(2) directly, as we need to do altpath checks.
 1.52 27-Dec-2000  fvdl Add all uid and gid calls, and do the right thing for the older 16 bit
ones.
 1.51 18-Dec-2000  fvdl Update for 32 bit Linux uid/gid calls.
 1.50 13-Dec-2000  augustss Add sysinfo.
 1.49 12-Dec-2000  jdolecek actually, we need to wrap sys_truncate() call so that the /emul/linux/...
path is tried first
fix ftruncate64 entry - first arg to ftruncate is int fd, not path
 1.48 12-Dec-2000  jdolecek add emulation of Linux truncate64(2), ftruncate64(2), *stat64(2)
 1.47 09-Dec-2000  jdolecek add more unimplemented syscalls to list
 1.46 09-Dec-2000  mycroft Add the %% separators.
 1.45 02-Dec-2000  jdolecek add emulation of linux swapoff(2)
 1.44 01-Dec-2000  jdolecek replace compat_09_sys_setdomainname() with linux_sys_setdomainname(),
compat_12_sys_swapon() with linux_sys_swapon() - this is to drop dependency
on COMPAT_12/COMPAT_09
 1.43 01-Nov-2000  jdolecek support mlockall(), munlockall() - they are same as respective NetBSD syscalls
 1.42 23-Aug-2000  christos add support for syscall 186 [sigaltstack]
 1.41 18-Mar-2000  erh branches: 1.41.4;
Use linux_sys_reboot instead of sys_reboot.
 1.40 03-Feb-2000  abs Add Linux fsuid system calls - from Witold J. Wnuk in PR kern/9335
 1.39 12-Dec-1999  tron Incomplete but already working emulation of Linux's ptrace(2) for i386.
 1.38 05-Dec-1999  tron Add proper stub code to make emulation of Linux's pread(2) and pwrite(2)
work. Fixes PR kern/8945 by Dave Sainty.
 1.37 04-Dec-1999  tron Consistently call signal number arguments "signum".
 1.36 04-Oct-1999  tron branches: 1.36.2; 1.36.8;
Add emulation for scheduler related syscalls. Although they are dummies
even under Linux the posix thread library for "glibc2" requires them.
 1.35 16-Aug-1999  tron Add stime() to syscalls table.
 1.34 14-May-1999  thorpej Emulate the Linux vfork(2) (which is like NetBSD's __vfork14(2)),
{get,set}resuid(2), and {get,set}resgid(2). Note a few more system
calls that we don't yet emulate.
 1.33 13-May-1999  thorpej Emulate the Linux clone(2) system call.
 1.32 30-Mar-1999  abs branches: 1.32.2; 1.32.4;
Since NetBSD has poll(), use it.
Linux oracle install now gets far enough that I want our DBA around to
see if we can finish the job.
 1.31 27-Mar-1999  tron Add emulation for Linux "getcwd" syscall.
 1.30 23-Mar-1999  thorpej Add support for emulating the Linux pread(2) and pwrite(2) system calls;
just call the native NetBSD versions.

PR #7202, Jaromir Dolecek <dolecek@ics.muni.cz>.
 1.29 09-Feb-1999  christos const poisoning
 1.28 10-Dec-1998  christos defopt COMPAT_43
 1.27 03-Oct-1998  christos Attempt to fix the mess.
 1.26 01-Oct-1998  erh Move compat/linux/syscalls.master to i386. Add a few syscalls while I'm here.
 1.25 11-Sep-1998  mycroft Substantial signal handling changes:
* Increase the size of sigset_t to accomodate 128 signals -- adding new
versions of sys_setprocmask(), sys_sigaction(), sys_sigpending() and
sys_sigsuspend() to handle the changed arguments.
* Abstract the guts of sys_sigaltstack(), sys_setprocmask(), sys_sigaction(),
sys_sigpending() and sys_sigsuspend() into separate functions, and call them
from all the emulations rather than hard-coding everything. (Avoids uses
the stackgap crap for these system calls.)
* Add a new flag (p_checksig) to indicate that a process may have signals
pending and userret() needs to do the full (slow) check.
* Eliminate SAS_ALTSTACK; it's exactly the inverse of SS_DISABLE.
* Correct emulation bugs with restoring SS_ONSTACK.
* Make the signal mask in the sigcontext always use the emulated mask format.
* Store signals internally in sigaction structures, rather than maintaining a
bunch of little sigsets for each SA_* bit.
* Keep track of where we put the signal trampoline, rather than figuring it out
in *_sendsig().
* Issue a warning when a non-emulated sigaction bit is observed.
* Add missing emulated signals, and a native SIGPWR (currently not used).
* Implement the `not reset when caught' semantics for relevant signals.

Note: Only code touched by the i386 port has been modified. Other ports and
emulations need to be updated.
 1.24 05-Aug-1998  perry enable nanosleep in linux emul, per pr-5906 from Soren S. Jorvang
 1.23 20-Feb-1998  mycroft Linux's getsid(2) does in fact return a pid, not a pointer.
 1.22 19-Feb-1998  thorpej Change a comment to reflect new makesyscalls.sh behavior.
 1.21 16-Oct-1997  christos ostat -> stat43
 1.20 15-Oct-1997  mycroft Fix a typo inherited from kern/syscalls.master.
 1.19 10-Oct-1997  mycroft Emulate mremap(2) by returning ENOMEM for now. This should be sufficient for
realloc(3) and other uses. From Matthias Scheler in PR 3920.
 1.18 13-Jun-1997  thorpej branches: 1.18.4;
Use compat_12_sys_swapon().
 1.17 07-Apr-1997  augustss Add Linux nice() syscall.
 1.16 20-May-1996  fvdl branches: 1.16.6;
Update list of Linux syscalls and implement the ones that are likely to be
used and doable.
 1.15 18-Dec-1995  fvdl msync, readv and writev were recently added to the Linux kernel; add them
to the emulation as well.
 1.14 09-Dec-1995  mycroft We don't need a private version of fork() here any more.
 1.13 07-Oct-1995  mycroft Prefix names of system call implementation functions with `sys_'.
 1.12 07-Sep-1995  fvdl Fix some bugs & typing problems.
 1.11 27-Aug-1995  fvdl Add a hook for MD ioctl calls, plus a couple of more changes to make
svgalib binaries work on the i386
 1.10 23-Aug-1995  fvdl Emulate some syscalls that appear in Linux 1.3: a select() with normal args,
getdents() and flock().
 1.9 21-Aug-1995  mycroft Implement the old and older uname(2) calls.
 1.8 14-Aug-1995  mycroft Rearrange #includes.
 1.7 24-Jul-1995  fvdl mkdir() has 2 arguments.. fixes PR 1248 (from Brad Spencer)
 1.6 11-Jun-1995  fvdl * Make Linux ELF binaries work. Lots of code duplication, but it will have to do
for now.
* Add a sanity check in linux_uselib
 1.5 06-May-1995  mycroft Add linux_modify_ldt(), if __i386__.
 1.4 07-Apr-1995  fvdl Handle Linux signal tramp code differently. Some changes because of the
now seperate Linux signal trampoline code. Add linux_sigreturn to
syscalls.master.
 1.3 10-Mar-1995  fvdl Add the Linux pause() system call. Fix the arguments to sigsuspend().
 1.2 05-Mar-1995  fvdl Added a few more system calls.
More consistent alternate root file semantics throughout.
 1.1 28-Feb-1995  fvdl Added Linux compat code.
 1.16.6.1 12-Feb-1997  mrg initial work for dynamic swap additions.
 1.18.4.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.32.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.32.2.2 15-Aug-2000  he Pull up revision 1.40 (requested by abs):
Enable basic versions of Linux fsuid calls.
 1.32.2.1 31-Jan-2000  he Apply patch (requested by abs):
Enable emulation of vfork(2).
 1.36.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.36.2.7 21-Apr-2001  bouyer Sync with HEAD
 1.36.2.6 11-Feb-2001  bouyer Sync with HEAD.
 1.36.2.5 05-Jan-2001  bouyer Sync with HEAD
 1.36.2.4 13-Dec-2000  bouyer Sync with HEAD (for UBC fixes).
 1.36.2.3 08-Dec-2000  bouyer Sync with HEAD.
 1.36.2.2 22-Nov-2000  bouyer Sync with HEAD.
 1.36.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.41.4.2 01-May-2001  he Pull up revision 1.55 (requested by jdolecek):
Make it possible to use a different function for unimplemented
syscalls than sys_nosys(), so that the Linux emulation can avoid
posting SIGSYS and instead just return ENOSYS.
 1.41.4.1 30-Mar-2001  he Pull up revision 1.53 (requested by fvdl):
Add some required Linux emulation bits to support the Linux
version of VMware.
 1.54.2.7 29-May-2002  nathanw #include <sys/sa.h> before <sys/syscallargs.h>, to provide sa_upcall_t
now that <sys/param.h> doesn't include <sys/sa.h>.

(Behold the Power of Ed)
 1.54.2.6 17-Apr-2002  nathanw Catch up to -current.
 1.54.2.5 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.54.2.4 28-Feb-2002  nathanw Catch up to -current.
 1.54.2.3 08-Oct-2001  nathanw Catch up to -current.
 1.54.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.54.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.58.4.1 01-Oct-2001  fvdl Catch up with -current.
 1.58.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.58.2.2 16-Mar-2002  jdolecek Catch up with -current.
 1.58.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.63.4.3 14-Jun-2004  jmc Pullup patch (requested by skrll in ticket #1708)

Bring netbsd-1-6 inline with -current sources after the mistakes in ticket #1686
 1.63.4.2 11-May-2004  tron Pull up revision 1.67 via patch (requested by wennmach in ticket #1686):
add Linux compat arg wrapper for ftruncate64(), and change linux compat
truncate64() wrapper to translate args structure
NetBSD truncate() and ftrucate() have hidden 'pad' argument, so we have
to do the argument translation
Problem found and patch supplied in PR kern/22360 by Ales Krenek
This is the last of syscalls with hidden 'pad' arg we didn't have
wrapper for; all the others (lseek, mmap, pwrite, pread) already had
wrapper before.
 1.63.4.1 22-Oct-2003  jmc Regen files (requested by tv in ticket #1427)

Proper support for mmap2
 1.65.2.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.65.2.4 24-Sep-2004  skrll Sync with HEAD.
 1.65.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.65.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.65.2.1 03-Aug-2004  skrll Sync with HEAD
 1.73.2.5 21-Jan-2008  yamt sync with head
 1.73.2.4 07-Dec-2007  yamt sync with head
 1.73.2.3 03-Sep-2007  yamt sync with head.
 1.73.2.2 26-Feb-2007  yamt sync with head.
 1.73.2.1 21-Jun-2006  yamt sync with head.
 1.77.14.1 19-Jun-2006  chap Sync with head.
 1.77.8.1 26-Jun-2006  yamt sync with head.
 1.77.4.1 09-Sep-2006  rpaulo sync with head
 1.80.2.1 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.81.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.82.4.1 11-Jul-2007  mjf Sync with head.
 1.82.2.1 15-Jul-2007  ad Sync with head.
 1.84.14.3 18-Feb-2008  mjf Sync with HEAD.
 1.84.14.2 27-Dec-2007  mjf Sync with HEAD.
 1.84.14.1 19-Nov-2007  mjf Sync with HEAD.
 1.84.12.1 18-Nov-2007  bouyer Sync with HEAD
 1.84.8.2 23-Mar-2008  matt sync with HEAD
 1.84.8.1 09-Jan-2008  matt sync with HEAD
 1.84.6.1 21-Nov-2007  joerg Sync with HEAD.
 1.85.6.2 19-Jan-2008  bouyer Sync with HEAD
 1.85.6.1 02-Jan-2008  bouyer Sync with HEAD
 1.85.2.1 26-Dec-2007  ad Sync with head.
 1.89.8.3 20-Nov-2008  christos merge with head.
 1.89.8.2 01-Nov-2008  christos Sync with head.
 1.89.8.1 29-Mar-2008  christos Welcome to the time_t=long long dev_t=uint64_t branch.
 1.89.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.89.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.90.2.1 18-May-2008  yamt sync with head.
 1.91.8.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.91.4.2 14-May-2008  wrstuden Per discussion with ad, remove most of the #include <sys/sa.h> lines
as they were including sa.h just for the type(s) needed for syscallargs.h.

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

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

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

I think this reduction is very good thing.
 1.91.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.91.2.4 11-Aug-2010  yamt sync with head.
 1.91.2.3 11-Mar-2010  yamt sync with head
 1.91.2.2 20-Jun-2009  yamt sync with head
 1.91.2.1 04-May-2009  yamt sync with head.
 1.93.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.93.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.99.2.1 23-Jul-2009  jym Sync with HEAD.
 1.101.4.4 31-May-2011  rmind sync with head
 1.101.4.3 21-Apr-2011  rmind sync with head
 1.101.4.2 05-Mar-2011  rmind sync with head
 1.101.4.1 30-May-2010  rmind sync with head
 1.101.2.2 17-Aug-2010  uebayasi Sync with HEAD.
 1.101.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.103.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.106.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.106.2.2 30-Oct-2012  yamt sync with head
 1.106.2.1 17-Apr-2012  yamt sync with head
 1.107.10.4 03-Dec-2017  jdolecek update from HEAD
 1.107.10.3 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.107.10.2 23-Jun-2013  tls resync from head
 1.107.10.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.109.4.1 18-May-2014  rmind sync with head
 1.112.2.1 10-Aug-2014  tls Rebase.
 1.118.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.119.2.3 05-Feb-2017  skrll Sync with HEAD
 1.119.2.2 05-Oct-2016  skrll Sync with HEAD
 1.119.2.1 06-Apr-2015  skrll Sync with HEAD
 1.120.2.2 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.120.2.1 26-Jul-2016  pgoyette Sync with HEAD
 1.122.16.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.124.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.124.2.1 15-Dec-2020  thorpej Add Linux eventfd, timerfd, and POSIX timer calls.
 1.135.2.1 02-Aug-2025  perseant Sync with HEAD
 1.4 29-May-2024  christos 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 03-Oct-1998  christos branches: 1.2.184; 1.2.194; 1.2.200; 1.2.210;
Attempt to fix the mess.
 1.1 30-Sep-1998  erh Stubs for future development of linux compat architechtures.
 1.2.210.1 10-Aug-2014  tls Rebase.
 1.2.200.1 18-May-2014  rmind sync with head
 1.2.194.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.184.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.8 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.7 24-Dec-2013  njoly Reduce diffs between arches, add fcntl64() to m68k.
 1.6 30-May-2011  alnsn branches: 1.6.4; 1.6.14; 1.6.18;
Add fadvise64 and fadvise64_64 syscalls to compat_linux and compat_linux32.
 1.5 07-Jul-2010  chs branches: 1.5.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.4 15-Jan-2008  njoly branches: 1.4.10; 1.4.30; 1.4.32;
compat linux (and linux32) uid16 functions cleanup and fixes.

- Move uid16 functions to their own file linux_uid16.c, included by
needed archs (arm, i386 and m68k).
- Add new MI types linux_{u,g}id16_t.
- Add macros to handle linux_uid16_t and uid_t conversions.
- Add linux_sys_getres{uid,gid}16 syscalls, to fix an overflow with
bad sizes given to copyout when linux_sys_getres{uid,gid} are used.
- Update arm syscall table to use more uid16 functions.
 1.3 31-Mar-2002  christos branches: 1.3.26; 1.3.84; 1.3.90; 1.3.98;
bring the reverse signal mapping array into linux_signo.c
 1.2 12-Dec-2000  jdolecek branches: 1.2.2; 1.2.4;
add emulation of Linux truncate64(2), ftruncate64(2), *stat64(2)
 1.1 15-Dec-1998  itohy branches: 1.1.8;
Initial support of Linux/m68k compatibility.
 1.1.8.1 13-Dec-2000  bouyer Sync with HEAD (for UBC fixes).
 1.2.4.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.2.2.1 17-Apr-2002  nathanw Catch up to -current.
 1.3.98.1 19-Jan-2008  bouyer Sync with HEAD
 1.3.90.1 18-Feb-2008  mjf Sync with HEAD.
 1.3.84.1 23-Mar-2008  matt sync with HEAD
 1.3.26.1 21-Jan-2008  yamt sync with head
 1.4.32.2 31-May-2011  rmind sync with head
 1.4.32.1 05-Mar-2011  rmind sync with head
 1.4.30.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.4.10.1 11-Aug-2010  yamt sync with head.
 1.5.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.6.18.1 18-May-2014  rmind sync with head
 1.6.14.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.6.4.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.5 17-Dec-2013  njoly 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.4 28-Apr-2008  martin branches: 1.4.34; 1.4.44; 1.4.50;
Remove clause 3 and 4 from TNF licenses
 1.3 12-Feb-2001  manu branches: 1.3.122; 1.3.124; 1.3.126;
Clarified comments about the LINUX_SCERR_SIGN macro
 1.2 11-Feb-2001  manu Moved the fix for negative errno returned to userland on the PowerPC to a
more machine independent fashion
 1.1 15-Dec-1998  itohy branches: 1.1.8;
Initial support of Linux/m68k compatibility.
 1.1.8.1 12-Mar-2001  bouyer Sync with HEAD.
 1.3.126.1 16-May-2008  yamt sync with head.
 1.3.124.1 18-May-2008  yamt sync with head.
 1.3.122.1 02-Jun-2008  mjf Sync with HEAD.
 1.4.50.1 18-May-2014  rmind sync with head
 1.4.44.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.4.34.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.12 12-Feb-2017  chs es_arglen is now in units of bytes, update the emulations accordingly.
 1.11 09-Feb-2014  chs branches: 1.11.6; 1.11.10; 1.11.14;
account for the 16 bytes of AT_RANDOM data in the stack setup. fixes PR 48518.
use cprng_strong32() instead of random(). add AT_RANDOM support for linux32.
 1.10 28-Apr-2008  martin branches: 1.10.34; 1.10.44; 1.10.50;
Remove clause 3 and 4 from TNF licenses
 1.9 11-Dec-2005  christos branches: 1.9.70; 1.9.72; 1.9.74;
merge ktrace-lwp.
 1.8 14-Aug-2003  christos remove the args from the macro.
 1.7 08-Aug-2003  christos - GC all the setup_stack functions
- add one for linux/i386
 1.6 13-Nov-2002  jdolecek branches: 1.6.6;
add generic linux compat ELF copyargs function

this gives:
* linux sysconf(_SC_CLK_TCK) gives correct value for linux binaries (hz)
even if hz != 100
* glibc gets proper information on real/effective uid and enables
secure mode for suid binaries

g/c LINUX_COPYARGS_FUNCTION, replaced by linux ELF copyargs function
g/c alpha-specific linux ELF copyargs function and linux ELF defines
 1.5 13-Jul-2002  scw m68k syscall rototill:

- Switch all m68k-based ports over to __HAVE_SYSCALL_INTERN.
- Add systrace glue.
- Define struct mdproc in <m68k/proc.h> instead of <machine/proc.h>.
(They were all defined exactly the same anyway, other than a couple
of the MDP_* flags.)
 1.4 17-Jan-2002  bjh21 branches: 1.4.8;
On platforms that don't __HAVE_SYSCALL_INTERN, define LINUX_SYSCALL_FUNCTION
to be the value of emul_linux.e_syscall that we want. This allows it to differ
between machines, so I can have a separate linux_syscall() on arm.
 1.3 13-Dec-2000  itohy branches: 1.3.2; 1.3.4;
sync with i386, so that exec_conf.c compiles again
 1.2 17-Nov-2000  erh Make the linux compatibilty code work on the alpha. (horay!) (at last!)
Two main changes:
Create a linux_elf64_copyargs that uses the linux specific LinuxAuxInfo
structure. This is only used on the alpha. i386 and m68k use the
standard elf copyargs function.

Since linux's approach to binary compatibilty is to look as much
like osf1 as possible, add all the osf1 syscalls that we have
implemented to the linux syscall table. This includes get/setsysinfo,
ported from FreeBSD.

In order for linux compat to work you must have COMPAT_OSF1, COMPAT_43,
COMPAT_09, COMPAT_12 and COMPAT_13 on also.
 1.1 15-Dec-1998  itohy branches: 1.1.8;
Initial support of Linux/m68k compatibility.
 1.1.8.2 13-Dec-2000  bouyer Sync with HEAD (for UBC fixes).
 1.1.8.1 22-Nov-2000  bouyer Sync with HEAD.
 1.3.4.2 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.3.4.1 11-Feb-2002  jdolecek Sync w/ -current.
 1.3.2.3 11-Dec-2002  thorpej Sync with HEAD.
 1.3.2.2 01-Aug-2002  nathanw Catch up to -current.
 1.3.2.1 28-Feb-2002  nathanw Catch up to -current.
 1.4.8.1 15-Jul-2002  gehenna catch up with -current.
 1.6.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.6.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.6.6.1 03-Aug-2004  skrll Sync with HEAD
 1.9.74.1 16-May-2008  yamt sync with head.
 1.9.72.1 18-May-2008  yamt sync with head.
 1.9.70.1 02-Jun-2008  mjf Sync with HEAD.
 1.10.50.1 18-May-2014  rmind sync with head
 1.10.44.2 03-Dec-2017  jdolecek update from HEAD
 1.10.44.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.10.34.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.11.14.1 21-Apr-2017  bouyer Sync with HEAD
 1.11.10.1 20-Mar-2017  pgoyette Sync with HEAD
 1.11.6.1 28-Aug-2017  skrll Sync with HEAD
 1.5 25-Jun-2014  njoly 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 28-Apr-2008  martin branches: 1.3.20; 1.3.22;
Remove clause 3 and 4 from TNF licenses
 1.2 30-Sep-2001  manu branches: 1.2.116; 1.2.118; 1.2.120;
Added initial support for fcntl64 system call (file locking is not
implemented)
 1.1 15-Dec-1998  itohy branches: 1.1.20; 1.1.22; 1.1.24;
Initial support of Linux/m68k compatibility.
 1.1.24.1 01-Oct-2001  fvdl Catch up with -current.
 1.1.22.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.20.1 08-Oct-2001  nathanw Catch up to -current.
 1.2.120.1 16-May-2008  yamt sync with head.
 1.2.118.1 18-May-2008  yamt sync with head.
 1.2.116.1 02-Jun-2008  mjf Sync with HEAD.
 1.3.22.1 05-Mar-2011  rmind sync with head
 1.3.20.1 06-Nov-2010  uebayasi 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.3 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.2 10-Dec-2000  fvdl branches: 1.2.122; 1.2.124; 1.2.126;
The gist of the Linux _IOX definitions was the same for all platforms;
move it to the MI linux_ioctl.h and only leave the MD bits in the MD
header files.
 1.1 15-Dec-1998  itohy branches: 1.1.8; 1.1.18;
Initial support of Linux/m68k compatibility.
 1.1.18.1 30-Mar-2001  he Pull up revision 1.2 (requested by fvdl):
Add some required Linux emulation bits to support the Linux
version of VMware.
 1.1.8.1 13-Dec-2000  bouyer Sync with HEAD (for UBC fixes).
 1.2.126.1 16-May-2008  yamt sync with head.
 1.2.124.1 18-May-2008  yamt sync with head.
 1.2.122.1 02-Jun-2008  mjf Sync with HEAD.
 1.45 01-Oct-2024  riastradh sys/compat/linux/arch: Nix trailing whitespace.

No functional change intended.
 1.44 07-Aug-2022  tsutsui branches: 1.44.10;
Remove extra whitespaces added by an ancient stupid script.
 1.43 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.42 07-Jul-2010  chs branches: 1.42.52; 1.42.64;
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.41 15-Apr-2009  elad branches: 1.41.2; 1.41.4;
Remove a few KAUTH_GENERIC_ISSUSER in favor of more descriptive
alternatives.

Discussed on tech-kern:

http://mail-index.netbsd.org/tech-kern/2009/04/11/msg004798.html

Input from ad@, christos@, dyoung@, tsutsui@.

Okay ad@.
 1.40 18-Mar-2009  cegger bcopy -> memcpy
 1.39 18-Mar-2009  cegger bzero -> memset
 1.38 28-Apr-2008  martin branches: 1.38.2; 1.38.8; 1.38.14;
Remove clause 3 and 4 from TNF licenses
 1.37 24-Apr-2008  ad branches: 1.37.2;
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.36 20-Dec-2007  dsl branches: 1.36.6; 1.36.8;
Convert all the system call entry points from:
int foo(struct lwp *l, void *v, register_t *retval)
to:
int foo(struct lwp *l, const struct foo_args *uap, register_t *retval)
Fixup compat code to not write into 'uap' and (in some cases) to actually
pass a correctly formatted 'uap' structure with the right name to the
next routine.
A few 'compat' routines that just call standard ones have been deleted.
All the 'compat' code compiles (along with the kernels required to test
build it).
98% done by automated scripts.
 1.35 08-Dec-2007  dsl branches: 1.35.4;
ANSIfy most of the function definitions in sys/compat (but not ndis).
All by the magic of sed ...
 1.34 04-Dec-2007  dsl Remove all the __P
 1.33 19-Oct-2007  ad branches: 1.33.2; 1.33.4;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.32 04-Mar-2007  tsutsui branches: 1.32.2; 1.32.14; 1.32.16; 1.32.20;
Use (char *) on pointer arith.
 1.31 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.30 09-Feb-2007  ad branches: 1.30.2;
Merge newlock2 to head.
 1.29 04-Jan-2007  elad Consistent usage of KAUTH_GENERIC_ISSUSER.
 1.28 23-Jul-2006  ad branches: 1.28.4;
Use the LWP cached credentials where sane.
 1.27 15-May-2006  yamt include kauth.h for kauth_cred_geteuid, etc.
 1.26 14-May-2006  elad integrate kauth.
 1.25 24-Dec-2005  perry branches: 1.25.4; 1.25.6; 1.25.8; 1.25.10; 1.25.12;
bare asm -> __asm
 1.24 11-Dec-2005  christos merge ktrace-lwp.
 1.23 20-May-2005  fvdl branches: 1.23.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.22 28-Sep-2003  cl fix fmovem argument reference
 1.21 28-Sep-2003  cl catch up with const sigset_t
 1.20 25-Sep-2003  christos constify sendsig/trapsignal
 1.19 22-Sep-2003  cl SA_SIGINFO support for m68k (emul linux)
 1.18 02-Aug-2003  jdolecek replace fuword() with copyin(), and suword() with copyout()
 1.17 29-Jun-2003  fvdl branches: 1.17.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.16 29-Jun-2003  thorpej Adapt to ktrace/lwp changes.
 1.15 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.14 04-Jul-2002  thorpej Add kernel support for having userland provide the signal trampoline:

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

Changes to libc to use the new facility will be checked in later. Kernel
version not bumped; we will ride the 1.6C bump made recently.
 1.13 08-Apr-2002  christos branches: 1.13.2;
PR/16231: Ben Harris: m68k does not compile.
 1.12 31-Mar-2002  christos make signal array handling uniform, and put signal arrays in a separate
file. This is simular to errno array handling.
 1.11 19-Feb-2002  is fix some swapped parameters
 1.10 15-Feb-2002  christos - add a real linux_sys___sysctl because the mib numbers are different.
implement only the kernel version getting entries.
- make the signal conversion functions consistent; dest is arg 1.
- make linux_fakedev deal with block and char devices differently.
- add linux_sys_ugetrlimit, and flesh out the regular get/setrlimit so
that they work properly.
- add linux_mmap2 [untested].
- bump kernel to 2.4.18, and make the date be valentine's day :-)
- linux_sys_*stat64 family was totally busted. Fix it.

tested only on i386.

Status:
gdb, telnet, work
jdk-1.4.0 extractor works, jdk still coredumps.

christos
 1.9 13-Nov-2001  lukem add RCSIDs (including regeneration of files as appropriate)
 1.8 04-Feb-2001  jmc branches: 1.8.2; 1.8.4;
Back out last change. m68k.h is now in cpu.h (which got updated in between
my noticing this problem here on a sun3).
 1.7 04-Feb-2001  jmc Add m68k/m68k.h to pickup fputype definitions.
 1.6 22-Dec-2000  jdolecek split off thread specific stuff from struct sigacts to struct sigctx, leaving
only signal handler array sharable between threads
move other random signal stuff from struct proc to struct sigctx

This addresses kern/10981 by Matthew Orgass.
 1.5 16-Dec-2000  scw Sprinkle some register prefixes in the asm() statements.
 1.4 19-Apr-1999  kleink branches: 1.4.2;
Move linux_reenter_syscall() to a common location and rename it to
reenter_syscall() - it's going to be shared with COMPAT_SVR4 and soon be
used by native code.
 1.3 02-Mar-1999  itohy branches: 1.3.4;
cachectl -> cachectl1
 1.2 19-Dec-1998  drochner get "opt_compat_xxx.h" includes out of <sys/signal.h>
 1.1 15-Dec-1998  itohy Initial support of Linux/m68k compatibility.
 1.3.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.4.2.1 05-Jan-2001  bouyer Sync with HEAD
 1.8.4.4 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.8.4.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.8.4.2 16-Mar-2002  jdolecek Catch up with -current.
 1.8.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.8.2.8 01-Aug-2002  nathanw Catch up to -current.
 1.8.2.7 12-Jul-2002  nathanw No longer need to pull in lwp.h; proc.h pulls it in for us.
 1.8.2.6 24-Jun-2002  nathanw Curproc->curlwp renaming.

Change uses of "curproc->l_proc" back to "curproc", which is more like the
original use. Bare uses of "curproc" are now "curlwp".

"curproc" is now #defined in proc.h as ((curlwp) ? (curlwp)->l_proc) : NULL)
so that it is always safe to reference curproc (*de*referencing curproc
is another story, but that's always been true).
 1.8.2.5 21-Jun-2002  gmcgarry LWPify
 1.8.2.4 29-May-2002  nathanw #include <sys/sa.h> before <sys/syscallargs.h>, to provide sa_upcall_t
now that <sys/param.h> doesn't include <sys/sa.h>.

(Behold the Power of Ed)
 1.8.2.3 17-Apr-2002  nathanw Catch up to -current.
 1.8.2.2 28-Feb-2002  nathanw Catch up to -current.
 1.8.2.1 14-Nov-2001  nathanw Catch up to -current.
 1.13.2.1 15-Jul-2002  gehenna catch up with -current.
 1.17.2.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.17.2.4 24-Jan-2005  skrll Adapt to branch.
 1.17.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.17.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.17.2.1 03-Aug-2004  skrll Sync with HEAD
 1.23.2.7 21-Jan-2008  yamt sync with head
 1.23.2.6 07-Dec-2007  yamt sync with head
 1.23.2.5 27-Oct-2007  yamt sync with head.
 1.23.2.4 03-Sep-2007  yamt sync with head.
 1.23.2.3 26-Feb-2007  yamt sync with head.
 1.23.2.2 30-Dec-2006  yamt sync with head.
 1.23.2.1 21-Jun-2006  yamt sync with head.
 1.25.12.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.25.10.2 10-Mar-2006  elad generic_authorize() -> kauth_authorize_generic().
 1.25.10.1 08-Mar-2006  elad Adapt to kernel authorization KPI.
 1.25.8.2 11-Aug-2006  yamt sync with head
 1.25.8.1 24-May-2006  yamt sync with head.
 1.25.6.1 01-Jun-2006  kardel Sync with head.
 1.25.4.1 09-Sep-2006  rpaulo sync with head
 1.28.4.4 06-Feb-2007  ad More compat changes.

XXX compat_irix, compat_mach and compat_darwin need work.
 1.28.4.3 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.28.4.2 27-Jan-2007  ad More compat changes.
 1.28.4.1 12-Jan-2007  ad Sync with head.
 1.30.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.32.20.1 25-Oct-2007  bouyer Sync with HEAD.
 1.32.16.2 09-Jan-2008  matt sync with HEAD
 1.32.16.1 06-Nov-2007  matt sync with HEAD
 1.32.14.2 09-Dec-2007  jmcneill Sync with HEAD.
 1.32.14.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.32.2.1 23-Oct-2007  ad Sync with head.
 1.33.4.2 26-Dec-2007  ad Sync with head.
 1.33.4.1 08-Dec-2007  ad Sync with head.
 1.33.2.2 27-Dec-2007  mjf Sync with HEAD.
 1.33.2.1 08-Dec-2007  mjf Sync with HEAD.
 1.35.4.1 02-Jan-2008  bouyer Sync with HEAD
 1.36.8.1 18-May-2008  yamt sync with head.
 1.36.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.37.2.3 11-Aug-2010  yamt sync with head.
 1.37.2.2 04-May-2009  yamt sync with head.
 1.37.2.1 16-May-2008  yamt sync with head.
 1.38.14.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.38.8.1 28-Apr-2009  skrll Sync with HEAD.
 1.38.2.3 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.38.2.2 14-May-2008  wrstuden Per discussion with ad, remove most of the #include <sys/sa.h> lines
as they were including sa.h just for the type(s) needed for syscallargs.h.

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

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

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

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

Also, kern_sa.c has received partial cleanup. There's still more
to do, though.
 1.41.4.1 05-Mar-2011  rmind sync with head
 1.41.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.42.64.1 03-Aug-2022  martin Pull up following revision(s), all via patch
(requested by riastradh in ticket #1487):

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

sys/compat: Memset zero before copyout.

Just in case of uninitialized padding which would lead to kernel
stack disclosure. If the compiler can prove the memset redundant
then it can optimize it away; otherwise better safe than sorry.
 1.42.52.1 21-Jun-2023  martin Pull up following revision(s) (requested by riastradh in ticket #1836):

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

sys/compat: Memset zero before copyout.

Just in case of uninitialized padding which would lead to kernel
stack disclosure. If the compiler can prove the memset redundant
then it can optimize it away; otherwise better safe than sorry.
 1.44.10.1 02-Aug-2025  perseant Sync with HEAD
 1.7 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.6 04-Dec-2007  dsl branches: 1.6.12; 1.6.14; 1.6.16;
Remove all the __P
 1.5 11-Nov-2005  chs branches: 1.5.46; 1.5.48; 1.5.54; 1.5.58;
include additional headers that are now needed.
 1.4 13-Jul-2002  scw branches: 1.4.6; 1.4.22;
m68k syscall rototill:

- Switch all m68k-based ports over to __HAVE_SYSCALL_INTERN.
- Add systrace glue.
- Define struct mdproc in <m68k/proc.h> instead of <machine/proc.h>.
(They were all defined exactly the same anyway, other than a couple
of the MDP_* flags.)
 1.3 15-Feb-2002  christos branches: 1.3.8;
- add a real linux_sys___sysctl because the mib numbers are different.
implement only the kernel version getting entries.
- make the signal conversion functions consistent; dest is arg 1.
- make linux_fakedev deal with block and char devices differently.
- add linux_sys_ugetrlimit, and flesh out the regular get/setrlimit so
that they work properly.
- add linux_mmap2 [untested].
- bump kernel to 2.4.18, and make the date be valentine's day :-)
- linux_sys_*stat64 family was totally busted. Fix it.

tested only on i386.

Status:
gdb, telnet, work
jdk-1.4.0 extractor works, jdk still coredumps.

christos
 1.2 19-Apr-1999  kleink branches: 1.2.14; 1.2.16;
Move linux_reenter_syscall() to a common location and rename it to
reenter_syscall() - it's going to be shared with COMPAT_SVR4 and soon be
used by native code.
 1.1 15-Dec-1998  itohy branches: 1.1.4;
Initial support of Linux/m68k compatibility.
 1.1.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.2.16.2 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.2.16.1 16-Mar-2002  jdolecek Catch up with -current.
 1.2.14.2 01-Aug-2002  nathanw Catch up to -current.
 1.2.14.1 28-Feb-2002  nathanw Catch up to -current.
 1.3.8.1 15-Jul-2002  gehenna catch up with -current.
 1.4.22.2 07-Dec-2007  yamt sync with head
 1.4.22.1 21-Jun-2006  yamt sync with head.
 1.4.6.1 11-Dec-2005  christos Sync with head.
 1.5.58.1 08-Dec-2007  ad Sync with head.
 1.5.54.1 08-Dec-2007  mjf Sync with HEAD.
 1.5.48.1 09-Jan-2008  matt sync with HEAD
 1.5.46.1 09-Dec-2007  jmcneill Sync with HEAD.
 1.6.16.1 16-May-2008  yamt sync with head.
 1.6.14.1 18-May-2008  yamt sync with head.
 1.6.12.1 02-Jun-2008  mjf Sync with HEAD.
 1.5 14-Mar-2015  njoly Support Linux MAP_LOCKED mmap flag.
 1.4 28-Apr-2008  martin branches: 1.4.44; 1.4.64;
Remove clause 3 and 4 from TNF licenses
 1.3 11-Dec-2005  christos branches: 1.3.70; 1.3.72; 1.3.74;
merge ktrace-lwp.
 1.2 28-Aug-2004  jdolecek g/c LINUX_MAP_IGNMASK define - it's not used anywhere
 1.1 15-Dec-1998  itohy branches: 1.1.42;
Initial support of Linux/m68k compatibility.
 1.1.42.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.42.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.42.1 03-Sep-2004  skrll Sync with HEAD
 1.3.74.1 16-May-2008  yamt sync with head.
 1.3.72.1 18-May-2008  yamt sync with head.
 1.3.70.1 02-Jun-2008  mjf Sync with HEAD.
 1.4.64.1 06-Apr-2015  skrll Sync with HEAD
 1.4.44.1 03-Dec-2017  jdolecek update from HEAD
 1.3 11-Nov-1999  thorpej Add register prefixes.
 1.2 19-Apr-1999  kleink branches: 1.2.2; 1.2.4; 1.2.8;
Move linux_reenter_syscall() to a common location and rename it to
reenter_syscall() - it's going to be shared with COMPAT_SVR4 and soon be
used by native code.
 1.1 15-Dec-1998  itohy branches: 1.1.4;
Initial support of Linux/m68k compatibility.
 1.1.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.2.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.2.4.1 15-Nov-1999  fvdl Sync with -current
 1.2.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.7 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.6 31-Mar-2002  christos branches: 1.6.108; 1.6.110; 1.6.112;
bring the reverse signal mapping array into linux_signo.c
 1.5 31-Mar-2002  christos make signal array handling uniform, and put signal arrays in a separate
file. This is simular to errno array handling.
 1.4 13-Nov-2001  lukem add RCSIDs (including regeneration of files as appropriate)
 1.3 18-Jan-2001  jdolecek branches: 1.3.2; 1.3.4;
constify
 1.2 04-Dec-1999  tron Extend signal mapping array to 64 entries like in the i386 emulation.
 1.1 15-Dec-1998  itohy branches: 1.1.8; 1.1.14;
Initial support of Linux/m68k compatibility.
 1.1.14.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.1.8.2 11-Feb-2001  bouyer Sync with HEAD.
 1.1.8.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.3.4.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.3.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.3.2.2 17-Apr-2002  nathanw Catch up to -current.
 1.3.2.1 14-Nov-2001  nathanw Catch up to -current.
 1.6.112.1 16-May-2008  yamt sync with head.
 1.6.110.1 18-May-2008  yamt sync with head.
 1.6.108.1 02-Jun-2008  mjf Sync with HEAD.
 1.6 18-Nov-2011  christos - add sigtimedwait support.
- merge the siginfo population code.
 1.5 23-Nov-2008  njoly branches: 1.5.16;
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.4 28-Apr-2008  martin branches: 1.4.6; 1.4.8;
Remove clause 3 and 4 from TNF licenses
 1.3 08-Apr-2002  christos branches: 1.3.108; 1.3.110; 1.3.112;
PR/16231: Ben Harris: m68k does not compile.
 1.2 04-Apr-2002  christos use lsi_ like all other linux emulations.
 1.1 15-Dec-1998  itohy branches: 1.1.20; 1.1.22;
Initial support of Linux/m68k compatibility.
 1.1.22.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.20.1 17-Apr-2002  nathanw Catch up to -current.
 1.3.112.2 04-May-2009  yamt sync with head.
 1.3.112.1 16-May-2008  yamt sync with head.
 1.3.110.1 18-May-2008  yamt sync with head.
 1.3.108.2 17-Jan-2009  mjf Sync with HEAD.
 1.3.108.1 02-Jun-2008  mjf Sync with HEAD.
 1.4.8.1 19-Jan-2009  skrll Sync with HEAD.
 1.4.6.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.5.16.1 17-Apr-2012  yamt sync with head
 1.7 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.6 04-Dec-2007  dsl branches: 1.6.12; 1.6.14; 1.6.16;
Remove all the __P
 1.5 11-Dec-2005  christos branches: 1.5.44; 1.5.46; 1.5.52; 1.5.56;
merge ktrace-lwp.
 1.4 19-Sep-2005  christos MINSIGSTKSZ on linux is different depending on the platform and usually
smaller than ours.
 1.3 26-Nov-2002  christos branches: 1.3.6; 1.3.22;
rename: s/sa_/<compat>sa/g
 1.2 19-Mar-2002  christos - Now that RT-signals fit, fix the array to deliver them. [i386 only].
- jdk-1.4 works perfectly now. :-)
 1.1 15-Dec-1998  itohy branches: 1.1.20; 1.1.22;
Initial support of Linux/m68k compatibility.
 1.1.22.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.20.2 11-Dec-2002  thorpej Sync with HEAD.
 1.1.20.1 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.3.22.2 07-Dec-2007  yamt sync with head
 1.3.22.1 21-Jun-2006  yamt sync with head.
 1.3.6.1 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.5.56.1 08-Dec-2007  ad Sync with head.
 1.5.52.1 08-Dec-2007  mjf Sync with HEAD.
 1.5.46.1 09-Jan-2008  matt sync with HEAD
 1.5.44.1 09-Dec-2007  jmcneill Sync with HEAD.
 1.6.16.1 16-May-2008  yamt sync with head.
 1.6.14.1 18-May-2008  yamt sync with head.
 1.6.12.1 02-Jun-2008  mjf Sync with HEAD.
 1.5 25-Jan-2014  njoly 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.4 28-Apr-2008  martin branches: 1.4.34; 1.4.44; 1.4.50;
Remove clause 3 and 4 from TNF licenses
 1.3 11-Dec-2005  christos branches: 1.3.70; 1.3.72; 1.3.74;
merge ktrace-lwp.
 1.2 26-Jul-2003  jdolecek add LINUX_SO_PEERNAME, LINUX_SO_TIMESTAMP where it has been missing
fix value for LINUX_SO_DETACH_FILTER on couple places (unused anyway)

g/c LINUX_SCM_TIMESTAMP definition for some archs, it will be defined
in generic linux_socket.h
 1.1 15-Dec-1998  itohy branches: 1.1.42;
Initial support of Linux/m68k compatibility.
 1.1.42.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.42.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.42.1 03-Aug-2004  skrll Sync with HEAD
 1.3.74.1 16-May-2008  yamt sync with head.
 1.3.72.1 18-May-2008  yamt sync with head.
 1.3.70.1 02-Jun-2008  mjf Sync with HEAD.
 1.4.50.1 18-May-2014  rmind sync with head
 1.4.44.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.4.34.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.120 28-Sep-2024  christos regen
 1.119 01-Jul-2024  christos regen
 1.118 29-Jun-2024  christos branches: 1.118.2;
regen
 1.117 19-Aug-2023  christos regen
 1.116 29-Jul-2023  christos regen
 1.115 28-Jul-2023  christos regen
 1.114 02-Dec-2021  ryo regen
 1.113 24-Nov-2021  ryo regen
 1.112 20-Sep-2021  thorpej Regen for preadv(2) / pwritev(2).
 1.111 20-Sep-2021  thorpej Regen for eventfd.
 1.110 19-Sep-2021  thorpej Regen for timerfd.
 1.109 19-Sep-2021  thorpej Regen for POSIX timer syscalls.
 1.108 26-Apr-2020  thorpej branches: 1.108.2;
Regen for native futex calls.
 1.107 09-Nov-2019  jdolecek regen
 1.106 10-Aug-2018  pgoyette Regen
 1.105 10-May-2017  riastradh branches: 1.105.8; 1.105.10;
regen
 1.104 03-Feb-2017  christos branches: 1.104.4;
regen
 1.103 03-Feb-2017  martin regen
 1.102 16-Jan-2017  christos regen all
 1.101 13-Jan-2017  christos branches: 1.101.2;
regen
 1.100 02-Jan-2017  martin Regen (something apparently went wrong in previous)
 1.99 02-Jan-2017  manu Regen
 1.98 24-Jul-2016  njoly Regen for readlink/readlinkat signatures.
 1.97 24-Sep-2015  christos branches: 1.97.2;
regen
 1.96 07-Mar-2015  christos regen
 1.95 22-Nov-2014  njoly branches: 1.95.2;
Regen for ppoll signature fix
 1.94 31-May-2014  njoly branches: 1.94.2;
Regen for munmap(2) signature.
 1.93 29-May-2014  njoly Regen for utimes(2) change.
 1.92 20-May-2014  njoly Regen for getgroups/setgroups update.
 1.91 17-May-2014  njoly Regen for fadvise64 offset types changes.
 1.90 06-May-2014  njoly Regen for mknod device argument type change.
 1.89 04-May-2014  njoly Regen for pread/pwrite 64bit offset argument.
 1.88 08-Apr-2014  njoly Regen.
 1.87 15-Feb-2014  njoly branches: 1.87.2;
Regen.
 1.86 24-Dec-2013  njoly Regen for fcntl64().
 1.85 08-Dec-2013  njoly Regen.
 1.84 19-Nov-2013  chs regen
 1.83 07-Nov-2013  njoly Regen for dup/dup2/dup3 argument types fix.
 1.82 24-Sep-2013  njoly Regen for utimensat(2).
 1.81 08-Apr-2013  pooka branches: 1.81.4;
regen for utimes
 1.80 19-Sep-2012  pooka regen for ppoll (and, apparently, SYCALL_ARG_PTR)
 1.79 18-Nov-2011  christos branches: 1.79.10;
- add sigtimedwait support.
- merge the siginfo population code.
 1.78 30-May-2011  alnsn branches: 1.78.4;
Regenerate files to pick up correct RCS Ids. Suggested by Chris Badura.
 1.77 30-May-2011  alnsn Add fadvise64 and fadvise64_64 syscalls to compat_linux and compat_linux32.
 1.76 15-Apr-2011  he Regenerate these files after adding pipe2() and dup3().
 1.75 07-Jul-2010  chs branches: 1.75.2;
regen
 1.74 14-Dec-2009  matt branches: 1.74.2; 1.74.4;
Regen (new makesyscalls.sh)
 1.73 24-Nov-2009  njoly Regen for personality(2) update.
 1.72 08-Jun-2009  njoly Regen for rt_queueinfo(2) update.
 1.71 17-Jan-2009  njoly branches: 1.71.2;
Regen for wait4 update.
 1.70 13-Jan-2009  pooka Regen to prove I didn't screw up the conversion: purely RCSID changes.
 1.69 11-Jan-2009  tsutsui Regen from syscalls.master rev 1.64:
> Update for compat_50 stuff. (compile test only)
 1.68 12-Nov-2008  njoly Regen for nanosleep(2) fix.
 1.67 18-Jun-2008  tsutsui branches: 1.67.2; 1.67.4; 1.67.6;
Regen from syscalls.master rev 1.62:
> Include <sys/sched.h> before <sys/syscallargs.h> for cpuset_t.
 1.66 23-Apr-2008  ad branches: 1.66.2; 1.66.4; 1.66.6;
Regen.
 1.65 04-Apr-2008  njoly branches: 1.65.2;
Regen for linux_sys_msync removal.
 1.64 15-Jan-2008  njoly branches: 1.64.6;
Regen.
 1.63 24-Dec-2007  njoly Regen for linux_sys_getpgid removal.
 1.62 21-Dec-2007  njoly Regen for getfsuid/setfsgid syscall exchange.
 1.61 20-Dec-2007  dsl regen
 1.60 16-Nov-2007  njoly branches: 1.60.2; 1.60.6;
Regen, for syscalls cleanup.
 1.59 04-Mar-2007  christos branches: 1.59.14; 1.59.16; 1.59.20; 1.59.22;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.58 01-Sep-2006  matt branches: 1.58.8;
Regen.
 1.57 30-Aug-2006  matt Regen
 1.56 13-Jun-2006  he Regenerate after fixing the getpriority syscall definition.
 1.55 10-Jun-2006  christos regen
 1.54 11-Dec-2005  christos branches: 1.54.4; 1.54.8; 1.54.14;
merge ktrace-lwp.
 1.53 18-Oct-2005  joerg Regen.
 1.52 23-May-2005  jmc branches: 1.52.2;
Regen
 1.51 16-May-2005  fvdl Regen.
 1.50 26-Feb-2005  perry regen
 1.49 01-Aug-2004  jdolecek branches: 1.49.4; 1.49.6;
regen - sync syscall lists with Linux kernel 2.6.7
 1.48 10-Aug-2003  jdolecek regen - added wrapper for Linux ftruncate64()
 1.47 29-Jun-2003  thorpej branches: 1.47.2;
Regen: adapt to linux mmap2 changes.
 1.46 23-Jun-2003  christos Regen.
 1.45 18-Jan-2003  thorpej Regen for correct RCS ID.
 1.44 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.43 01-Nov-2002  jdolecek regen: nsysent set to 256
 1.42 12-May-2002  jdolecek branches: 1.42.4;
regen
 1.41 10-Apr-2002  christos regen
 1.40 22-Mar-2002  christos regen
 1.39 17-Feb-2002  christos regen
 1.38 15-Feb-2002  christos - add a real linux_sys___sysctl because the mib numbers are different.
implement only the kernel version getting entries.
- make the signal conversion functions consistent; dest is arg 1.
- make linux_fakedev deal with block and char devices differently.
- add linux_sys_ugetrlimit, and flesh out the regular get/setrlimit so
that they work properly.
- add linux_mmap2 [untested].
- bump kernel to 2.4.18, and make the date be valentine's day :-)
- linux_sys_*stat64 family was totally busted. Fix it.

tested only on i386.

Status:
gdb, telnet, work
jdk-1.4.0 extractor works, jdk still coredumps.

christos
 1.37 13-Nov-2001  lukem add RCSIDs (including regeneration of files as appropriate)
 1.36 30-May-2001  mrg branches: 1.36.2;
use _KERNEL_OPT.
 1.35 13-May-2001  manu Improved the accuracy of gettimeofday/settimeofday: Linux stores a srtuct
timezone in the kernel. We now keep track of it for emulated processes.
Tested for powerpc and i386. Untested on m68k, but it should be ok
Alpha has a particular implementation (osf1_sys_gettimeofday), and it has
therefore not been touched.
 1.34 30-Mar-2001  jdolecek regen - use linux_sys_nosys() instead sys_nosys()
 1.33 30-Mar-2001  jdolecek regen
 1.32 30-Mar-2001  jdolecek regen
 1.31 27-Jan-2001  thorpej branches: 1.31.2;
Regen; getpid(2) is MP-safe.
 1.30 27-Jan-2001  thorpej Regen; add sy_flags.
 1.29 29-Dec-2000  fvdl Regen.
 1.28 27-Dec-2000  fvdl Regen.
 1.27 26-Dec-2000  itohy Regen.
 1.26 18-Dec-2000  fvdl Regen.
 1.25 14-Dec-2000  jdolecek regen
 1.24 12-Dec-2000  jdolecek regen
 1.23 12-Dec-2000  jdolecek regen
 1.22 09-Dec-2000  jdolecek regen
 1.21 09-Dec-2000  mycroft Regen.
 1.20 02-Dec-2000  jdolecek regen after addition of linux_sys_swapoff()
 1.19 01-Dec-2000  jdolecek regen
 1.18 01-Nov-2000  jdolecek regen
 1.17 31-Aug-2000  itohy Regen.
 1.16 18-Aug-2000  cgd update for changed makesyscalls.master
 1.15 18-Aug-2000  cgd update for new makesyscalls.sh, and also for correct ids for changed
syscalls.master files. (you need to regenerate after checking in
syscalls.master to get the correct ids.)
 1.14 18-Mar-2000  erh branches: 1.14.4;
Regen.
 1.13 03-Feb-2000  abs regen
 1.12 16-Dec-1999  tron Regen.
 1.11 05-Dec-1999  tron Regen.
 1.10 04-Dec-1999  tron Regen.
 1.9 04-Oct-1999  tron branches: 1.9.2; 1.9.8;
Regen from "syscalls.master".
 1.8 16-Aug-1999  tron Regen.
 1.7 14-May-1999  thorpej Regen.
 1.6 13-May-1999  thorpej Regen.
 1.5 30-Mar-1999  tron branches: 1.5.4;
Regen.
 1.4 27-Mar-1999  tron Regen.
 1.3 23-Mar-1999  thorpej Regen; pread(2) and pwrite(2).
 1.2 10-Feb-1999  itohy Regen.
 1.1 15-Dec-1998  itohy Generated from syscalls.master.
 1.5.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.9.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.9.2.7 21-Apr-2001  bouyer Sync with HEAD
 1.9.2.6 11-Feb-2001  bouyer Sync with HEAD.
 1.9.2.5 05-Jan-2001  bouyer Sync with HEAD
 1.9.2.4 13-Dec-2000  bouyer Sync with HEAD (for UBC fixes).
 1.9.2.3 08-Dec-2000  bouyer Sync with HEAD.
 1.9.2.2 22-Nov-2000  bouyer Sync with HEAD.
 1.9.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.14.4.2 01-May-2001  he Pull up regenerated files (requested by jdolecek):
Make it possible to use a different function for unimplemented
syscalls than sys_nosys(), so that the Linux emulation can avoid
posting SIGSYS and instead just return ENOSYS.
 1.14.4.1 30-Mar-2001  he Pull up regenerated files (requested by fvdl):
Add some required Linux emulation bits to support the Linux
version of VMware.
 1.31.2.9 11-Nov-2002  nathanw Catch up to -current
 1.31.2.8 20-Jun-2002  nathanw Catch up to -current.
 1.31.2.7 29-May-2002  nathanw Regen.
 1.31.2.6 17-Apr-2002  nathanw Catch up to -current.
 1.31.2.5 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.31.2.4 28-Feb-2002  nathanw Catch up to -current.
 1.31.2.3 14-Nov-2001  nathanw Catch up to -current.
 1.31.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.31.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.36.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.36.2.2 16-Mar-2002  jdolecek Catch up with -current.
 1.36.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.42.4.4 27-May-2004  tron Regen for ticket #1701.
 1.42.4.3 11-May-2004  tron Regen for ticket 1686.
 1.42.4.2 20-Nov-2003  jmc Regen after fix in syscalls.master from ticket #1427.
 1.42.4.1 22-Oct-2003  jmc Regen files (requested by tv in ticket #1427)

Proper support for mmap2
 1.47.2.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.47.2.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.47.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.47.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.47.2.1 03-Aug-2004  skrll Sync with HEAD
 1.49.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.49.4.1 29-Apr-2005  kent sync with -current
 1.52.2.5 21-Jan-2008  yamt sync with head
 1.52.2.4 07-Dec-2007  yamt sync with head
 1.52.2.3 03-Sep-2007  yamt sync with head.
 1.52.2.2 30-Dec-2006  yamt sync with head.
 1.52.2.1 21-Jun-2006  yamt sync with head.
 1.54.14.1 19-Jun-2006  chap Sync with head.
 1.54.8.2 03-Sep-2006  yamt sync with head.
 1.54.8.1 26-Jun-2006  yamt sync with head.
 1.54.4.1 09-Sep-2006  rpaulo sync with head
 1.58.8.1 12-Mar-2007  rmind Sync with HEAD.
 1.59.22.3 18-Feb-2008  mjf Sync with HEAD.
 1.59.22.2 27-Dec-2007  mjf Sync with HEAD.
 1.59.22.1 19-Nov-2007  mjf Sync with HEAD.
 1.59.20.1 18-Nov-2007  bouyer Sync with HEAD
 1.59.16.2 23-Mar-2008  matt sync with HEAD
 1.59.16.1 09-Jan-2008  matt sync with HEAD
 1.59.14.1 21-Nov-2007  joerg Sync with HEAD.
 1.60.6.2 19-Jan-2008  bouyer Sync with HEAD
 1.60.6.1 02-Jan-2008  bouyer Sync with HEAD
 1.60.2.1 26-Dec-2007  ad Sync with head.
 1.64.6.3 17-Jan-2009  mjf Sync with HEAD.
 1.64.6.2 29-Jun-2008  mjf Sync with HEAD.
 1.64.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.65.2.1 18-May-2008  yamt sync with head.
 1.66.6.1 18-Jun-2008  simonb Sync with head.
 1.66.4.2 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.66.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.66.2.4 11-Aug-2010  yamt sync with head.
 1.66.2.3 11-Mar-2010  yamt sync with head
 1.66.2.2 20-Jun-2009  yamt sync with head
 1.66.2.1 04-May-2009  yamt sync with head.
 1.67.6.1 20-Nov-2008  snj Regen for ticket 81.
 1.67.4.1 19-Jan-2009  skrll Sync with HEAD.
 1.67.2.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.71.2.1 23-Jul-2009  jym Sync with HEAD.
 1.74.4.3 31-May-2011  rmind sync with head
 1.74.4.2 21-Apr-2011  rmind sync with head
 1.74.4.1 05-Mar-2011  rmind sync with head
 1.74.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.75.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.78.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.78.4.2 30-Oct-2012  yamt sync with head
 1.78.4.1 17-Apr-2012  yamt sync with head
 1.79.10.4 03-Dec-2017  jdolecek update from HEAD
 1.79.10.3 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.79.10.2 23-Jun-2013  tls resync from head
 1.79.10.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.81.4.1 18-May-2014  rmind sync with head
 1.87.2.1 10-Aug-2014  tls Rebase.
 1.94.2.1 17-Apr-2017  snj regen for ticket 1354
 1.95.2.3 05-Feb-2017  skrll Sync with HEAD
 1.95.2.2 05-Oct-2016  skrll Sync with HEAD
 1.95.2.1 06-Apr-2015  skrll Sync with HEAD
 1.97.2.3 20-Mar-2017  pgoyette Sync with HEAD
 1.97.2.2 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.97.2.1 26-Jul-2016  pgoyette Sync with HEAD
 1.101.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.104.4.1 11-May-2017  pgoyette Sync with HEAD
 1.105.10.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.105.10.1 10-Jun-2019  christos Sync with HEAD
 1.105.8.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.108.2.2 17-Dec-2020  thorpej Regen for preadv(2) and pwritev(2).
 1.108.2.1 15-Dec-2020  thorpej Regen for eventfd, timerfd, POSIX timers.
 1.118.2.1 02-Aug-2025  perseant Sync with HEAD
 1.119 28-Sep-2024  christos regen
 1.118 01-Jul-2024  christos regen
 1.117 29-Jun-2024  christos branches: 1.117.2;
regen
 1.116 19-Aug-2023  christos regen
 1.115 29-Jul-2023  christos regen
 1.114 28-Jul-2023  christos regen
 1.113 02-Dec-2021  ryo regen
 1.112 24-Nov-2021  ryo regen
 1.111 20-Sep-2021  thorpej Regen for preadv(2) / pwritev(2).
 1.110 20-Sep-2021  thorpej Regen for eventfd.
 1.109 19-Sep-2021  thorpej Regen for timerfd.
 1.108 19-Sep-2021  thorpej Regen for POSIX timer syscalls.
 1.107 26-Apr-2020  thorpej branches: 1.107.2;
Regen for native futex calls.
 1.106 09-Nov-2019  jdolecek regen
 1.105 10-Aug-2018  pgoyette Regen
 1.104 10-May-2017  riastradh branches: 1.104.8; 1.104.10;
regen
 1.103 03-Feb-2017  christos branches: 1.103.4;
regen
 1.102 03-Feb-2017  martin regen
 1.101 16-Jan-2017  christos regen all
 1.100 13-Jan-2017  christos branches: 1.100.2;
regen
 1.99 02-Jan-2017  martin Regen (something apparently went wrong in previous)
 1.98 02-Jan-2017  manu Regen
 1.97 24-Jul-2016  njoly Regen for readlink/readlinkat signatures.
 1.96 24-Sep-2015  christos branches: 1.96.2;
regen
 1.95 07-Mar-2015  christos regen
 1.94 22-Nov-2014  njoly branches: 1.94.2;
Regen for ppoll signature fix
 1.93 31-May-2014  njoly branches: 1.93.2;
Regen for munmap(2) signature.
 1.92 29-May-2014  njoly Regen for utimes(2) change.
 1.91 20-May-2014  njoly Regen for getgroups/setgroups update.
 1.90 17-May-2014  njoly Regen for fadvise64 offset types changes.
 1.89 06-May-2014  njoly Regen for mknod device argument type change.
 1.88 04-May-2014  njoly Regen for pread/pwrite 64bit offset argument.
 1.87 08-Apr-2014  njoly Regen.
 1.86 15-Feb-2014  njoly branches: 1.86.2;
Regen.
 1.85 24-Dec-2013  njoly Regen for fcntl64().
 1.84 08-Dec-2013  njoly Regen.
 1.83 19-Nov-2013  chs regen
 1.82 07-Nov-2013  njoly Regen for dup/dup2/dup3 argument types fix.
 1.81 24-Sep-2013  njoly Regen for utimensat(2).
 1.80 08-Apr-2013  pooka branches: 1.80.4;
regen for utimes
 1.79 19-Sep-2012  pooka regen for ppoll (and, apparently, SYCALL_ARG_PTR)
 1.78 18-Nov-2011  christos branches: 1.78.10;
- add sigtimedwait support.
- merge the siginfo population code.
 1.77 30-May-2011  alnsn branches: 1.77.4;
Regenerate files to pick up correct RCS Ids. Suggested by Chris Badura.
 1.76 30-May-2011  alnsn Add fadvise64 and fadvise64_64 syscalls to compat_linux and compat_linux32.
 1.75 15-Apr-2011  he Regenerate these files after adding pipe2() and dup3().
 1.74 07-Jul-2010  chs branches: 1.74.2;
regen
 1.73 14-Dec-2009  matt branches: 1.73.2; 1.73.4;
Regen (new makesyscalls.sh)
 1.72 24-Nov-2009  njoly Regen for personality(2) update.
 1.71 08-Jun-2009  njoly Regen for rt_queueinfo(2) update.
 1.70 17-Jan-2009  njoly branches: 1.70.2;
Regen for wait4 update.
 1.69 13-Jan-2009  pooka Regen to prove I didn't screw up the conversion: purely RCSID changes.
 1.68 11-Jan-2009  tsutsui Regen from syscalls.master rev 1.64:
> Update for compat_50 stuff. (compile test only)
 1.67 12-Nov-2008  njoly Regen for nanosleep(2) fix.
 1.66 18-Jun-2008  tsutsui branches: 1.66.2; 1.66.4; 1.66.6;
Regen from syscalls.master rev 1.62:
> Include <sys/sched.h> before <sys/syscallargs.h> for cpuset_t.
 1.65 23-Apr-2008  ad branches: 1.65.2; 1.65.4; 1.65.6;
Regen.
 1.64 04-Apr-2008  njoly branches: 1.64.2;
Regen for linux_sys_msync removal.
 1.63 15-Jan-2008  njoly branches: 1.63.6;
Regen.
 1.62 24-Dec-2007  njoly Regen for linux_sys_getpgid removal.
 1.61 21-Dec-2007  njoly Regen for getfsuid/setfsgid syscall exchange.
 1.60 20-Dec-2007  dsl regen
 1.59 16-Nov-2007  njoly branches: 1.59.2; 1.59.6;
Regen, for syscalls cleanup.
 1.58 04-Mar-2007  christos branches: 1.58.14; 1.58.16; 1.58.20; 1.58.22;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.57 01-Sep-2006  matt branches: 1.57.8;
Regen.
 1.56 30-Aug-2006  matt Regen
 1.55 13-Jun-2006  he Regenerate after fixing the getpriority syscall definition.
 1.54 10-Jun-2006  christos regen
 1.53 11-Dec-2005  christos branches: 1.53.4; 1.53.8; 1.53.14;
merge ktrace-lwp.
 1.52 18-Oct-2005  joerg Regen.
 1.51 23-May-2005  jmc branches: 1.51.2;
Regen
 1.50 16-May-2005  fvdl Regen.
 1.49 26-Feb-2005  perry regen
 1.48 01-Aug-2004  jdolecek branches: 1.48.4; 1.48.6;
regen - sync syscall lists with Linux kernel 2.6.7
 1.47 10-Aug-2003  jdolecek regen - added wrapper for Linux ftruncate64()
 1.46 29-Jun-2003  thorpej branches: 1.46.2;
Regen: adapt to linux mmap2 changes.
 1.45 23-Jun-2003  christos Regen.
 1.44 18-Jan-2003  thorpej Regen for correct RCS ID.
 1.43 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.42 12-May-2002  jdolecek branches: 1.42.4;
regen
 1.41 10-Apr-2002  christos regen
 1.40 22-Mar-2002  christos regen
 1.39 17-Feb-2002  christos regen
 1.38 15-Feb-2002  christos - add a real linux_sys___sysctl because the mib numbers are different.
implement only the kernel version getting entries.
- make the signal conversion functions consistent; dest is arg 1.
- make linux_fakedev deal with block and char devices differently.
- add linux_sys_ugetrlimit, and flesh out the regular get/setrlimit so
that they work properly.
- add linux_mmap2 [untested].
- bump kernel to 2.4.18, and make the date be valentine's day :-)
- linux_sys_*stat64 family was totally busted. Fix it.

tested only on i386.

Status:
gdb, telnet, work
jdk-1.4.0 extractor works, jdk still coredumps.

christos
 1.37 13-Nov-2001  lukem add RCSIDs (including regeneration of files as appropriate)
 1.36 30-May-2001  mrg branches: 1.36.2;
use _KERNEL_OPT.
 1.35 13-May-2001  manu Improved the accuracy of gettimeofday/settimeofday: Linux stores a srtuct
timezone in the kernel. We now keep track of it for emulated processes.
Tested for powerpc and i386. Untested on m68k, but it should be ok
Alpha has a particular implementation (osf1_sys_gettimeofday), and it has
therefore not been touched.
 1.34 30-Mar-2001  jdolecek regen - use linux_sys_nosys() instead sys_nosys()
 1.33 30-Mar-2001  jdolecek regen
 1.32 30-Mar-2001  jdolecek regen
 1.31 27-Jan-2001  thorpej branches: 1.31.2;
Regen; getpid(2) is MP-safe.
 1.30 27-Jan-2001  thorpej Regen; add sy_flags.
 1.29 29-Dec-2000  fvdl Regen.
 1.28 27-Dec-2000  fvdl Regen.
 1.27 26-Dec-2000  itohy Regen.
 1.26 18-Dec-2000  fvdl Regen.
 1.25 14-Dec-2000  jdolecek regen
 1.24 12-Dec-2000  jdolecek regen
 1.23 12-Dec-2000  jdolecek regen
 1.22 09-Dec-2000  jdolecek regen
 1.21 09-Dec-2000  mycroft Regen.
 1.20 02-Dec-2000  jdolecek regen after addition of linux_sys_swapoff()
 1.19 01-Dec-2000  jdolecek regen
 1.18 01-Nov-2000  jdolecek regen
 1.17 31-Aug-2000  itohy Regen.
 1.16 18-Aug-2000  cgd update for changed makesyscalls.master
 1.15 18-Aug-2000  cgd update for new makesyscalls.sh, and also for correct ids for changed
syscalls.master files. (you need to regenerate after checking in
syscalls.master to get the correct ids.)
 1.14 18-Mar-2000  erh branches: 1.14.4;
Regen.
 1.13 03-Feb-2000  abs regen
 1.12 16-Dec-1999  tron Regen.
 1.11 05-Dec-1999  tron Regen.
 1.10 04-Dec-1999  tron Regen.
 1.9 04-Oct-1999  tron branches: 1.9.2; 1.9.8;
Regen from "syscalls.master".
 1.8 16-Aug-1999  tron Regen.
 1.7 14-May-1999  thorpej Regen.
 1.6 13-May-1999  thorpej Regen.
 1.5 30-Mar-1999  tron branches: 1.5.4;
Regen.
 1.4 27-Mar-1999  tron Regen.
 1.3 23-Mar-1999  thorpej Regen; pread(2) and pwrite(2).
 1.2 10-Feb-1999  itohy Regen.
 1.1 15-Dec-1998  itohy Generated from syscalls.master.
 1.5.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.9.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.9.2.7 21-Apr-2001  bouyer Sync with HEAD
 1.9.2.6 11-Feb-2001  bouyer Sync with HEAD.
 1.9.2.5 05-Jan-2001  bouyer Sync with HEAD
 1.9.2.4 13-Dec-2000  bouyer Sync with HEAD (for UBC fixes).
 1.9.2.3 08-Dec-2000  bouyer Sync with HEAD.
 1.9.2.2 22-Nov-2000  bouyer Sync with HEAD.
 1.9.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.14.4.2 01-May-2001  he Pull up regenerated files (requested by jdolecek):
Make it possible to use a different function for unimplemented
syscalls than sys_nosys(), so that the Linux emulation can avoid
posting SIGSYS and instead just return ENOSYS.
 1.14.4.1 30-Mar-2001  he Pull up regenerated files (requested by fvdl):
Add some required Linux emulation bits to support the Linux
version of VMware.
 1.31.2.7 29-May-2002  nathanw Regen.
 1.31.2.6 17-Apr-2002  nathanw Catch up to -current.
 1.31.2.5 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.31.2.4 28-Feb-2002  nathanw Catch up to -current.
 1.31.2.3 14-Nov-2001  nathanw Catch up to -current.
 1.31.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.31.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.36.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.36.2.2 16-Mar-2002  jdolecek Catch up with -current.
 1.36.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.42.4.4 27-May-2004  tron Regen for ticket #1701.
 1.42.4.3 11-May-2004  tron Regen for ticket 1686.
 1.42.4.2 20-Nov-2003  jmc Regen after fix in syscalls.master from ticket #1427.
 1.42.4.1 22-Oct-2003  jmc Regen files (requested by tv in ticket #1427)

Proper support for mmap2
 1.46.2.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.46.2.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.46.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.46.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.46.2.1 03-Aug-2004  skrll Sync with HEAD
 1.48.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.48.4.1 29-Apr-2005  kent sync with -current
 1.51.2.5 21-Jan-2008  yamt sync with head
 1.51.2.4 07-Dec-2007  yamt sync with head
 1.51.2.3 03-Sep-2007  yamt sync with head.
 1.51.2.2 30-Dec-2006  yamt sync with head.
 1.51.2.1 21-Jun-2006  yamt sync with head.
 1.53.14.1 19-Jun-2006  chap Sync with head.
 1.53.8.2 03-Sep-2006  yamt sync with head.
 1.53.8.1 26-Jun-2006  yamt sync with head.
 1.53.4.1 09-Sep-2006  rpaulo sync with head
 1.57.8.1 12-Mar-2007  rmind Sync with HEAD.
 1.58.22.3 18-Feb-2008  mjf Sync with HEAD.
 1.58.22.2 27-Dec-2007  mjf Sync with HEAD.
 1.58.22.1 19-Nov-2007  mjf Sync with HEAD.
 1.58.20.1 18-Nov-2007  bouyer Sync with HEAD
 1.58.16.2 23-Mar-2008  matt sync with HEAD
 1.58.16.1 09-Jan-2008  matt sync with HEAD
 1.58.14.1 21-Nov-2007  joerg Sync with HEAD.
 1.59.6.2 19-Jan-2008  bouyer Sync with HEAD
 1.59.6.1 02-Jan-2008  bouyer Sync with HEAD
 1.59.2.1 26-Dec-2007  ad Sync with head.
 1.63.6.3 17-Jan-2009  mjf Sync with HEAD.
 1.63.6.2 29-Jun-2008  mjf Sync with HEAD.
 1.63.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.64.2.1 18-May-2008  yamt sync with head.
 1.65.6.1 18-Jun-2008  simonb Sync with head.
 1.65.4.2 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.65.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.65.2.4 11-Aug-2010  yamt sync with head.
 1.65.2.3 11-Mar-2010  yamt sync with head
 1.65.2.2 20-Jun-2009  yamt sync with head
 1.65.2.1 04-May-2009  yamt sync with head.
 1.66.6.1 20-Nov-2008  snj Regen for ticket 81.
 1.66.4.1 19-Jan-2009  skrll Sync with HEAD.
 1.66.2.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.70.2.1 23-Jul-2009  jym Sync with HEAD.
 1.73.4.3 31-May-2011  rmind sync with head
 1.73.4.2 21-Apr-2011  rmind sync with head
 1.73.4.1 05-Mar-2011  rmind sync with head
 1.73.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.74.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.77.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.77.4.2 30-Oct-2012  yamt sync with head
 1.77.4.1 17-Apr-2012  yamt sync with head
 1.78.10.4 03-Dec-2017  jdolecek update from HEAD
 1.78.10.3 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.78.10.2 23-Jun-2013  tls resync from head
 1.78.10.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.80.4.1 18-May-2014  rmind sync with head
 1.86.2.1 10-Aug-2014  tls Rebase.
 1.93.2.1 17-Apr-2017  snj regen for ticket 1354
 1.94.2.4 28-Aug-2017  skrll Sync with HEAD
 1.94.2.3 05-Feb-2017  skrll Sync with HEAD
 1.94.2.2 05-Oct-2016  skrll Sync with HEAD
 1.94.2.1 06-Apr-2015  skrll Sync with HEAD
 1.96.2.3 20-Mar-2017  pgoyette Sync with HEAD
 1.96.2.2 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.96.2.1 26-Jul-2016  pgoyette Sync with HEAD
 1.100.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.103.4.1 11-May-2017  pgoyette Sync with HEAD
 1.104.10.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.104.10.1 10-Jun-2019  christos Sync with HEAD
 1.104.8.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.107.2.2 17-Dec-2020  thorpej Regen for preadv(2) and pwritev(2).
 1.107.2.1 15-Dec-2020  thorpej Regen for eventfd, timerfd, POSIX timers.
 1.117.2.1 02-Aug-2025  perseant Sync with HEAD
 1.120 28-Sep-2024  christos regen
 1.119 01-Jul-2024  christos regen
 1.118 29-Jun-2024  christos branches: 1.118.2;
regen
 1.117 19-Aug-2023  christos regen
 1.116 29-Jul-2023  christos regen
 1.115 28-Jul-2023  christos regen
 1.114 02-Dec-2021  ryo regen
 1.113 24-Nov-2021  ryo regen
 1.112 20-Sep-2021  thorpej Regen for preadv(2) / pwritev(2).
 1.111 20-Sep-2021  thorpej Regen for eventfd.
 1.110 19-Sep-2021  thorpej Regen for timerfd.
 1.109 19-Sep-2021  thorpej Regen for POSIX timer syscalls.
 1.108 26-Apr-2020  thorpej branches: 1.108.2;
Regen for native futex calls.
 1.107 09-Nov-2019  jdolecek regen
 1.106 10-Aug-2018  pgoyette Regen
 1.105 10-May-2017  riastradh branches: 1.105.8; 1.105.10;
regen
 1.104 03-Feb-2017  christos branches: 1.104.4;
regen
 1.103 03-Feb-2017  martin regen
 1.102 16-Jan-2017  christos regen all
 1.101 13-Jan-2017  christos branches: 1.101.2;
regen
 1.100 02-Jan-2017  martin Regen (something apparently went wrong in previous)
 1.99 02-Jan-2017  manu Regen
 1.98 24-Jul-2016  njoly Regen for readlink/readlinkat signatures.
 1.97 24-Sep-2015  christos branches: 1.97.2;
regen
 1.96 07-Mar-2015  christos regen
 1.95 22-Nov-2014  njoly branches: 1.95.2;
Regen for ppoll signature fix
 1.94 31-May-2014  njoly branches: 1.94.2;
Regen for munmap(2) signature.
 1.93 29-May-2014  njoly Regen for utimes(2) change.
 1.92 20-May-2014  njoly Regen for getgroups/setgroups update.
 1.91 17-May-2014  njoly Regen for fadvise64 offset types changes.
 1.90 06-May-2014  njoly Regen for mknod device argument type change.
 1.89 04-May-2014  njoly Regen for pread/pwrite 64bit offset argument.
 1.88 08-Apr-2014  njoly Regen.
 1.87 15-Feb-2014  njoly branches: 1.87.2;
Regen.
 1.86 24-Dec-2013  njoly Regen for fcntl64().
 1.85 08-Dec-2013  njoly Regen.
 1.84 19-Nov-2013  chs regen
 1.83 07-Nov-2013  njoly Regen for dup/dup2/dup3 argument types fix.
 1.82 24-Sep-2013  njoly Regen for utimensat(2).
 1.81 08-Apr-2013  pooka branches: 1.81.4;
regen for utimes
 1.80 19-Sep-2012  pooka regen for ppoll (and, apparently, SYCALL_ARG_PTR)
 1.79 18-Nov-2011  christos branches: 1.79.10;
- add sigtimedwait support.
- merge the siginfo population code.
 1.78 30-May-2011  alnsn branches: 1.78.4;
Regenerate files to pick up correct RCS Ids. Suggested by Chris Badura.
 1.77 30-May-2011  alnsn Add fadvise64 and fadvise64_64 syscalls to compat_linux and compat_linux32.
 1.76 15-Apr-2011  he Regenerate these files after adding pipe2() and dup3().
 1.75 07-Jul-2010  chs branches: 1.75.2;
regen
 1.74 14-Dec-2009  matt branches: 1.74.2; 1.74.4;
Regen (new makesyscalls.sh)
 1.73 24-Nov-2009  njoly Regen for personality(2) update.
 1.72 08-Jun-2009  njoly Regen for rt_queueinfo(2) update.
 1.71 17-Jan-2009  njoly branches: 1.71.2;
Regen for wait4 update.
 1.70 13-Jan-2009  pooka Regen to prove I didn't screw up the conversion: purely RCSID changes.
 1.69 11-Jan-2009  tsutsui Regen from syscalls.master rev 1.64:
> Update for compat_50 stuff. (compile test only)
 1.68 12-Nov-2008  njoly Regen for nanosleep(2) fix.
 1.67 18-Jun-2008  tsutsui branches: 1.67.2; 1.67.4; 1.67.6;
Regen from syscalls.master rev 1.62:
> Include <sys/sched.h> before <sys/syscallargs.h> for cpuset_t.
 1.66 23-Apr-2008  ad branches: 1.66.2; 1.66.4; 1.66.6;
Regen.
 1.65 04-Apr-2008  njoly branches: 1.65.2;
Regen for linux_sys_msync removal.
 1.64 15-Jan-2008  njoly branches: 1.64.6;
Regen.
 1.63 24-Dec-2007  njoly Regen for linux_sys_getpgid removal.
 1.62 21-Dec-2007  njoly Regen for getfsuid/setfsgid syscall exchange.
 1.61 20-Dec-2007  dsl regen
 1.60 16-Nov-2007  njoly branches: 1.60.2; 1.60.6;
Regen, for syscalls cleanup.
 1.59 09-Feb-2007  ad branches: 1.59.18; 1.59.20; 1.59.24; 1.59.26;
Merge newlock2 to head.
 1.58 01-Sep-2006  matt branches: 1.58.2;
Regen.
 1.57 30-Aug-2006  matt Regen
 1.56 13-Jun-2006  he Regenerate after fixing the getpriority syscall definition.
 1.55 10-Jun-2006  christos regen
 1.54 11-Dec-2005  christos branches: 1.54.4; 1.54.8; 1.54.14;
merge ktrace-lwp.
 1.53 18-Oct-2005  joerg Regen.
 1.52 23-May-2005  jmc branches: 1.52.2;
Regen
 1.51 16-May-2005  fvdl Regen.
 1.50 26-Feb-2005  perry regen
 1.49 01-Aug-2004  jdolecek branches: 1.49.4; 1.49.6;
regen - sync syscall lists with Linux kernel 2.6.7
 1.48 10-Aug-2003  jdolecek regen - added wrapper for Linux ftruncate64()
 1.47 29-Jun-2003  thorpej branches: 1.47.2;
Regen: adapt to linux mmap2 changes.
 1.46 23-Jun-2003  christos Regen.
 1.45 18-Jan-2003  thorpej Regen for correct RCS ID.
 1.44 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.43 12-May-2002  jdolecek branches: 1.43.4;
regen
 1.42 10-Apr-2002  christos regen
 1.41 22-Mar-2002  christos regen
 1.40 17-Feb-2002  christos regen
 1.39 15-Feb-2002  christos - add a real linux_sys___sysctl because the mib numbers are different.
implement only the kernel version getting entries.
- make the signal conversion functions consistent; dest is arg 1.
- make linux_fakedev deal with block and char devices differently.
- add linux_sys_ugetrlimit, and flesh out the regular get/setrlimit so
that they work properly.
- add linux_mmap2 [untested].
- bump kernel to 2.4.18, and make the date be valentine's day :-)
- linux_sys_*stat64 family was totally busted. Fix it.

tested only on i386.

Status:
gdb, telnet, work
jdk-1.4.0 extractor works, jdk still coredumps.

christos
 1.38 13-Nov-2001  lukem add RCSIDs (including regeneration of files as appropriate)
 1.37 30-May-2001  mrg branches: 1.37.2;
use _KERNEL_OPT.
 1.36 13-May-2001  manu Improved the accuracy of gettimeofday/settimeofday: Linux stores a srtuct
timezone in the kernel. We now keep track of it for emulated processes.
Tested for powerpc and i386. Untested on m68k, but it should be ok
Alpha has a particular implementation (osf1_sys_gettimeofday), and it has
therefore not been touched.
 1.35 30-Mar-2001  jdolecek regen - use linux_sys_nosys() instead sys_nosys()
 1.34 30-Mar-2001  jdolecek regen
 1.33 30-Mar-2001  jdolecek regen
 1.32 27-Jan-2001  thorpej branches: 1.32.2;
Regen; getpid(2) is MP-safe.
 1.31 27-Jan-2001  thorpej Regen; add sy_flags.
 1.30 29-Dec-2000  fvdl Regen.
 1.29 27-Dec-2000  fvdl Regen.
 1.28 26-Dec-2000  itohy Regen.
 1.27 18-Dec-2000  fvdl Regen.
 1.26 14-Dec-2000  jdolecek regen
 1.25 12-Dec-2000  jdolecek regen
 1.24 12-Dec-2000  jdolecek regen
 1.23 09-Dec-2000  jdolecek regen
 1.22 09-Dec-2000  mycroft Regen.
 1.21 02-Dec-2000  jdolecek regen after addition of linux_sys_swapoff()
 1.20 01-Dec-2000  jdolecek regen
 1.19 13-Nov-2000  jdolecek change the type of *syscallnames[] array to 'const char * const foo[]'
 1.18 01-Nov-2000  jdolecek regen
 1.17 31-Aug-2000  itohy Regen.
 1.16 18-Aug-2000  cgd update for changed makesyscalls.master
 1.15 18-Aug-2000  cgd update for new makesyscalls.sh, and also for correct ids for changed
syscalls.master files. (you need to regenerate after checking in
syscalls.master to get the correct ids.)
 1.14 18-Mar-2000  erh branches: 1.14.4;
Regen.
 1.13 03-Feb-2000  abs regen
 1.12 16-Dec-1999  tron Regen.
 1.11 05-Dec-1999  tron Regen.
 1.10 04-Dec-1999  tron Regen.
 1.9 04-Oct-1999  tron branches: 1.9.2; 1.9.8;
Regen from "syscalls.master".
 1.8 16-Aug-1999  tron Regen.
 1.7 14-May-1999  thorpej Regen.
 1.6 13-May-1999  thorpej Regen.
 1.5 30-Mar-1999  tron branches: 1.5.4;
Regen.
 1.4 27-Mar-1999  tron Regen.
 1.3 23-Mar-1999  thorpej Regen; pread(2) and pwrite(2).
 1.2 10-Feb-1999  itohy Regen.
 1.1 15-Dec-1998  itohy Generated from syscalls.master.
 1.5.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.9.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.9.2.7 21-Apr-2001  bouyer Sync with HEAD
 1.9.2.6 11-Feb-2001  bouyer Sync with HEAD.
 1.9.2.5 05-Jan-2001  bouyer Sync with HEAD
 1.9.2.4 13-Dec-2000  bouyer Sync with HEAD (for UBC fixes).
 1.9.2.3 08-Dec-2000  bouyer Sync with HEAD.
 1.9.2.2 22-Nov-2000  bouyer Sync with HEAD.
 1.9.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.14.4.2 01-May-2001  he Pull up regenerated files (requested by jdolecek):
Make it possible to use a different function for unimplemented
syscalls than sys_nosys(), so that the Linux emulation can avoid
posting SIGSYS and instead just return ENOSYS.
 1.14.4.1 30-Mar-2001  he Pull up regenerated files (requested by fvdl):
Add some required Linux emulation bits to support the Linux
version of VMware.
 1.32.2.8 20-Jun-2002  nathanw Catch up to -current.
 1.32.2.7 29-May-2002  nathanw Regen.
 1.32.2.6 17-Apr-2002  nathanw Catch up to -current.
 1.32.2.5 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.32.2.4 28-Feb-2002  nathanw Catch up to -current.
 1.32.2.3 14-Nov-2001  nathanw Catch up to -current.
 1.32.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.32.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.37.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.37.2.2 16-Mar-2002  jdolecek Catch up with -current.
 1.37.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.43.4.4 27-May-2004  tron Regen for ticket #1701.
 1.43.4.3 11-May-2004  tron Regen for ticket 1686.
 1.43.4.2 20-Nov-2003  jmc Regen after fix in syscalls.master from ticket #1427.
 1.43.4.1 22-Oct-2003  jmc Regen files (requested by tv in ticket #1427)

Proper support for mmap2
 1.47.2.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.47.2.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.47.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.47.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.47.2.1 03-Aug-2004  skrll Sync with HEAD
 1.49.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.49.4.1 29-Apr-2005  kent sync with -current
 1.52.2.5 21-Jan-2008  yamt sync with head
 1.52.2.4 07-Dec-2007  yamt sync with head
 1.52.2.3 26-Feb-2007  yamt sync with head.
 1.52.2.2 30-Dec-2006  yamt sync with head.
 1.52.2.1 21-Jun-2006  yamt sync with head.
 1.54.14.1 19-Jun-2006  chap Sync with head.
 1.54.8.2 03-Sep-2006  yamt sync with head.
 1.54.8.1 26-Jun-2006  yamt sync with head.
 1.54.4.1 09-Sep-2006  rpaulo sync with head
 1.58.2.1 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.59.26.3 18-Feb-2008  mjf Sync with HEAD.
 1.59.26.2 27-Dec-2007  mjf Sync with HEAD.
 1.59.26.1 19-Nov-2007  mjf Sync with HEAD.
 1.59.24.1 18-Nov-2007  bouyer Sync with HEAD
 1.59.20.2 23-Mar-2008  matt sync with HEAD
 1.59.20.1 09-Jan-2008  matt sync with HEAD
 1.59.18.1 21-Nov-2007  joerg Sync with HEAD.
 1.60.6.2 19-Jan-2008  bouyer Sync with HEAD
 1.60.6.1 02-Jan-2008  bouyer Sync with HEAD
 1.60.2.1 26-Dec-2007  ad Sync with head.
 1.64.6.3 17-Jan-2009  mjf Sync with HEAD.
 1.64.6.2 29-Jun-2008  mjf Sync with HEAD.
 1.64.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.65.2.1 18-May-2008  yamt sync with head.
 1.66.6.1 18-Jun-2008  simonb Sync with head.
 1.66.4.3 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.66.4.2 14-May-2008  wrstuden Per discussion with ad, remove most of the #include <sys/sa.h> lines
as they were including sa.h just for the type(s) needed for syscallargs.h.

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

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

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

I think this reduction is very good thing.
 1.66.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.66.2.4 11-Aug-2010  yamt sync with head.
 1.66.2.3 11-Mar-2010  yamt sync with head
 1.66.2.2 20-Jun-2009  yamt sync with head
 1.66.2.1 04-May-2009  yamt sync with head.
 1.67.6.1 20-Nov-2008  snj Regen for ticket 81.
 1.67.4.1 19-Jan-2009  skrll Sync with HEAD.
 1.67.2.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.71.2.1 23-Jul-2009  jym Sync with HEAD.
 1.74.4.3 31-May-2011  rmind sync with head
 1.74.4.2 21-Apr-2011  rmind sync with head
 1.74.4.1 05-Mar-2011  rmind sync with head
 1.74.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.75.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.78.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.78.4.2 30-Oct-2012  yamt sync with head
 1.78.4.1 17-Apr-2012  yamt sync with head
 1.79.10.4 03-Dec-2017  jdolecek update from HEAD
 1.79.10.3 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.79.10.2 23-Jun-2013  tls resync from head
 1.79.10.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.81.4.1 18-May-2014  rmind sync with head
 1.87.2.1 10-Aug-2014  tls Rebase.
 1.94.2.1 17-Apr-2017  snj regen for ticket 1354
 1.95.2.4 05-Feb-2017  skrll Sync with HEAD
 1.95.2.3 05-Oct-2016  skrll Sync with HEAD
 1.95.2.2 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.95.2.1 06-Apr-2015  skrll Sync with HEAD
 1.97.2.3 20-Mar-2017  pgoyette Sync with HEAD
 1.97.2.2 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.97.2.1 26-Jul-2016  pgoyette Sync with HEAD
 1.101.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.104.4.1 11-May-2017  pgoyette Sync with HEAD
 1.105.10.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.105.10.1 10-Jun-2019  christos Sync with HEAD
 1.105.8.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.108.2.2 17-Dec-2020  thorpej Regen for preadv(2) and pwritev(2).
 1.108.2.1 15-Dec-2020  thorpej Regen for eventfd, timerfd, POSIX timers.
 1.118.2.1 02-Aug-2025  perseant Sync with HEAD
 1.120 28-Sep-2024  christos regen
 1.119 01-Jul-2024  christos regen
 1.118 29-Jun-2024  christos branches: 1.118.2;
regen
 1.117 19-Aug-2023  christos regen
 1.116 29-Jul-2023  christos regen
 1.115 28-Jul-2023  christos regen
 1.114 02-Dec-2021  ryo regen
 1.113 24-Nov-2021  ryo regen
 1.112 20-Sep-2021  thorpej Regen for preadv(2) / pwritev(2).
 1.111 20-Sep-2021  thorpej Regen for eventfd.
 1.110 19-Sep-2021  thorpej Regen for timerfd.
 1.109 19-Sep-2021  thorpej Regen for POSIX timer syscalls.
 1.108 26-Apr-2020  thorpej branches: 1.108.2;
Regen for native futex calls.
 1.107 09-Nov-2019  jdolecek regen
 1.106 10-Aug-2018  pgoyette Regen
 1.105 10-May-2017  riastradh branches: 1.105.8; 1.105.10;
regen
 1.104 03-Feb-2017  christos branches: 1.104.4;
regen
 1.103 03-Feb-2017  martin regen
 1.102 16-Jan-2017  christos regen all
 1.101 13-Jan-2017  christos branches: 1.101.2;
regen
 1.100 02-Jan-2017  martin Regen (something apparently went wrong in previous)
 1.99 02-Jan-2017  manu Regen
 1.98 24-Jul-2016  njoly Regen for readlink/readlinkat signatures.
 1.97 24-Sep-2015  christos branches: 1.97.2;
regen
 1.96 07-Mar-2015  christos regen
 1.95 22-Nov-2014  njoly branches: 1.95.2;
Regen for ppoll signature fix
 1.94 31-May-2014  njoly branches: 1.94.2;
Regen for munmap(2) signature.
 1.93 29-May-2014  njoly Regen for utimes(2) change.
 1.92 20-May-2014  njoly Regen for getgroups/setgroups update.
 1.91 17-May-2014  njoly Regen for fadvise64 offset types changes.
 1.90 06-May-2014  njoly Regen for mknod device argument type change.
 1.89 04-May-2014  njoly Regen for pread/pwrite 64bit offset argument.
 1.88 08-Apr-2014  njoly Regen.
 1.87 15-Feb-2014  njoly branches: 1.87.2;
Regen.
 1.86 24-Dec-2013  njoly Regen for fcntl64().
 1.85 08-Dec-2013  njoly Regen.
 1.84 19-Nov-2013  chs regen
 1.83 07-Nov-2013  njoly Regen for dup/dup2/dup3 argument types fix.
 1.82 24-Sep-2013  njoly Regen for utimensat(2).
 1.81 08-Apr-2013  pooka branches: 1.81.4;
regen for utimes
 1.80 19-Sep-2012  pooka regen for ppoll (and, apparently, SYCALL_ARG_PTR)
 1.79 18-Nov-2011  christos branches: 1.79.10;
- add sigtimedwait support.
- merge the siginfo population code.
 1.78 30-May-2011  alnsn branches: 1.78.4;
Regenerate files to pick up correct RCS Ids. Suggested by Chris Badura.
 1.77 30-May-2011  alnsn Add fadvise64 and fadvise64_64 syscalls to compat_linux and compat_linux32.
 1.76 15-Apr-2011  he Regenerate these files after adding pipe2() and dup3().
 1.75 07-Jul-2010  chs branches: 1.75.2;
regen
 1.74 14-Dec-2009  matt branches: 1.74.2; 1.74.4;
Regen (new makesyscalls.sh)
 1.73 24-Nov-2009  njoly Regen for personality(2) update.
 1.72 08-Jun-2009  njoly Regen for rt_queueinfo(2) update.
 1.71 17-Jan-2009  njoly branches: 1.71.2;
Regen for wait4 update.
 1.70 13-Jan-2009  pooka Regen to prove I didn't screw up the conversion: purely RCSID changes.
 1.69 11-Jan-2009  tsutsui Regen from syscalls.master rev 1.64:
> Update for compat_50 stuff. (compile test only)
 1.68 12-Nov-2008  njoly Regen for nanosleep(2) fix.
 1.67 18-Jun-2008  tsutsui branches: 1.67.2; 1.67.4; 1.67.6;
Regen from syscalls.master rev 1.62:
> Include <sys/sched.h> before <sys/syscallargs.h> for cpuset_t.
 1.66 23-Apr-2008  ad branches: 1.66.2; 1.66.4; 1.66.6;
Regen.
 1.65 04-Apr-2008  njoly branches: 1.65.2;
Regen for linux_sys_msync removal.
 1.64 15-Jan-2008  njoly branches: 1.64.6;
Regen.
 1.63 24-Dec-2007  njoly Regen for linux_sys_getpgid removal.
 1.62 21-Dec-2007  njoly Regen for getfsuid/setfsgid syscall exchange.
 1.61 20-Dec-2007  dsl regen
 1.60 16-Nov-2007  njoly branches: 1.60.2; 1.60.6;
Regen, for syscalls cleanup.
 1.59 09-Feb-2007  ad branches: 1.59.18; 1.59.20; 1.59.24; 1.59.26;
Merge newlock2 to head.
 1.58 01-Sep-2006  matt branches: 1.58.2;
Regen.
 1.57 30-Aug-2006  matt Regen
 1.56 13-Jun-2006  he Regenerate after fixing the getpriority syscall definition.
 1.55 10-Jun-2006  christos regen
 1.54 11-Dec-2005  christos branches: 1.54.4; 1.54.8; 1.54.14;
merge ktrace-lwp.
 1.53 18-Oct-2005  joerg Regen.
 1.52 23-May-2005  jmc branches: 1.52.2;
Regen
 1.51 16-May-2005  fvdl Regen.
 1.50 26-Feb-2005  perry regen
 1.49 01-Aug-2004  jdolecek branches: 1.49.4; 1.49.6;
regen - sync syscall lists with Linux kernel 2.6.7
 1.48 10-Aug-2003  jdolecek regen - added wrapper for Linux ftruncate64()
 1.47 29-Jun-2003  thorpej branches: 1.47.2;
Regen: adapt to linux mmap2 changes.
 1.46 23-Jun-2003  christos Regen.
 1.45 18-Jan-2003  thorpej Regen for correct RCS ID.
 1.44 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.43 01-Nov-2002  jdolecek regen: nsysent set to 256
 1.42 12-May-2002  jdolecek branches: 1.42.4;
regen
 1.41 10-Apr-2002  christos regen
 1.40 22-Mar-2002  christos regen
 1.39 17-Feb-2002  christos regen
 1.38 15-Feb-2002  christos - add a real linux_sys___sysctl because the mib numbers are different.
implement only the kernel version getting entries.
- make the signal conversion functions consistent; dest is arg 1.
- make linux_fakedev deal with block and char devices differently.
- add linux_sys_ugetrlimit, and flesh out the regular get/setrlimit so
that they work properly.
- add linux_mmap2 [untested].
- bump kernel to 2.4.18, and make the date be valentine's day :-)
- linux_sys_*stat64 family was totally busted. Fix it.

tested only on i386.

Status:
gdb, telnet, work
jdk-1.4.0 extractor works, jdk still coredumps.

christos
 1.37 13-Nov-2001  lukem add RCSIDs (including regeneration of files as appropriate)
 1.36 30-May-2001  mrg branches: 1.36.2;
use _KERNEL_OPT.
 1.35 13-May-2001  manu Improved the accuracy of gettimeofday/settimeofday: Linux stores a srtuct
timezone in the kernel. We now keep track of it for emulated processes.
Tested for powerpc and i386. Untested on m68k, but it should be ok
Alpha has a particular implementation (osf1_sys_gettimeofday), and it has
therefore not been touched.
 1.34 30-Mar-2001  jdolecek regen - use linux_sys_nosys() instead sys_nosys()
 1.33 30-Mar-2001  jdolecek regen
 1.32 30-Mar-2001  jdolecek regen
 1.31 27-Jan-2001  thorpej branches: 1.31.2;
Regen; getpid(2) is MP-safe.
 1.30 27-Jan-2001  thorpej Regen; add sy_flags.
 1.29 29-Dec-2000  fvdl Regen.
 1.28 27-Dec-2000  fvdl Regen.
 1.27 26-Dec-2000  itohy Regen.
 1.26 18-Dec-2000  fvdl Regen.
 1.25 14-Dec-2000  jdolecek regen
 1.24 12-Dec-2000  jdolecek regen
 1.23 12-Dec-2000  jdolecek regen
 1.22 09-Dec-2000  jdolecek regen
 1.21 09-Dec-2000  mycroft Regen.
 1.20 02-Dec-2000  jdolecek regen after addition of linux_sys_swapoff()
 1.19 01-Dec-2000  jdolecek regen
 1.18 01-Nov-2000  jdolecek regen
 1.17 31-Aug-2000  itohy Regen.
 1.16 18-Aug-2000  cgd update for changed makesyscalls.master
 1.15 18-Aug-2000  cgd update for new makesyscalls.sh, and also for correct ids for changed
syscalls.master files. (you need to regenerate after checking in
syscalls.master to get the correct ids.)
 1.14 18-Mar-2000  erh branches: 1.14.4;
Regen.
 1.13 03-Feb-2000  abs regen
 1.12 16-Dec-1999  tron Regen.
 1.11 05-Dec-1999  tron Regen.
 1.10 04-Dec-1999  tron Regen.
 1.9 04-Oct-1999  tron branches: 1.9.2; 1.9.8;
Regen from "syscalls.master".
 1.8 16-Aug-1999  tron Regen.
 1.7 14-May-1999  thorpej Regen.
 1.6 13-May-1999  thorpej Regen.
 1.5 30-Mar-1999  tron branches: 1.5.4;
Regen.
 1.4 27-Mar-1999  tron Regen.
 1.3 23-Mar-1999  thorpej Regen; pread(2) and pwrite(2).
 1.2 10-Feb-1999  itohy Regen.
 1.1 15-Dec-1998  itohy Generated from syscalls.master.
 1.5.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.9.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.9.2.7 21-Apr-2001  bouyer Sync with HEAD
 1.9.2.6 11-Feb-2001  bouyer Sync with HEAD.
 1.9.2.5 05-Jan-2001  bouyer Sync with HEAD
 1.9.2.4 13-Dec-2000  bouyer Sync with HEAD (for UBC fixes).
 1.9.2.3 08-Dec-2000  bouyer Sync with HEAD.
 1.9.2.2 22-Nov-2000  bouyer Sync with HEAD.
 1.9.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.14.4.2 01-May-2001  he Pull up regenerated files (requested by jdolecek):
Make it possible to use a different function for unimplemented
syscalls than sys_nosys(), so that the Linux emulation can avoid
posting SIGSYS and instead just return ENOSYS.
 1.14.4.1 30-Mar-2001  he Pull up regenerated files (requested by fvdl):
Add some required Linux emulation bits to support the Linux
version of VMware.
 1.31.2.9 11-Nov-2002  nathanw Catch up to -current
 1.31.2.8 20-Jun-2002  nathanw Catch up to -current.
 1.31.2.7 29-May-2002  nathanw Regen.
 1.31.2.6 17-Apr-2002  nathanw Catch up to -current.
 1.31.2.5 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.31.2.4 28-Feb-2002  nathanw Catch up to -current.
 1.31.2.3 14-Nov-2001  nathanw Catch up to -current.
 1.31.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.31.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.36.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.36.2.2 16-Mar-2002  jdolecek Catch up with -current.
 1.36.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.42.4.4 27-May-2004  tron Regen for ticket #1701.
 1.42.4.3 11-May-2004  tron Regen for ticket 1686.
 1.42.4.2 20-Nov-2003  jmc Regen after fix in syscalls.master from ticket #1427.
 1.42.4.1 22-Oct-2003  jmc Regen files (requested by tv in ticket #1427)

Proper support for mmap2
 1.47.2.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.47.2.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.47.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.47.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.47.2.1 03-Aug-2004  skrll Sync with HEAD
 1.49.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.49.4.1 29-Apr-2005  kent sync with -current
 1.52.2.5 21-Jan-2008  yamt sync with head
 1.52.2.4 07-Dec-2007  yamt sync with head
 1.52.2.3 26-Feb-2007  yamt sync with head.
 1.52.2.2 30-Dec-2006  yamt sync with head.
 1.52.2.1 21-Jun-2006  yamt sync with head.
 1.54.14.1 19-Jun-2006  chap Sync with head.
 1.54.8.2 03-Sep-2006  yamt sync with head.
 1.54.8.1 26-Jun-2006  yamt sync with head.
 1.54.4.1 09-Sep-2006  rpaulo sync with head
 1.58.2.1 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.59.26.3 18-Feb-2008  mjf Sync with HEAD.
 1.59.26.2 27-Dec-2007  mjf Sync with HEAD.
 1.59.26.1 19-Nov-2007  mjf Sync with HEAD.
 1.59.24.1 18-Nov-2007  bouyer Sync with HEAD
 1.59.20.2 23-Mar-2008  matt sync with HEAD
 1.59.20.1 09-Jan-2008  matt sync with HEAD
 1.59.18.1 21-Nov-2007  joerg Sync with HEAD.
 1.60.6.2 19-Jan-2008  bouyer Sync with HEAD
 1.60.6.1 02-Jan-2008  bouyer Sync with HEAD
 1.60.2.1 26-Dec-2007  ad Sync with head.
 1.64.6.3 17-Jan-2009  mjf Sync with HEAD.
 1.64.6.2 29-Jun-2008  mjf Sync with HEAD.
 1.64.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.65.2.1 18-May-2008  yamt sync with head.
 1.66.6.1 18-Jun-2008  simonb Sync with head.
 1.66.4.3 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.66.4.2 14-May-2008  wrstuden Per discussion with ad, remove most of the #include <sys/sa.h> lines
as they were including sa.h just for the type(s) needed for syscallargs.h.

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

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

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

I think this reduction is very good thing.
 1.66.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.66.2.4 11-Aug-2010  yamt sync with head.
 1.66.2.3 11-Mar-2010  yamt sync with head
 1.66.2.2 20-Jun-2009  yamt sync with head
 1.66.2.1 04-May-2009  yamt sync with head.
 1.67.6.1 20-Nov-2008  snj Regen for ticket 81.
 1.67.4.1 19-Jan-2009  skrll Sync with HEAD.
 1.67.2.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.71.2.1 23-Jul-2009  jym Sync with HEAD.
 1.74.4.3 31-May-2011  rmind sync with head
 1.74.4.2 21-Apr-2011  rmind sync with head
 1.74.4.1 05-Mar-2011  rmind sync with head
 1.74.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.75.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.78.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.78.4.2 30-Oct-2012  yamt sync with head
 1.78.4.1 17-Apr-2012  yamt sync with head
 1.79.10.4 03-Dec-2017  jdolecek update from HEAD
 1.79.10.3 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.79.10.2 23-Jun-2013  tls resync from head
 1.79.10.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.81.4.1 18-May-2014  rmind sync with head
 1.87.2.1 10-Aug-2014  tls Rebase.
 1.94.2.1 17-Apr-2017  snj regen for ticket 1354
 1.95.2.4 05-Feb-2017  skrll Sync with HEAD
 1.95.2.3 05-Oct-2016  skrll Sync with HEAD
 1.95.2.2 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.95.2.1 06-Apr-2015  skrll Sync with HEAD
 1.97.2.3 20-Mar-2017  pgoyette Sync with HEAD
 1.97.2.2 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.97.2.1 26-Jul-2016  pgoyette Sync with HEAD
 1.101.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.104.4.1 11-May-2017  pgoyette Sync with HEAD
 1.105.10.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.105.10.1 10-Jun-2019  christos Sync with HEAD
 1.105.8.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.108.2.2 17-Dec-2020  thorpej Regen for preadv(2) and pwritev(2).
 1.108.2.1 15-Dec-2020  thorpej Regen for eventfd, timerfd, POSIX timers.
 1.118.2.1 02-Aug-2025  perseant Sync with HEAD
 1.6 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.5 11-Dec-2005  christos branches: 1.5.70; 1.5.72; 1.5.74;
merge ktrace-lwp.
 1.4 26-Feb-2005  perry nuke trailing whitespace
 1.3 26-Aug-2001  manu branches: 1.3.20; 1.3.28; 1.3.30;
Moved LINUX_NCCS from MI file to MD file, because the value is different
on MIPS and sparc machines.
 1.2 20-Jan-2001  manu branches: 1.2.2; 1.2.4;
Moved architecure dependent part of struct linux_termio to architecture
dependent header files.
 1.1 15-Dec-1998  itohy branches: 1.1.8;
Initial support of Linux/m68k compatibility.
 1.1.8.1 11-Feb-2001  bouyer Sync with HEAD.
 1.2.4.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.2.2.1 21-Sep-2001  nathanw Catch up to -current.
 1.3.30.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.3.28.1 29-Apr-2005  kent sync with -current
 1.3.20.1 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.5.74.1 16-May-2008  yamt sync with head.
 1.5.72.1 18-May-2008  yamt sync with head.
 1.5.70.1 02-Jun-2008  mjf Sync with HEAD.
 1.9 11-Jan-2009  christos merge christos-time_t
 1.8 28-Apr-2008  martin branches: 1.8.8; 1.8.14;
Remove clause 3 and 4 from TNF licenses
 1.7 11-Dec-2005  christos branches: 1.7.70; 1.7.72; 1.7.74;
merge ktrace-lwp.
 1.6 20-Sep-2004  jdolecek move definition of linux_fsid_t to common/linux_types.h - it's identical
across all Linux archs
 1.5 19-Sep-2004  jdolecek move definition of struct linux_stafs to common/linux_types.h, and use
explicit size types - the structure definition is actually identical
on currently support COMPAT_LINUX archs, so no point to have 6 copies of it
in the tree
 1.4 19-May-2002  jdolecek branches: 1.4.8;
On archs with broken linux struct stat64 st_ino, rename linux_stat64's
lst_ino to __lst_ino and lst_ino64 to lst_ino, and define
LINUX_STAT64_HAS_BROKEN_ST_INO. Only assign __lst_ino if this define
is present.

This fixes compile on powerpc archs, and hence port-powerpc/16893.
 1.3 16-Mar-2002  pooka branches: 1.3.4;
Replace unused padding in struct linux_stat64 by lst_ino64 as found in
linux's m68k struct stat64.

makes linux compat compile again
 1.2 12-Dec-2000  jdolecek branches: 1.2.2; 1.2.4;
define struct linux_stat64 used by linux_sys_*stat64()
 1.1 15-Dec-1998  itohy branches: 1.1.8;
Initial support of Linux/m68k compatibility.
 1.1.8.1 13-Dec-2000  bouyer Sync with HEAD (for UBC fixes).
 1.2.4.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.2.2.2 20-Jun-2002  nathanw Catch up to -current.
 1.2.2.1 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.3.4.1 30-May-2002  gehenna Catch up with -current.
 1.4.8.1 24-Sep-2004  skrll Sync with HEAD.
 1.7.74.2 04-May-2009  yamt sync with head.
 1.7.74.1 16-May-2008  yamt sync with head.
 1.7.72.1 18-May-2008  yamt sync with head.
 1.7.70.2 17-Jan-2009  mjf Sync with HEAD.
 1.7.70.1 02-Jun-2008  mjf Sync with HEAD.
 1.8.14.2 11-Jan-2009  christos add linux_suseconds_t
 1.8.14.1 28-Apr-2008  christos file linux_types.h was added on branch christos-time_t on 2009-01-11 00:17:51 +0000
 1.8.8.1 19-Jan-2009  skrll Sync with HEAD.
 1.5 11-Dec-2005  christos merge ktrace-lwp.
 1.4 01-Aug-2004  jdolecek sync the syscall lists with Linux kernel 2.6.7
 1.3 01-Nov-2002  jdolecek branches: 1.3.6;
add appropriate nsysent
 1.2 30-Mar-2001  jdolecek Use linux_sys_nosys() instead sys_nosys() here too.
 1.1 30-Sep-1998  erh branches: 1.1.12; 1.1.22; 1.1.24;
Stubs for future development of linux compat architechtures.
 1.1.24.2 11-Nov-2002  nathanw Catch up to -current
 1.1.24.1 09-Apr-2001  nathanw Catch up with -current.
 1.1.22.1 01-May-2001  he Pull up revision 1.2 (requested by jdolecek):
Make it possible to use a different function for unimplemented
syscalls than sys_nosys(), so that the Linux emulation can avoid
posting SIGSYS and instead just return ENOSYS.
 1.1.12.1 21-Apr-2001  bouyer Sync with HEAD
 1.3.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.3.6.1 03-Aug-2004  skrll Sync with HEAD
 1.107 28-Sep-2024  christos Linux GSoC-2024: renameat2, clone3, sync_file_range, syncfs (Shivraj Jamgade)
 1.106 01-Jul-2024  christos Add linux POSIX message queue support (Ricardo Branco)
 1.105 29-Jun-2024  christos branches: 1.105.2;
From gsoc 2024: Implement faccessat2 and getcpu (Shivraz)
 1.104 19-Aug-2023  christos Add inotify* syscalls GSoC 2023 (Theodore Preduta)
 1.103 29-Jul-2023  christos Add/fix statx, readahead, close_range. From GSoC 2023 by Theodore Preduta
 1.102 28-Jul-2023  christos add epoll syscalls
 1.101 02-Dec-2021  ryo add prlimit64(2) syscall to COMPAT_LINUX and COMPAT_LINUX32
 1.100 24-Nov-2021  ryo add getrandom(2) syscall entry
 1.99 20-Sep-2021  thorpej Add preadv(2) and pwritev(2) system calls to COMPAT_LINUX and COMPAT_LINUX32.
 1.98 20-Sep-2021  thorpej Add the eventfd system calls to COMPAT_LINUX and COMPAT_LINUX32.
 1.97 19-Sep-2021  thorpej Add the timerfd syscalls to COMPAT_LINUX and COMPAT_LINUX32.
 1.96 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.95 26-Apr-2020  thorpej branches: 1.95.2;
Add a NetBSD native futex implementation, mostly written by riastradh@.
Map the COMPAT_LINUX futex calls to the native ones.
 1.94 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.93 03-Feb-2017  christos branches: 1.93.14;
and send and recv mmsg and unimpl
 1.92 03-Feb-2017  martin Add accept4
 1.91 02-Jan-2017  manu branches: 1.91.2;
Add pselect6 Linux system call.
This lets Matlab R2016A run on NetBSD/amd64
 1.90 24-Jul-2016  njoly Small cleanup. Adjust readlink/readlinkat signatures to reduce diffs with
native.
 1.89 22-Nov-2014  njoly branches: 1.89.2; 1.89.4;
Fix ppoll signature (int ->u_int)
 1.88 31-May-2014  njoly branches: 1.88.2;
Fix munmap(2) signature.
 1.87 29-May-2014  njoly For utimes(2), use compat_50_sys_utimes() instead of local version.
 1.86 20-May-2014  njoly Fix getgroups/setgroups signature.
 1.85 17-May-2014  njoly Fix fadvise64 syscalls to use 64bit offset types.
 1.84 06-May-2014  njoly Reduce diffs between archs; make mknod device argument unsigned.
 1.83 04-May-2014  njoly Fix pread/pwrite syscalls which need a 64bit offset argument.
 1.82 08-Apr-2014  njoly Adjust read/write/readv/writev signature to match native versions.
 1.81 15-Feb-2014  njoly branches: 1.81.2;
Reduce diffs between archs, add mincore/madvise to m68k.
 1.80 24-Dec-2013  njoly Reduce diffs between arches, add fcntl64() to m68k.
 1.79 08-Dec-2013  njoly Sprinkle a few more linux_umode_t where appropriate.
Reduce diffs between archs.
 1.78 19-Nov-2013  chs add the *at() syscalls.
 1.77 07-Nov-2013  njoly Fix dup/dup2/dup3 argument types (u_int -> int).
 1.76 24-Sep-2013  njoly Add utimensat(2) for compat linux.
 1.75 08-Apr-2013  pooka branches: 1.75.4;
support utimes on non-alpha linux platforms
 1.74 19-Sep-2012  pooka emulate ppoll which is essentially our pollts
 1.73 18-Nov-2011  christos branches: 1.73.10;
add sigtimedwait
 1.72 09-Jul-2011  christos branches: 1.72.2;
the first argument of {g,s}etitimer() is int not u_int.
 1.71 30-May-2011  alnsn Add fadvise64 and fadvise64_64 syscalls to compat_linux and compat_linux32.
 1.70 15-Apr-2011  he Add dup3() and pipe2() for these archs as well.
 1.69 07-Jul-2010  chs branches: 1.69.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.68 24-Nov-2009  njoly branches: 1.68.2; 1.68.4;
Update personality(2) to match Linux definition where the argument is an
unsigned long.
 1.67 08-Jun-2009  njoly Update rt_queueinfo(2) definition, and kill a corresponding comment.
 1.66 17-Jan-2009  njoly branches: 1.66.2;
Convert linux/linux32 wait(4) to use a compat50 rusage structure.
 1.65 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.64 11-Jan-2009  tsutsui Update for compat_50 stuff. (compile test only)
 1.63 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.62 18-Jun-2008  tsutsui branches: 1.62.2; 1.62.4; 1.62.6;
Include <sys/sched.h> before <sys/syscallargs.h> for cpuset_t.
 1.61 23-Apr-2008  ad branches: 1.61.2; 1.61.4; 1.61.6;
-SYCALL_MPSAFE
 1.60 04-Apr-2008  njoly branches: 1.60.2;
Cleanup. Kill linux_sys_msync and use sys___msync13 instead.
No functional changes expected.
 1.59 15-Jan-2008  njoly branches: 1.59.6;
compat linux (and linux32) uid16 functions cleanup and fixes.

- Move uid16 functions to their own file linux_uid16.c, included by
needed archs (arm, i386 and m68k).
- Add new MI types linux_{u,g}id16_t.
- Add macros to handle linux_uid16_t and uid_t conversions.
- Add linux_sys_getres{uid,gid}16 syscalls, to fix an overflow with
bad sizes given to copyout when linux_sys_getres{uid,gid} are used.
- Update arm syscall table to use more uid16 functions.
 1.58 24-Dec-2007  njoly Kill unneeded linux_sys_getpgid and use native sys_getpgid instead.
 1.57 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.56 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.55 16-Nov-2007  njoly branches: 1.55.2; 1.55.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.54 04-Mar-2007  christos branches: 1.54.14; 1.54.16; 1.54.20; 1.54.22;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.53 09-Feb-2007  ad branches: 1.53.2;
Merge newlock2 to head.
 1.52 01-Sep-2006  matt branches: 1.52.2;
Don't conditionalize *sys_ptrace. The lack of sys_ptrace will be dealt
with differently.
 1.51 30-Aug-2006  matt Update to deal with options PTRACE
 1.50 13-Jun-2006  he We need the argument structure for the getpriority syscall defined, so
change NOARGS to STD.
 1.49 10-Jun-2006  christos linux getpriority is off-by-20 so use our own function.
From PR/33671: Nicolas Joly
 1.48 11-Dec-2005  christos branches: 1.48.4; 1.48.8; 1.48.14;
merge ktrace-lwp.
 1.47 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.46 23-May-2005  jmc branches: 1.46.2;
Add clock_* POSIX functions.
 1.45 16-May-2005  fvdl Add *xattr functions (they all return EOPNOTSUPP).
 1.44 01-Aug-2004  jdolecek sync the syscall lists with Linux kernel 2.6.7
 1.43 10-Aug-2003  jdolecek add Linux compat arg wrapper for ftruncate64(), and change linux compat
truncate64() wrapper to translate args structure
NetBSD truncate() and ftrucate() have hidden 'pad' argument, so we have
to do the argument translation

Problem found and patch supplied in PR kern/22360 by Ales Krenek

This is the last of syscalls with hidden 'pad' arg we didn't have
wrapper for; all the others (lseek, mmap, pwrite, pread) already had
wrapper before.
 1.42 29-Jun-2003  thorpej branches: 1.42.2;
Adapt to linux mmap2 changes.
 1.41 23-Jun-2003  christos PR/21937: Todd Vierling: Proper support for mmap2
 1.40 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.39 12-May-2002  jdolecek branches: 1.39.4;
update for newer syscalls (from 2.5.15)
Linux m68k doesn't seem to have fcntl64 syscall - oversight?
 1.38 10-Apr-2002  christos add getdents64
 1.37 22-Mar-2002  christos add mprotect, nuke mmap2
 1.36 17-Feb-2002  christos fix rlimit confusion.
 1.35 15-Feb-2002  christos - add a real linux_sys___sysctl because the mib numbers are different.
implement only the kernel version getting entries.
- make the signal conversion functions consistent; dest is arg 1.
- make linux_fakedev deal with block and char devices differently.
- add linux_sys_ugetrlimit, and flesh out the regular get/setrlimit so
that they work properly.
- add linux_mmap2 [untested].
- bump kernel to 2.4.18, and make the date be valentine's day :-)
- linux_sys_*stat64 family was totally busted. Fix it.

tested only on i386.

Status:
gdb, telnet, work
jdk-1.4.0 extractor works, jdk still coredumps.

christos
 1.34 30-May-2001  mrg branches: 1.34.2;
use _KERNEL_OPT.
 1.33 13-May-2001  manu Improved the accuracy of gettimeofday/settimeofday: Linux stores a srtuct
timezone in the kernel. We now keep track of it for emulated processes.
Tested for powerpc and i386. Untested on m68k, but it should be ok
Alpha has a particular implementation (osf1_sys_gettimeofday), and it has
therefore not been touched.
 1.32 30-Mar-2001  jdolecek use UNIMPL instead of NODEF for the dummy syscalls 218, 219
 1.31 30-Mar-2001  jdolecek Add new syscalls from Linux 2.4.3 to the lists. Not implemented ATM.
 1.30 30-Mar-2001  jdolecek Implement linux_sys_nosys() and use it instead of sys_nosys() for
unimplemented syscalls. Difference is that linux_sys_nosys() doesn't
post SIGSYS to the process. Linux doesn't do that and thus glibc (and
probably other Linux code) doesn't deal with SIGSYS, even through it
generally contains fallback code for ENOSYS case.

This also addresses port-i386/12503, though the issue was already discussed
earlier.
 1.29 27-Jan-2001  thorpej branches: 1.29.2;
getpid(2) is MP-safe.
 1.28 29-Dec-2000  fvdl Don't pass through link(2) directly, as we need to do altpath checks.
 1.27 27-Dec-2000  fvdl Add all uid and gid calls, and do the right thing for the older 16 bit
ones.
 1.26 26-Dec-2000  itohy Declare linux_sys_setgid16() (NOARGS -> STD).
Change syscall #182 from linux_sys_lchown() to linux_sys_lchown16().
 1.25 18-Dec-2000  fvdl Update for Linux calls with 32 bit uids/gids.
 1.24 14-Dec-2000  jdolecek add sysinfo()
 1.23 12-Dec-2000  jdolecek actually, we need to wrap sys_truncate() call so that the /emul/linux/...
path is tried first
fix ftruncate64 entry - first arg to ftruncate is int fd, not path
 1.22 12-Dec-2000  jdolecek add emulation of Linux truncate64(2), ftruncate64(2), *stat64(2)
 1.21 09-Dec-2000  jdolecek add more unimplemented syscalls to list
 1.20 09-Dec-2000  mycroft Add the %% separators.
 1.19 09-Dec-2000  mycroft Add the %% separators.
 1.18 02-Dec-2000  jdolecek add emulation of linux swapoff(2)
 1.17 01-Dec-2000  jdolecek replace compat_09_sys_setdomainname() with linux_sys_setdomainname(),
compat_12_sys_swapon() with linux_sys_swapon() - this is to drop dependency
on COMPAT_12/COMPAT_09
 1.16 01-Nov-2000  jdolecek support mlockall(), munlockall() - they are same as respective NetBSD syscalls
 1.15 31-Aug-2000  itohy Add linux_sys_sigaltstack().
 1.14 18-Mar-2000  erh branches: 1.14.4;
Use linux_sys_reboot instead of sys_reboot.
 1.13 03-Feb-2000  abs Add Linux fsuid system calls - from Witold J. Wnuk in PR kern/9335
 1.12 16-Dec-1999  tron Add ptrace(2).
 1.11 05-Dec-1999  tron Add proper stub code to make emulation of Linux's pread(2) and pwrite(2)
work. Fixes PR kern/8945 by Dave Sainty.
 1.10 04-Dec-1999  tron Consistently call signal number arguments "signum".
 1.9 04-Oct-1999  tron branches: 1.9.2; 1.9.8;
Add emulation for scheduler related syscalls. Although they are dummies
even under Linux the posix thread library for "glibc2" requires them.
 1.8 16-Aug-1999  tron Add stime() to syscalls table.
 1.7 14-May-1999  thorpej Emulate the Linux vfork(2) (which is like NetBSD's __vfork14(2)),
{get,set}resuid(2), and {get,set}resgid(2). Note a few more system
calls that we don't yet emulate.
 1.6 13-May-1999  thorpej Emulate the Linux clone(2) system call.
 1.5 30-Mar-1999  tron branches: 1.5.4;
Add poll() emulation.
 1.4 27-Mar-1999  tron Add emulation for Linux "getcwd" syscall.
 1.3 23-Mar-1999  thorpej Add support for emulating the Linux pread(2) and pwrite(2) system calls;
just call the native NetBSD versions.

PR #7202, Jaromir Dolecek <dolecek@ics.muni.cz>.
 1.2 10-Feb-1999  itohy const mania
 1.1 15-Dec-1998  itohy Initial support of Linux/m68k compatibility.
 1.5.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.9.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.9.2.7 21-Apr-2001  bouyer Sync with HEAD
 1.9.2.6 11-Feb-2001  bouyer Sync with HEAD.
 1.9.2.5 05-Jan-2001  bouyer Sync with HEAD
 1.9.2.4 13-Dec-2000  bouyer Sync with HEAD (for UBC fixes).
 1.9.2.3 08-Dec-2000  bouyer Sync with HEAD.
 1.9.2.2 22-Nov-2000  bouyer Sync with HEAD.
 1.9.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.14.4.2 01-May-2001  he Pull up revision 1.30 (requested by jdolecek):
Make it possible to use a different function for unimplemented
syscalls than sys_nosys(), so that the Linux emulation can avoid
posting SIGSYS and instead just return ENOSYS.
 1.14.4.1 30-Mar-2001  he Pull up revision 1.28 (requested by fvdl):
Add some required Linux emulation bits to support the Linux
version of VMware.
 1.29.2.7 20-Jun-2002  nathanw Catch up to -current.
 1.29.2.6 29-May-2002  nathanw #include <sys/sa.h> before <sys/syscallargs.h>, to provide sa_upcall_t
now that <sys/param.h> doesn't include <sys/sa.h>.

(Behold the Power of Ed)
 1.29.2.5 17-Apr-2002  nathanw Catch up to -current.
 1.29.2.4 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.29.2.3 28-Feb-2002  nathanw Catch up to -current.
 1.29.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.29.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.34.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.34.2.1 16-Mar-2002  jdolecek Catch up with -current.
 1.39.4.4 27-May-2004  tron Apply patch (requested by skrll in ticket #1701):
Correct incorrect definition of system call 194 (linux_sys_ftruncate64)
caused by the patch for ticket #1686.
 1.39.4.3 11-May-2004  tron Pull up revision 1.43 via patch (requested by wennmach in ticket #1686):
add Linux compat arg wrapper for ftruncate64(), and change linux compat
truncate64() wrapper to translate args structure
NetBSD truncate() and ftrucate() have hidden 'pad' argument, so we have
to do the argument translation
Problem found and patch supplied in PR kern/22360 by Ales Krenek
This is the last of syscalls with hidden 'pad' arg we didn't have
wrapper for; all the others (lseek, mmap, pwrite, pread) already had
wrapper before.
 1.39.4.2 20-Nov-2003  jmc Followup from ticket #1427. Need to include mmap2.h here or it won't compile
 1.39.4.1 22-Oct-2003  jmc Regen files (requested by tv in ticket #1427)

Proper support for mmap2
 1.42.2.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.42.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.42.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.42.2.1 03-Aug-2004  skrll Sync with HEAD
 1.46.2.5 21-Jan-2008  yamt sync with head
 1.46.2.4 07-Dec-2007  yamt sync with head
 1.46.2.3 03-Sep-2007  yamt sync with head.
 1.46.2.2 26-Feb-2007  yamt sync with head.
 1.46.2.1 21-Jun-2006  yamt sync with head.
 1.48.14.1 19-Jun-2006  chap Sync with head.
 1.48.8.1 26-Jun-2006  yamt sync with head.
 1.48.4.1 09-Sep-2006  rpaulo sync with head
 1.52.2.1 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.53.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.54.22.3 18-Feb-2008  mjf Sync with HEAD.
 1.54.22.2 27-Dec-2007  mjf Sync with HEAD.
 1.54.22.1 19-Nov-2007  mjf Sync with HEAD.
 1.54.20.1 18-Nov-2007  bouyer Sync with HEAD
 1.54.16.2 23-Mar-2008  matt sync with HEAD
 1.54.16.1 09-Jan-2008  matt sync with HEAD
 1.54.14.1 21-Nov-2007  joerg Sync with HEAD.
 1.55.6.2 19-Jan-2008  bouyer Sync with HEAD
 1.55.6.1 02-Jan-2008  bouyer Sync with HEAD
 1.55.2.1 26-Dec-2007  ad Sync with head.
 1.59.6.3 17-Jan-2009  mjf Sync with HEAD.
 1.59.6.2 29-Jun-2008  mjf Sync with HEAD.
 1.59.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.60.2.1 18-May-2008  yamt sync with head.
 1.61.6.1 18-Jun-2008  simonb Sync with head.
 1.61.4.3 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.61.4.2 14-May-2008  wrstuden Per discussion with ad, remove most of the #include <sys/sa.h> lines
as they were including sa.h just for the type(s) needed for syscallargs.h.

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

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

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

I think this reduction is very good thing.
 1.61.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.61.2.4 11-Aug-2010  yamt sync with head.
 1.61.2.3 11-Mar-2010  yamt sync with head
 1.61.2.2 20-Jun-2009  yamt sync with head
 1.61.2.1 04-May-2009  yamt sync with head.
 1.62.6.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.62.4.1 19-Jan-2009  skrll Sync with HEAD.
 1.62.2.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.66.2.1 23-Jul-2009  jym Sync with HEAD.
 1.68.4.3 31-May-2011  rmind sync with head
 1.68.4.2 21-Apr-2011  rmind sync with head
 1.68.4.1 05-Mar-2011  rmind sync with head
 1.68.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.69.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.72.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.72.2.2 30-Oct-2012  yamt sync with head
 1.72.2.1 17-Apr-2012  yamt sync with head
 1.73.10.4 03-Dec-2017  jdolecek update from HEAD
 1.73.10.3 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.73.10.2 23-Jun-2013  tls resync from head
 1.73.10.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.75.4.1 18-May-2014  rmind sync with head
 1.81.2.1 10-Aug-2014  tls Rebase.
 1.88.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.89.4.3 20-Mar-2017  pgoyette Sync with HEAD
 1.89.4.2 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.89.4.1 26-Jul-2016  pgoyette Sync with HEAD
 1.89.2.2 05-Feb-2017  skrll Sync with HEAD
 1.89.2.1 05-Oct-2016  skrll Sync with HEAD
 1.91.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.93.14.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.95.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.95.2.1 15-Dec-2020  thorpej Add Linux eventfd, timerfd, and POSIX timer calls.
 1.105.2.1 02-Aug-2025  perseant Sync with HEAD
 1.4 29-May-2024  christos 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 03-Oct-1998  christos branches: 1.2.184; 1.2.194; 1.2.200; 1.2.210;
Attempt to fix the mess.
 1.1 30-Sep-1998  erh Stubs for future development of linux compat architechtures.
 1.2.210.1 10-Aug-2014  tls Rebase.
 1.2.200.1 18-May-2014  rmind sync with head
 1.2.194.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.184.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.8 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.7 30-May-2011  alnsn Add fadvise64 and fadvise64_64 syscalls to compat_linux and compat_linux32.
 1.6 07-Jul-2010  chs branches: 1.6.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.5 02-Feb-2008  dsl branches: 1.5.10; 1.5.30; 1.5.32;
Extract the fcntl64() suppoort from linux_file64.c into linux_fcntl64.c
Unravel some of the knots that caused linux_file64.c to be compiled twice
for an amd64 kernel (once for linux and once for linux32) with different
parts being skipped each time.
 1.4 30-Aug-2006  matt branches: 1.4.28; 1.4.34;
Update to deal with options PTRACE
 1.3 31-Mar-2002  christos branches: 1.3.26; 1.3.40; 1.3.44;
bring the reverse signal mapping array into linux_signo.c
 1.2 30-Sep-2001  manu branches: 1.2.2; 1.2.6;
Implements parts of sysmips() and fctnl64() emulation
 1.1 22-Sep-2001  manu branches: 1.1.2;
Initial support for running Linux binaries on the Mips. Both static and
dynamic binaries work on 32 bit mips. Signals are completely broken yet,
and ptrace is not supported.
 1.1.2.4 17-Apr-2002  nathanw Catch up to -current.
 1.1.2.3 08-Oct-2001  nathanw Catch up to -current.
 1.1.2.2 26-Sep-2001  nathanw Catch up to -current.
Again.
 1.1.2.1 22-Sep-2001  nathanw file files.linux_mips was added on branch nathanw_sa on 2001-09-26 19:54:46 +0000
 1.2.6.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.2.6.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2.6.1 30-Sep-2001  thorpej file files.linux_mips was added on branch kqueue on 2002-01-10 19:51:32 +0000
 1.2.2.2 01-Oct-2001  fvdl Catch up with -current.
 1.2.2.1 30-Sep-2001  fvdl file files.linux_mips was added on branch thorpej-devvp on 2001-10-01 12:43:37 +0000
 1.3.44.1 03-Sep-2006  yamt sync with head.
 1.3.40.1 09-Sep-2006  rpaulo sync with head
 1.3.26.2 04-Feb-2008  yamt sync with head.
 1.3.26.1 30-Dec-2006  yamt sync with head.
 1.4.34.1 18-Feb-2008  mjf Sync with HEAD.
 1.4.28.1 23-Mar-2008  matt sync with HEAD
 1.5.32.2 31-May-2011  rmind sync with head
 1.5.32.1 05-Mar-2011  rmind sync with head
 1.5.30.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.5.10.1 11-Aug-2010  yamt sync with head.
 1.6.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.7 17-Dec-2013  njoly 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.6 28-Apr-2008  martin branches: 1.6.34; 1.6.44; 1.6.50;
Remove clause 3 and 4 from TNF licenses
 1.5 11-Dec-2005  christos branches: 1.5.70; 1.5.72; 1.5.74;
merge ktrace-lwp.
 1.4 26-Feb-2005  perry nuke trailing whitespace
 1.3 19-Jun-2004  manu branches: 1.3.4; 1.3.6;
Fix a reversed errno issue for Linux binaries on mips. While we are there,
fix broken includes for alpha and m68k.
 1.2 02-Sep-2001  manu branches: 1.2.4; 1.2.6; 1.2.24; 1.2.26;
Fixed indent problems
 1.1 26-Aug-2001  manu Preliminary work for Linux/Mips compatibility, more to come soon.
 1.2.26.1 22-Jun-2004  tron Pull up revision 1.3 (requested by manu in ticket #521):
Fix a reversed errno issue for Linux binaries on mips. While we are
there,
fix broken includes for alpha and m68k.
 1.2.24.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.2.24.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.24.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.24.1 03-Aug-2004  skrll Sync with HEAD
 1.2.6.2 21-Sep-2001  nathanw Catch up to -current.
 1.2.6.1 02-Sep-2001  nathanw file linux_errno.h was added on branch nathanw_sa on 2001-09-21 22:35:16 +0000
 1.2.4.2 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.2.4.1 02-Sep-2001  thorpej file linux_errno.h was added on branch kqueue on 2001-09-13 01:15:17 +0000
 1.3.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.3.4.1 29-Apr-2005  kent sync with -current
 1.5.74.1 16-May-2008  yamt sync with head.
 1.5.72.1 18-May-2008  yamt sync with head.
 1.5.70.1 02-Jun-2008  mjf Sync with HEAD.
 1.6.50.1 18-May-2014  rmind sync with head
 1.6.44.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.6.34.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.17 26-Nov-2021  ryo - LINUX_GO_RT0_SIGNATURE for compat_linux is no longer enabled by default.
it is now defined in each arch same as the other *_SIGNATURE definitions.
- add new LINUX32_GO_RT0_SIGNATURE for compat_linux32, and is defined in amd64 and aarch64.
 1.16 12-Feb-2017  chs es_arglen is now in units of bytes, update the emulations accordingly.
 1.15 09-Feb-2014  chs branches: 1.15.6; 1.15.10; 1.15.14;
account for the 16 bytes of AT_RANDOM data in the stack setup. fixes PR 48518.
use cprng_strong32() instead of random(). add AT_RANDOM support for linux32.
 1.14 13-Aug-2009  matt branches: 1.14.12; 1.14.22; 1.14.26;
Don't include EXEC_AOUT stuff by default.
 1.13 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.12 11-Dec-2005  christos branches: 1.12.70; 1.12.72; 1.12.74;
merge ktrace-lwp.
 1.11 26-Feb-2005  perry nuke trailing whitespace
 1.10 14-Aug-2003  christos branches: 1.10.8; 1.10.10;
remove the args from the macro.
 1.9 08-Aug-2003  christos - GC all the setup_stack functions
- add one for linux/i386
 1.8 21-Nov-2002  jdolecek branches: 1.8.6;
g/c also mips-specific linux ELF copyargs function prototype and
linux ELF defines, use generic Aux32Info instead
this also adresses kern/19047 by FUKAUMI Naoki
 1.7 21-Nov-2002  jdolecek g/c local definition of LINUX_ELF_AUX_ENTRIES
 1.6 13-Nov-2002  jdolecek add generic linux compat ELF copyargs function

this gives:
* linux sysconf(_SC_CLK_TCK) gives correct value for linux binaries (hz)
even if hz != 100
* glibc gets proper information on real/effective uid and enables
secure mode for suid binaries

g/c LINUX_COPYARGS_FUNCTION, replaced by linux ELF copyargs function
g/c alpha-specific linux ELF copyargs function and linux ELF defines
 1.5 26-Aug-2002  christos Implement passing AT_{E,R}{U,G}ID in the elf aux vector, like solaris.
- pass struct proc to copyargs.
- eliminate svr4_copyargs, since it is the same as ours now.
 1.4 15-Aug-2002  enami Pull changes done in rev. 1.7 of sys/compat/linux/arch/powerpc/linux_exec.h
so that sysctl(8) compiles again.
 1.3 22-Sep-2001  manu branches: 1.3.10;
Fixed errors in header files
 1.2 02-Sep-2001  manu branches: 1.2.2; 1.2.4; 1.2.6;
Added 64 bits support in header files.
All headers should be common to 32 bits MIPS and 64 bits MIPS now.
 1.1 26-Aug-2001  manu Preliminary work on Linux/mips compatibility. More to come soon...
 1.2.6.5 11-Dec-2002  thorpej Sync with HEAD.
 1.2.6.4 27-Aug-2002  nathanw Catch up to -current.
 1.2.6.3 26-Sep-2001  nathanw Catch up to -current.
Again.
 1.2.6.2 21-Sep-2001  nathanw Catch up to -current.
 1.2.6.1 02-Sep-2001  nathanw file linux_exec.h was added on branch nathanw_sa on 2001-09-21 22:35:16 +0000
 1.2.4.4 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.2.4.3 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2.4.2 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.2.4.1 02-Sep-2001  thorpej file linux_exec.h was added on branch kqueue on 2001-09-13 01:15:18 +0000
 1.2.2.1 01-Oct-2001  fvdl Catch up with -current.
 1.3.10.1 29-Aug-2002  gehenna catch up with -current.
 1.8.6.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.8.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.8.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.8.6.1 03-Aug-2004  skrll Sync with HEAD
 1.10.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.10.8.1 29-Apr-2005  kent sync with -current
 1.12.74.2 19-Aug-2009  yamt sync with head.
 1.12.74.1 16-May-2008  yamt sync with head.
 1.12.72.1 18-May-2008  yamt sync with head.
 1.12.70.1 02-Jun-2008  mjf Sync with HEAD.
 1.14.26.1 18-May-2014  rmind sync with head
 1.14.22.2 03-Dec-2017  jdolecek update from HEAD
 1.14.22.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.14.12.1 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.15.14.1 21-Apr-2017  bouyer Sync with HEAD
 1.15.10.1 20-Mar-2017  pgoyette Sync with HEAD
 1.15.6.1 28-Aug-2017  skrll Sync with HEAD
 1.8 25-Jun-2014  njoly Add a few missing open(2) flags (LINUX_O_*). Fix alpha wrong values.
 1.7 02-Nov-2010  chs branches: 1.7.18; 1.7.32;
define LINUX_O_CLOEXEC.
sort definitions by value.
consistently use hex instead of octal for the values.
 1.6 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.5 28-Apr-2008  martin branches: 1.5.20; 1.5.22;
Remove clause 3 and 4 from TNF licenses
 1.4 11-Dec-2005  christos branches: 1.4.70; 1.4.72; 1.4.74;
merge ktrace-lwp.
 1.3 26-Feb-2005  perry nuke trailing whitespace
 1.2 30-Sep-2001  manu branches: 1.2.18; 1.2.26; 1.2.28;
Added initial support for fcntl64 system call (file locking is not
implemented)
 1.1 26-Aug-2001  manu branches: 1.1.2; 1.1.4; 1.1.6;
Preliminary work on Linux/mips compatibility. More to come soon...
 1.1.6.3 08-Oct-2001  nathanw Catch up to -current.
 1.1.6.2 21-Sep-2001  nathanw Catch up to -current.
 1.1.6.1 26-Aug-2001  nathanw file linux_fcntl.h was added on branch nathanw_sa on 2001-09-21 22:35:16 +0000
 1.1.4.3 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.4.2 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.1.4.1 26-Aug-2001  thorpej file linux_fcntl.h was added on branch kqueue on 2001-09-13 01:15:18 +0000
 1.1.2.1 01-Oct-2001  fvdl Catch up with -current.
 1.2.28.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.2.26.1 29-Apr-2005  kent sync with -current
 1.2.18.1 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.4.74.2 09-Oct-2010  yamt sync with head
 1.4.74.1 16-May-2008  yamt sync with head.
 1.4.72.1 18-May-2008  yamt sync with head.
 1.4.70.1 02-Jun-2008  mjf Sync with HEAD.
 1.5.22.1 05-Mar-2011  rmind sync with head
 1.5.20.2 06-Nov-2010  uebayasi Sync with HEAD.
 1.5.20.1 22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.7.32.1 10-Aug-2014  tls Rebase.
 1.7.18.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.1 26-Aug-2001  manu branches: 1.1.4; 1.1.6; 1.1.122; 1.1.124; 1.1.126;
Preliminary work on Linux/mips compatibility, more to come soon...
 1.1.126.1 16-May-2008  yamt sync with head.
 1.1.124.1 18-May-2008  yamt sync with head.
 1.1.122.1 02-Jun-2008  mjf Sync with HEAD.
 1.1.6.2 21-Sep-2001  nathanw Catch up to -current.
 1.1.6.1 26-Aug-2001  nathanw file linux_ioctl.h was added on branch nathanw_sa on 2001-09-21 22:35:16 +0000
 1.1.4.2 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.1.4.1 26-Aug-2001  thorpej file linux_ioctl.h was added on branch kqueue on 2001-09-13 01:15:18 +0000
 1.45 10-Aug-2025  andvar s/aknowledge/acknowledge/ in comment.
 1.44 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.43 09-Nov-2014  maxv branches: 1.43.12; 1.43.24;
Do not uselessly include <sys/malloc.h>.
 1.42 20-Feb-2011  matt branches: 1.42.14; 1.42.30;
Deal with differences in signal delivery between o32/n32/n64.
 1.41 07-Jul-2010  chs branches: 1.41.2; 1.41.4;
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.40 14-Dec-2009  matt branches: 1.40.2; 1.40.4;
Merge from matt-nb5-mips64
 1.39 23-Nov-2009  rmind Use lwp_getpcb() in compat code, clean from struct user.
 1.38 28-Apr-2008  martin branches: 1.38.2; 1.38.18;
Remove clause 3 and 4 from TNF licenses
 1.37 24-Apr-2008  ad branches: 1.37.2;
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.36 08-Jan-2008  elad branches: 1.36.6; 1.36.8;
In linux_sys_sysmips(), remove redundant kauth(9) call for LINUX_SETNAME
as the permission check is done by old_sysctl().

okay christos@.
 1.35 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.34 08-Dec-2007  dsl branches: 1.34.4;
ANSIfy most of the function definitions in sys/compat (but not ndis).
All by the magic of sed ...
 1.33 08-Nov-2007  njoly branches: 1.33.2;
Replace strncpy with strlcpy in compat linux and linux32 uname,
old_uname and oldold_uname syscalls to ensure that all *utsname fields
are always NUL terminated.
 1.32 19-Oct-2007  ad branches: 1.32.2;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.31 13-Jun-2007  christos branches: 1.31.6; 1.31.8; 1.31.12;
cleanup some bitrot; from Matthew Orgass
 1.30 04-Mar-2007  christos branches: 1.30.2; 1.30.4;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.29 09-Feb-2007  ad branches: 1.29.2;
Merge newlock2 to head.
 1.28 04-Jan-2007  elad Consistent usage of KAUTH_GENERIC_ISSUSER.
 1.27 23-Jul-2006  ad branches: 1.27.4;
Use the LWP cached credentials where sane.
 1.26 15-May-2006  yamt include kauth.h for kauth_authorize_generic.
 1.25 14-May-2006  elad integrate kauth.
 1.24 11-Dec-2005  christos branches: 1.24.4; 1.24.6; 1.24.8; 1.24.10; 1.24.12;
merge ktrace-lwp.
 1.23 20-May-2005  fvdl branches: 1.23.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.22 26-Feb-2005  perry nuke trailing whitespace
 1.21 19-Jun-2004  manu branches: 1.21.4; 1.21.6;
Build COMPAT_LINUX again on mips after the siginfo change.
 1.20 04-Dec-2003  atatat branches: 1.20.2;
Dynamic sysctl.

Gone are the old kern_sysctl(), cpu_sysctl(), hw_sysctl(),
vfs_sysctl(), etc, routines, along with sysctl_int() et al. Now all
nodes are registered with the tree, and nodes can be added (or
removed) easily, and I/O to and from the tree is handled generically.

Since the nodes are registered with the tree, the mapping from name to
number (and back again) can now be discovered, instead of having to be
hard coded. Adding new nodes to the tree is likewise much simpler --
the new infrastructure handles almost all the work for simple types,
and just about anything else can be done with a small helper function.

All existing nodes are where they were before (numerically speaking),
so all existing consumers of sysctl information should notice no
difference.

PS - I'm sorry, but there's a distinct lack of documentation at the
moment. I'm working on sysctl(3/8/9) right now, and I promise to
watch out for buses.
 1.19 26-Sep-2003  simonb Fix "constify sendsig/trapsignal" fallout for non-siginfo'd archs. Test
compiled on most architectures.
 1.18 02-Aug-2003  jdolecek use copyin()/copyout() instead of fubyte()/subyte()
also nuke uvm_useracc() check, copyin()/copyout() do this atomically

XXX only compile-tested
 1.17 18-Jan-2003  thorpej branches: 1.17.2;
Merge the nathanw_sa branch.
 1.16 25-Sep-2002  thorpej Don't include <sys/map.h>.
 1.15 04-Jul-2002  thorpej Add kernel support for having userland provide the signal trampoline:

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

Changes to libc to use the new facility will be checked in later. Kernel
version not bumped; we will ride the 1.6C bump made recently.
 1.14 20-May-2002  jdolecek whitespace fixes
 1.13 15-Apr-2002  manu branches: 1.13.2;
Do not restore SR on sigreturn: this could enable the user process to gain
unpropre privileges.
 1.12 31-Mar-2002  christos make signal array handling uniform, and put signal arrays in a separate
file. This is simular to errno array handling.
 1.11 17-Feb-2002  rafal Adapt for changes to linux_to_native_sigset() and native_to_linux_sigset().
 1.10 15-Feb-2002  christos - add a real linux_sys___sysctl because the mib numbers are different.
implement only the kernel version getting entries.
- make the signal conversion functions consistent; dest is arg 1.
- make linux_fakedev deal with block and char devices differently.
- add linux_sys_ugetrlimit, and flesh out the regular get/setrlimit so
that they work properly.
- add linux_mmap2 [untested].
- bump kernel to 2.4.18, and make the date be valentine's day :-)
- linux_sys_*stat64 family was totally busted. Fix it.

tested only on i386.

Status:
gdb, telnet, work
jdk-1.4.0 extractor works, jdk still coredumps.

christos
 1.9 20-Nov-2001  manu branches: 1.9.2;
Removed unused (commented out) code
 1.8 20-Nov-2001  manu Fixed the Linux signal trampoline and linux_sys_sigreturn(). Linux signal
delivery now seems fully functionnal.
 1.7 17-Nov-2001  manu Make it build again after recent MIPS cache code changes
 1.6 17-Nov-2001  manu Fixed typos
 1.5 13-Nov-2001  lukem add RCSIDs (including regeneration of files as appropriate)
 1.4 14-Oct-2001  manu Fixed some mistakes in signal handling (this is still broken)
Added some code to set linux's uname kernel version to 2.4.0 (usefull for
testing with glibc-2.2). This is currently guarded by a #if 0.
 1.3 06-Oct-2001  manu Implements ATOMIC_SET in linux_sys_sysmips
 1.2 30-Sep-2001  manu branches: 1.2.2;
Implements parts of sysmips() and fctnl64() emulation
 1.1 22-Sep-2001  manu branches: 1.1.2;
Initial support for running Linux binaries on the Mips. Both static and
dynamic binaries work on 32 bit mips. Signals are completely broken yet,
and ptrace is not supported.
 1.1.2.14 18-Oct-2002  nathanw Catch up to -current.
 1.1.2.13 01-Aug-2002  nathanw Catch up to -current.
 1.1.2.12 24-Jun-2002  nathanw Curproc->curlwp renaming.

Change uses of "curproc->l_proc" back to "curproc", which is more like the
original use. Bare uses of "curproc" are now "curlwp".

"curproc" is now #defined in proc.h as ((curlwp) ? (curlwp)->l_proc) : NULL)
so that it is always safe to reference curproc (*de*referencing curproc
is another story, but that's always been true).
 1.1.2.11 20-Jun-2002  nathanw Catch up to -current.
 1.1.2.10 29-May-2002  nathanw #include <sys/sa.h> before <sys/syscallargs.h>, to provide sa_upcall_t
now that <sys/param.h> doesn't include <sys/sa.h>.

(Behold the Power of Ed)
 1.1.2.9 17-Apr-2002  nathanw Catch up to -current.
 1.1.2.8 28-Feb-2002  nathanw Catch up to -current.
 1.1.2.7 08-Jan-2002  nathanw Catch up to -current.
 1.1.2.6 06-Dec-2001  wdk struct proc -> struct lwp changes for COMPAT_LINUX support on Mips
processors.
 1.1.2.5 14-Nov-2001  nathanw Catch up to -current.
 1.1.2.4 22-Oct-2001  nathanw Catch up to -current.
 1.1.2.3 08-Oct-2001  nathanw Catch up to -current.
 1.1.2.2 26-Sep-2001  nathanw Catch up to -current.
Again.
 1.1.2.1 22-Sep-2001  nathanw file linux_machdep.c was added on branch nathanw_sa on 2001-09-26 19:54:46 +0000
 1.2.2.3 11-Oct-2001  fvdl Catch up with -current. Fix some bogons in the sparc64 kbd/ms
attach code. cd18xx conversion provided by mrg.
 1.2.2.2 01-Oct-2001  fvdl Catch up with -current.
 1.2.2.1 30-Sep-2001  fvdl file linux_machdep.c was added on branch thorpej-devvp on 2001-10-01 12:43:38 +0000
 1.9.2.6 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.9.2.5 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.9.2.4 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.9.2.3 16-Mar-2002  jdolecek Catch up with -current.
 1.9.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.9.2.1 20-Nov-2001  thorpej file linux_machdep.c was added on branch kqueue on 2002-01-10 19:51:33 +0000
 1.13.2.2 15-Jul-2002  gehenna catch up with -current.
 1.13.2.1 30-May-2002  gehenna Catch up with -current.
 1.17.2.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.17.2.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.17.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.17.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.17.2.1 03-Aug-2004  skrll Sync with HEAD
 1.20.2.1 22-Jun-2004  tron Pull up revision 1.21 (requested by manu in ticket #519):
Build COMPAT_LINUX again on mips after the siginfo change.
 1.21.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.21.4.1 29-Apr-2005  kent sync with -current
 1.23.2.7 21-Jan-2008  yamt sync with head
 1.23.2.6 15-Nov-2007  yamt sync with head.
 1.23.2.5 27-Oct-2007  yamt sync with head.
 1.23.2.4 03-Sep-2007  yamt sync with head.
 1.23.2.3 26-Feb-2007  yamt sync with head.
 1.23.2.2 30-Dec-2006  yamt sync with head.
 1.23.2.1 21-Jun-2006  yamt sync with head.
 1.24.12.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.24.10.2 10-Mar-2006  elad generic_authorize() -> kauth_authorize_generic().
 1.24.10.1 08-Mar-2006  elad Adapt to kernel authorization KPI.
 1.24.8.2 11-Aug-2006  yamt sync with head
 1.24.8.1 24-May-2006  yamt sync with head.
 1.24.6.1 01-Jun-2006  kardel Sync with head.
 1.24.4.1 09-Sep-2006  rpaulo sync with head
 1.27.4.3 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.27.4.2 27-Jan-2007  ad More compat changes.
 1.27.4.1 12-Jan-2007  ad Sync with head.
 1.29.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.30.4.1 11-Jul-2007  mjf Sync with head.
 1.30.2.2 23-Oct-2007  ad Sync with head.
 1.30.2.1 15-Jul-2007  ad Sync with head.
 1.31.12.2 13-Nov-2007  bouyer Sync with HEAD
 1.31.12.1 25-Oct-2007  bouyer Sync with HEAD.
 1.31.8.3 23-Mar-2008  matt sync with HEAD
 1.31.8.2 09-Jan-2008  matt sync with HEAD
 1.31.8.1 06-Nov-2007  matt sync with HEAD
 1.31.6.3 09-Dec-2007  jmcneill Sync with HEAD.
 1.31.6.2 11-Nov-2007  joerg Sync with HEAD.
 1.31.6.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.32.2.3 18-Feb-2008  mjf Sync with HEAD.
 1.32.2.2 27-Dec-2007  mjf Sync with HEAD.
 1.32.2.1 19-Nov-2007  mjf Sync with HEAD.
 1.33.2.1 26-Dec-2007  ad Sync with head.
 1.34.4.2 10-Jan-2008  bouyer Sync with HEAD
 1.34.4.1 02-Jan-2008  bouyer Sync with HEAD
 1.36.8.1 18-May-2008  yamt sync with head.
 1.36.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.37.2.3 11-Aug-2010  yamt sync with head.
 1.37.2.2 11-Mar-2010  yamt sync with head
 1.37.2.1 16-May-2008  yamt sync with head.
 1.38.18.1 21-Aug-2009  matt Adapt to mips changes. Use PRIx*
 1.38.2.3 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.38.2.2 14-May-2008  wrstuden Per discussion with ad, remove most of the #include <sys/sa.h> lines
as they were including sa.h just for the type(s) needed for syscallargs.h.

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

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

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

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

Also, kern_sa.c has received partial cleanup. There's still more
to do, though.
 1.40.4.1 05-Mar-2011  rmind sync with head
 1.40.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.41.4.1 05-Mar-2011  bouyer Sync with HEAD
 1.41.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.42.30.1 17-Jan-2015  martin Pull up following revision(s) (requested by maxv in ticket #427):
sys/compat/svr4/svr4_schedctl.c: revision 1.8
sys/netinet/tcp_timer.c: revision 1.88
sys/miscfs/genfs/layer_vfsops.c: revision 1.45
sys/compat/svr4/svr4_ioctl.c: revision 1.37
sys/ufs/chfs/chfs_vfsops.c: revision 1.14
sys/miscfs/fdesc/fdesc_vfsops.c: revision 1.91
sys/compat/linux/arch/i386/linux_ptrace.c: revision 1.30
sys/compat/common/kern_time_50.c: revision 1.28
sys/netinet6/ip6_forward.c: revision 1.74
sys/miscfs/umapfs/umap_vnops.c: revision 1.57
sys/compat/svr4/svr4_fcntl.c: revision 1.74
distrib/sets/lists/comp/mi: revision 1.1931
sys/netinet6/udp6_output.c: revision 1.46
sys/fs/puffs/puffs_compat.c: revision 1.3
sys/fs/udf/udf_rename.c: revision 1.11
sys/compat/svr4/svr4_filio.c: revision 1.24
sys/fs/udf/udf_rename.c: revision 1.12
sys/netinet/tcp_usrreq.c: revision 1.202
sys/miscfs/umapfs/umap_subr.c: revision 1.29
sys/compat/linux/common/linux_fadvise64.c: revision 1.3
sys/netinet/if_atm.c: revision 1.34
sys/miscfs/procfs/procfs_subr.c: revision 1.106
sys/miscfs/genfs/layer_subr.c: revision 1.37
sys/netinet/tcp_sack.c: revision 1.30
sys/compat/freebsd/freebsd_misc.c: revision 1.33
sys/compat/freebsd/freebsd_file.c: revision 1.33
sys/ufs/chfs/chfs_vnode.c: revision 1.12
sys/compat/svr4/svr4_ttold.c: revision 1.34
sys/compat/linux/common/linux_file.c: revision 1.114
sys/compat/linux/arch/mips/linux_machdep.c: revision 1.43
sys/compat/linux/common/linux_signal.c: revision 1.76
sys/compat/common/compat_util.c: revision 1.46
sys/compat/linux/arch/arm/linux_ptrace.c: revision 1.18
sys/compat/svr4/svr4_sockio.c: revision 1.36
sys/compat/linux/arch/arm/linux_machdep.c: revision 1.32
sys/compat/svr4/svr4_signal.c: revision 1.66
sys/kern/kern_exec.c: revision 1.410
sys/fs/puffs/puffs_vfsops.c: revision 1.115
sys/compat/svr4/svr4_exec_elf64.c: revision 1.15
sys/compat/linux/arch/i386/linux_machdep.c: revision 1.159
sys/compat/linux/arch/alpha/linux_machdep.c: revision 1.50
sys/compat/linux32/common/linux32_misc.c: revision 1.24
sys/netinet/in_pcb.c: revision 1.153
sys/sys/malloc.h: revision 1.116
sys/compat/common/if_43.c: revision 1.9
share/man/man9/Makefile: revision 1.380
sys/netinet/tcp_vtw.c: revision 1.12
sys/miscfs/umapfs/umap_vfsops.c: revision 1.95
sys/ufs/ext2fs/ext2fs_vfsops.c: revision 1.186
sys/compat/common/uipc_syscalls_43.c: revision 1.46
sys/ufs/ext2fs/ext2fs_vnops.c: revision 1.115
sys/fs/puffs/puffs_msgif.c: revision 1.97
sys/compat/svr4/svr4_ipc.c: revision 1.27
sys/compat/linux/common/linux_exec.c: revision 1.117
sys/ufs/ext2fs/ext2fs_readwrite.c: revision 1.66
sys/netinet/tcp_output.c: revision 1.179
sys/compat/svr4/svr4_termios.c: revision 1.28
sys/fs/udf/udf_strat_bootstrap.c: revision 1.4
sys/fs/puffs/puffs_subr.c: revision 1.67
sys/fs/puffs/puffs_node.c: revision 1.36
sys/miscfs/overlay/overlay_vnops.c: revision 1.21
sys/fs/cd9660/cd9660_node.c: revision 1.34
sys/netinet/raw_ip.c: revision 1.146
sys/sys/mallocvar.h: revision 1.13
sys/miscfs/overlay/overlay_vfsops.c: revision 1.63
share/man/man9/malloc.9: revision 1.50
sys/netinet6/dest6.c: revision 1.18
sys/compat/linux/common/linux_uselib.c: revision 1.33
sys/compat/linux/common/linux_socket.c: revision 1.120
share/man/man9/malloc.9: revision 1.51
sys/netinet/tcp_subr.c: revision 1.257
sys/compat/linux/common/linux_socketcall.c: revision 1.45
sys/compat/linux/common/linux_fadvise64_64.c: revision 1.3
sys/compat/freebsd/freebsd_ipc.c: revision 1.17
sys/compat/linux/common/linux_misc_notalpha.c: revision 1.109
sys/compat/linux/arch/alpha/linux_pipe.c: revision 1.17
sys/netinet6/in6_pcb.c: revision 1.132
sys/netinet6/in6_ifattach.c: revision 1.94
sys/compat/svr4/svr4_exec_elf32.c: revision 1.15
sys/miscfs/nullfs/null_vfsops.c: revision 1.90
sys/fs/cd9660/cd9660_util.c: revision 1.12
sys/compat/linux/arch/powerpc/linux_machdep.c: revision 1.48
sys/compat/freebsd/freebsd_exec_elf32.c: revision 1.20
sys/miscfs/procfs/procfs_vfsops.c: revision 1.94
sys/compat/linux/arch/powerpc/linux_ptrace.c: revision 1.28
sys/compat/linux/common/linux_sched.c: revision 1.67
sys/compat/linux/common/linux_exec_aout.c: revision 1.67
sys/compat/linux/common/linux_pipe.c: revision 1.67
sys/compat/linux/common/linux_llseek.c: revision 1.34
sys/compat/linux/arch/mips/linux_ptrace.c: revision 1.10
Do not uselessly include <sys/malloc.h>.
Cleanup:
- remove struct kmembuckets (dead)
- correctly deadify MALLOC_XX
- remove MALLOC_DEFINE_LIMIT and MALLOC_JUSTDEFINE_LIMIT (dead)
- remove malloc_roundup(), malloc_type_setlimit(), MALLOC_DEFINE_LIMIT()
and MALLOC_JUSTDEFINE_LIMIT() from man 9 malloc
New sentence, new line. Bump date for previous.
Obsolete malloc_roundup(9), malloc_type_setlimit(9) and MALLOC_DEFINE_LIMIT(9)
man pages.
 1.42.14.1 03-Dec-2017  jdolecek update from HEAD
 1.43.24.1 03-Aug-2022  martin Pull up following revision(s), all via patch
(requested by riastradh in ticket #1487):

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

sys/compat: Memset zero before copyout.

Just in case of uninitialized padding which would lead to kernel
stack disclosure. If the compiler can prove the memset redundant
then it can optimize it away; otherwise better safe than sorry.
 1.43.12.1 21-Jun-2023  martin Pull up following revision(s) (requested by riastradh in ticket #1836):

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

sys/compat: Memset zero before copyout.

Just in case of uninitialized padding which would lead to kernel
stack disclosure. If the compiler can prove the memset redundant
then it can optimize it away; otherwise better safe than sorry.
 1.11 20-Feb-2011  matt Deal with differences in signal delivery between o32/n32/n64.
 1.10 12-Nov-2008  ad branches: 1.10.8; 1.10.10; 1.10.12;
Remove LKMs and switch to the module framework, pass 1.

Proposed on tech-kern@.
 1.9 28-Apr-2008  martin branches: 1.9.6; 1.9.8;
Remove clause 3 and 4 from TNF licenses
 1.8 04-Dec-2007  dsl branches: 1.8.12; 1.8.14; 1.8.16;
Remove all the __P
 1.7 11-Nov-2005  chs branches: 1.7.46; 1.7.48; 1.7.54; 1.7.58;
include additional headers that are now needed.
 1.6 26-Feb-2005  perry branches: 1.6.4;
nuke trailing whitespace
 1.5 15-Feb-2002  christos branches: 1.5.16; 1.5.24; 1.5.26;
- add a real linux_sys___sysctl because the mib numbers are different.
implement only the kernel version getting entries.
- make the signal conversion functions consistent; dest is arg 1.
- make linux_fakedev deal with block and char devices differently.
- add linux_sys_ugetrlimit, and flesh out the regular get/setrlimit so
that they work properly.
- add linux_mmap2 [untested].
- bump kernel to 2.4.18, and make the date be valentine's day :-)
- linux_sys_*stat64 family was totally busted. Fix it.

tested only on i386.

Status:
gdb, telnet, work
jdk-1.4.0 extractor works, jdk still coredumps.

christos
 1.4 30-Sep-2001  manu Implements parts of sysmips() and fctnl64() emulation
 1.3 22-Sep-2001  manu Fixed errors in header files
 1.2 02-Sep-2001  manu branches: 1.2.2; 1.2.4; 1.2.6;
Added 64 bits support in header files.
All headers should be common to 32 bits MIPS and 64 bits MIPS now.
 1.1 26-Aug-2001  manu Preliminary work on Linux/mips compatibility. More to come soon...
 1.2.6.5 28-Feb-2002  nathanw Catch up to -current.
 1.2.6.4 08-Oct-2001  nathanw Catch up to -current.
 1.2.6.3 26-Sep-2001  nathanw Catch up to -current.
Again.
 1.2.6.2 21-Sep-2001  nathanw Catch up to -current.
 1.2.6.1 02-Sep-2001  nathanw file linux_machdep.h was added on branch nathanw_sa on 2001-09-21 22:35:16 +0000
 1.2.4.4 16-Mar-2002  jdolecek Catch up with -current.
 1.2.4.3 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2.4.2 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.2.4.1 02-Sep-2001  thorpej file linux_machdep.h was added on branch kqueue on 2001-09-13 01:15:19 +0000
 1.2.2.1 01-Oct-2001  fvdl Catch up with -current.
 1.5.26.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.5.24.1 29-Apr-2005  kent sync with -current
 1.5.16.2 11-Dec-2005  christos Sync with head.
 1.5.16.1 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.6.4.2 07-Dec-2007  yamt sync with head
 1.6.4.1 21-Jun-2006  yamt sync with head.
 1.7.58.1 08-Dec-2007  ad Sync with head.
 1.7.54.1 08-Dec-2007  mjf Sync with HEAD.
 1.7.48.1 09-Jan-2008  matt sync with HEAD
 1.7.46.1 09-Dec-2007  jmcneill Sync with HEAD.
 1.8.16.2 04-May-2009  yamt sync with head.
 1.8.16.1 16-May-2008  yamt sync with head.
 1.8.14.1 18-May-2008  yamt sync with head.
 1.8.12.2 17-Jan-2009  mjf Sync with HEAD.
 1.8.12.1 02-Jun-2008  mjf Sync with HEAD.
 1.9.8.1 19-Jan-2009  skrll Sync with HEAD.
 1.9.6.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.10.12.1 05-Mar-2011  bouyer Sync with HEAD
 1.10.10.1 06-Jun-2011  jruoho Sync with HEAD.
 1.10.8.1 05-Mar-2011  rmind sync with head
 1.9 14-Mar-2015  njoly Support Linux MAP_LOCKED mmap flag.
 1.8 28-Apr-2008  martin branches: 1.8.44; 1.8.64;
Remove clause 3 and 4 from TNF licenses
 1.7 11-Dec-2005  christos branches: 1.7.70; 1.7.72; 1.7.74;
merge ktrace-lwp.
 1.6 26-Feb-2005  perry nuke trailing whitespace
 1.5 28-Aug-2004  jdolecek branches: 1.5.4; 1.5.6;
g/c LINUX_MAP_IGNMASK define - it's not used anywhere
 1.4 22-Sep-2001  manu branches: 1.4.18;
Fixed errors in header files
 1.3 02-Sep-2001  manu branches: 1.3.2;
Added some comments
 1.2 26-Aug-2001  manu Preliminary work on Linux/mips compatibility, more to come soon...
 1.1 30-Sep-1998  erh branches: 1.1.24; 1.1.26;
Stubs for future development of linux compat architechtures.
 1.1.26.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.26.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.1.24.2 26-Sep-2001  nathanw Catch up to -current.
Again.
 1.1.24.1 21-Sep-2001  nathanw Catch up to -current.
 1.3.2.1 01-Oct-2001  fvdl Catch up with -current.
 1.4.18.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.4.18.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.18.2 18-Sep-2004  skrll Sync with HEAD.
 1.4.18.1 03-Sep-2004  skrll Sync with HEAD
 1.5.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.5.4.1 29-Apr-2005  kent sync with -current
 1.7.74.1 16-May-2008  yamt sync with head.
 1.7.72.1 18-May-2008  yamt sync with head.
 1.7.70.1 02-Jun-2008  mjf Sync with HEAD.
 1.8.64.1 06-Apr-2015  skrll Sync with HEAD
 1.8.44.1 03-Dec-2017  jdolecek update from HEAD
 1.10 09-Nov-2014  maxv Do not uselessly include <sys/malloc.h>.
 1.9 12-Nov-2008  ad branches: 1.9.26; 1.9.42;
Remove LKMs and switch to the module framework, pass 1.

Proposed on tech-kern@.
 1.8 28-Apr-2008  martin branches: 1.8.2; 1.8.6; 1.8.8;
Remove clause 3 and 4 from TNF licenses
 1.7 20-Dec-2007  dsl branches: 1.7.6; 1.7.8; 1.7.10;
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.6 09-Feb-2007  ad branches: 1.6.20; 1.6.28; 1.6.32;
Merge newlock2 to head.
 1.5 30-Aug-2006  matt branches: 1.5.2;
Update to deal with options PTRACE
 1.4 18-Jan-2003  thorpej branches: 1.4.18; 1.4.32; 1.4.36;
Merge the nathanw_sa branch.
 1.3 15-Nov-2001  lukem branches: 1.3.2;
don't need <sys/types.h> when including <sys/param.h>
 1.2 13-Nov-2001  lukem add RCSIDs (including regeneration of files as appropriate)
 1.1 22-Sep-2001  manu branches: 1.1.2; 1.1.4;
Initial support for running Linux binaries on the Mips. Both static and
dynamic binaries work on 32 bit mips. Signals are completely broken yet,
and ptrace is not supported.
 1.1.4.2 01-Oct-2001  fvdl Catch up with -current.
 1.1.4.1 22-Sep-2001  fvdl file linux_ptrace.c was added on branch thorpej-devvp on 2001-10-01 12:43:38 +0000
 1.1.2.6 29-May-2002  nathanw #include <sys/sa.h> before <sys/syscallargs.h>, to provide sa_upcall_t
now that <sys/param.h> doesn't include <sys/sa.h>.

(Behold the Power of Ed)
 1.1.2.5 08-Jan-2002  nathanw Catch up to -current.
 1.1.2.4 06-Dec-2001  wdk struct proc -> struct lwp changes for COMPAT_LINUX support on Mips
processors.
 1.1.2.3 14-Nov-2001  nathanw Catch up to -current.
 1.1.2.2 26-Sep-2001  nathanw Catch up to -current.
Again.
 1.1.2.1 22-Sep-2001  nathanw file linux_ptrace.c was added on branch nathanw_sa on 2001-09-26 19:54:47 +0000
 1.3.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.3.2.1 15-Nov-2001  thorpej file linux_ptrace.c was added on branch kqueue on 2002-01-10 19:51:34 +0000
 1.4.36.1 03-Sep-2006  yamt sync with head.
 1.4.32.1 09-Sep-2006  rpaulo sync with head
 1.4.18.3 21-Jan-2008  yamt sync with head
 1.4.18.2 26-Feb-2007  yamt sync with head.
 1.4.18.1 30-Dec-2006  yamt sync with head.
 1.5.2.1 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.6.32.1 02-Jan-2008  bouyer Sync with HEAD
 1.6.28.1 26-Dec-2007  ad Sync with head.
 1.6.20.1 09-Jan-2008  matt sync with HEAD
 1.7.10.2 04-May-2009  yamt sync with head.
 1.7.10.1 16-May-2008  yamt sync with head.
 1.7.8.1 18-May-2008  yamt sync with head.
 1.7.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.7.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.8.8.1 19-Jan-2009  skrll Sync with HEAD.
 1.8.6.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.8.2.2 14-May-2008  wrstuden Per discussion with ad, remove most of the #include <sys/sa.h> lines
as they were including sa.h just for the type(s) needed for syscallargs.h.

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

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

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

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

Also, kern_sa.c has received partial cleanup. There's still more
to do, though.
 1.9.42.1 17-Jan-2015  martin Pull up following revision(s) (requested by maxv in ticket #427):
sys/compat/svr4/svr4_schedctl.c: revision 1.8
sys/netinet/tcp_timer.c: revision 1.88
sys/miscfs/genfs/layer_vfsops.c: revision 1.45
sys/compat/svr4/svr4_ioctl.c: revision 1.37
sys/ufs/chfs/chfs_vfsops.c: revision 1.14
sys/miscfs/fdesc/fdesc_vfsops.c: revision 1.91
sys/compat/linux/arch/i386/linux_ptrace.c: revision 1.30
sys/compat/common/kern_time_50.c: revision 1.28
sys/netinet6/ip6_forward.c: revision 1.74
sys/miscfs/umapfs/umap_vnops.c: revision 1.57
sys/compat/svr4/svr4_fcntl.c: revision 1.74
distrib/sets/lists/comp/mi: revision 1.1931
sys/netinet6/udp6_output.c: revision 1.46
sys/fs/puffs/puffs_compat.c: revision 1.3
sys/fs/udf/udf_rename.c: revision 1.11
sys/compat/svr4/svr4_filio.c: revision 1.24
sys/fs/udf/udf_rename.c: revision 1.12
sys/netinet/tcp_usrreq.c: revision 1.202
sys/miscfs/umapfs/umap_subr.c: revision 1.29
sys/compat/linux/common/linux_fadvise64.c: revision 1.3
sys/netinet/if_atm.c: revision 1.34
sys/miscfs/procfs/procfs_subr.c: revision 1.106
sys/miscfs/genfs/layer_subr.c: revision 1.37
sys/netinet/tcp_sack.c: revision 1.30
sys/compat/freebsd/freebsd_misc.c: revision 1.33
sys/compat/freebsd/freebsd_file.c: revision 1.33
sys/ufs/chfs/chfs_vnode.c: revision 1.12
sys/compat/svr4/svr4_ttold.c: revision 1.34
sys/compat/linux/common/linux_file.c: revision 1.114
sys/compat/linux/arch/mips/linux_machdep.c: revision 1.43
sys/compat/linux/common/linux_signal.c: revision 1.76
sys/compat/common/compat_util.c: revision 1.46
sys/compat/linux/arch/arm/linux_ptrace.c: revision 1.18
sys/compat/svr4/svr4_sockio.c: revision 1.36
sys/compat/linux/arch/arm/linux_machdep.c: revision 1.32
sys/compat/svr4/svr4_signal.c: revision 1.66
sys/kern/kern_exec.c: revision 1.410
sys/fs/puffs/puffs_vfsops.c: revision 1.115
sys/compat/svr4/svr4_exec_elf64.c: revision 1.15
sys/compat/linux/arch/i386/linux_machdep.c: revision 1.159
sys/compat/linux/arch/alpha/linux_machdep.c: revision 1.50
sys/compat/linux32/common/linux32_misc.c: revision 1.24
sys/netinet/in_pcb.c: revision 1.153
sys/sys/malloc.h: revision 1.116
sys/compat/common/if_43.c: revision 1.9
share/man/man9/Makefile: revision 1.380
sys/netinet/tcp_vtw.c: revision 1.12
sys/miscfs/umapfs/umap_vfsops.c: revision 1.95
sys/ufs/ext2fs/ext2fs_vfsops.c: revision 1.186
sys/compat/common/uipc_syscalls_43.c: revision 1.46
sys/ufs/ext2fs/ext2fs_vnops.c: revision 1.115
sys/fs/puffs/puffs_msgif.c: revision 1.97
sys/compat/svr4/svr4_ipc.c: revision 1.27
sys/compat/linux/common/linux_exec.c: revision 1.117
sys/ufs/ext2fs/ext2fs_readwrite.c: revision 1.66
sys/netinet/tcp_output.c: revision 1.179
sys/compat/svr4/svr4_termios.c: revision 1.28
sys/fs/udf/udf_strat_bootstrap.c: revision 1.4
sys/fs/puffs/puffs_subr.c: revision 1.67
sys/fs/puffs/puffs_node.c: revision 1.36
sys/miscfs/overlay/overlay_vnops.c: revision 1.21
sys/fs/cd9660/cd9660_node.c: revision 1.34
sys/netinet/raw_ip.c: revision 1.146
sys/sys/mallocvar.h: revision 1.13
sys/miscfs/overlay/overlay_vfsops.c: revision 1.63
share/man/man9/malloc.9: revision 1.50
sys/netinet6/dest6.c: revision 1.18
sys/compat/linux/common/linux_uselib.c: revision 1.33
sys/compat/linux/common/linux_socket.c: revision 1.120
share/man/man9/malloc.9: revision 1.51
sys/netinet/tcp_subr.c: revision 1.257
sys/compat/linux/common/linux_socketcall.c: revision 1.45
sys/compat/linux/common/linux_fadvise64_64.c: revision 1.3
sys/compat/freebsd/freebsd_ipc.c: revision 1.17
sys/compat/linux/common/linux_misc_notalpha.c: revision 1.109
sys/compat/linux/arch/alpha/linux_pipe.c: revision 1.17
sys/netinet6/in6_pcb.c: revision 1.132
sys/netinet6/in6_ifattach.c: revision 1.94
sys/compat/svr4/svr4_exec_elf32.c: revision 1.15
sys/miscfs/nullfs/null_vfsops.c: revision 1.90
sys/fs/cd9660/cd9660_util.c: revision 1.12
sys/compat/linux/arch/powerpc/linux_machdep.c: revision 1.48
sys/compat/freebsd/freebsd_exec_elf32.c: revision 1.20
sys/miscfs/procfs/procfs_vfsops.c: revision 1.94
sys/compat/linux/arch/powerpc/linux_ptrace.c: revision 1.28
sys/compat/linux/common/linux_sched.c: revision 1.67
sys/compat/linux/common/linux_exec_aout.c: revision 1.67
sys/compat/linux/common/linux_pipe.c: revision 1.67
sys/compat/linux/common/linux_llseek.c: revision 1.34
sys/compat/linux/arch/mips/linux_ptrace.c: revision 1.10
Do not uselessly include <sys/malloc.h>.
Cleanup:
- remove struct kmembuckets (dead)
- correctly deadify MALLOC_XX
- remove MALLOC_DEFINE_LIMIT and MALLOC_JUSTDEFINE_LIMIT (dead)
- remove malloc_roundup(), malloc_type_setlimit(), MALLOC_DEFINE_LIMIT()
and MALLOC_JUSTDEFINE_LIMIT() from man 9 malloc
New sentence, new line. Bump date for previous.
Obsolete malloc_roundup(9), malloc_type_setlimit(9) and MALLOC_DEFINE_LIMIT(9)
man pages.
 1.9.26.1 03-Dec-2017  jdolecek update from HEAD
 1.8 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.7 11-Dec-2005  christos branches: 1.7.70; 1.7.72; 1.7.74;
merge ktrace-lwp.
 1.6 26-Feb-2005  perry nuke trailing whitespace
 1.5 31-Mar-2002  christos branches: 1.5.10; 1.5.18; 1.5.20;
bring the reverse signal mapping array into linux_signo.c
 1.4 31-Mar-2002  christos make signal array handling uniform, and put signal arrays in a separate
file. This is simular to errno array handling.
 1.3 13-Nov-2001  lukem add RCSIDs (including regeneration of files as appropriate)
 1.2 02-Sep-2001  manu branches: 1.2.4; 1.2.6;
Added some comments
 1.1 26-Aug-2001  manu Preliminary work on Linux/mips compatibility, more to come soon...
 1.2.6.4 17-Apr-2002  nathanw Catch up to -current.
 1.2.6.3 14-Nov-2001  nathanw Catch up to -current.
 1.2.6.2 21-Sep-2001  nathanw Catch up to -current.
 1.2.6.1 02-Sep-2001  nathanw file linux_sigarray.c was added on branch nathanw_sa on 2001-09-21 22:35:16 +0000
 1.2.4.4 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.2.4.3 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2.4.2 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.2.4.1 02-Sep-2001  thorpej file linux_sigarray.c was added on branch kqueue on 2001-09-13 01:15:19 +0000
 1.5.20.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.5.18.1 29-Apr-2005  kent sync with -current
 1.5.10.1 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.7.74.1 16-May-2008  yamt sync with head.
 1.7.72.1 18-May-2008  yamt sync with head.
 1.7.70.1 02-Jun-2008  mjf Sync with HEAD.
 1.7 18-Nov-2011  christos - add sigtimedwait support.
- merge the siginfo population code.
 1.6 23-Nov-2008  njoly branches: 1.6.16;
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.5 28-Apr-2008  martin branches: 1.5.6; 1.5.8;
Remove clause 3 and 4 from TNF licenses
 1.4 11-Dec-2005  christos branches: 1.4.70; 1.4.72; 1.4.74;
merge ktrace-lwp.
 1.3 26-Feb-2005  perry nuke trailing whitespace
 1.2 02-Sep-2001  manu branches: 1.2.4; 1.2.6; 1.2.24; 1.2.32; 1.2.34;
Fixed an error in a define
 1.1 26-Aug-2001  manu Preliminary work on Linux/mips compatibility, more to come soon...
 1.2.34.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.2.32.1 29-Apr-2005  kent sync with -current
 1.2.24.1 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.2.6.2 21-Sep-2001  nathanw Catch up to -current.
 1.2.6.1 02-Sep-2001  nathanw file linux_siginfo.h was added on branch nathanw_sa on 2001-09-21 22:35:16 +0000
 1.2.4.2 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.2.4.1 02-Sep-2001  thorpej file linux_siginfo.h was added on branch kqueue on 2001-09-13 01:15:19 +0000
 1.4.74.2 04-May-2009  yamt sync with head.
 1.4.74.1 16-May-2008  yamt sync with head.
 1.4.72.1 18-May-2008  yamt sync with head.
 1.4.70.2 17-Jan-2009  mjf Sync with HEAD.
 1.4.70.1 02-Jun-2008  mjf Sync with HEAD.
 1.5.8.1 19-Jan-2009  skrll Sync with HEAD.
 1.5.6.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.6.16.1 17-Apr-2012  yamt sync with head
 1.14 14-Nov-2015  christos PR/50428: Rin Okuyama: support SA_RESTORER flag for rt_sigaction(2) in the
ports that support it.
 1.13 28-Apr-2008  martin branches: 1.13.44; 1.13.64;
Remove clause 3 and 4 from TNF licenses
 1.12 04-Dec-2007  dsl branches: 1.12.12; 1.12.14; 1.12.16;
Remove all the __P
 1.11 11-Dec-2005  christos branches: 1.11.44; 1.11.46; 1.11.52; 1.11.56;
merge ktrace-lwp.
 1.10 19-Sep-2005  christos MINSIGSTKSZ on linux is different depending on the platform and usually
smaller than ours.
 1.9 26-Feb-2005  perry branches: 1.9.4;
nuke trailing whitespace
 1.8 26-Nov-2002  christos branches: 1.8.6; 1.8.14; 1.8.16;
rename: s/sa_/<compat>sa/g
 1.7 19-Mar-2002  christos - Now that RT-signals fit, fix the array to deliver them. [i386 only].
- jdk-1.4 works perfectly now. :-)
 1.6 19-Feb-2002  rafal Add LINUX_SA_NOCLDWAIT, LINUX_SA_RESTORER, update LINUX_SA_ALLBITS. Linux
compat on mips builds again now.
 1.5 14-Oct-2001  manu Fixed some mistakes in signal handling (this is still broken)
Added some code to set linux's uname kernel version to 2.4.0 (usefull for
testing with glibc-2.2). This is currently guarded by a #if 0.
 1.4 22-Sep-2001  manu Fixed errors in header files
 1.3 02-Sep-2001  manu branches: 1.3.2; 1.3.4; 1.3.6;
Added 64 bits support in header files.
All headers should be common to 32 bits MIPS and 64 bits MIPS now.
 1.2 02-Sep-2001  manu Fixed indent problems
 1.1 26-Aug-2001  manu Preliminary work on Linux/Mips emulation, more to come soon...
 1.3.6.7 11-Dec-2002  thorpej Sync with HEAD.
 1.3.6.6 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.3.6.5 28-Feb-2002  nathanw Catch up to -current.
 1.3.6.4 22-Oct-2001  nathanw Catch up to -current.
 1.3.6.3 26-Sep-2001  nathanw Catch up to -current.
Again.
 1.3.6.2 21-Sep-2001  nathanw Catch up to -current.
 1.3.6.1 02-Sep-2001  nathanw file linux_signal.h was added on branch nathanw_sa on 2001-09-21 22:35:16 +0000
 1.3.4.5 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.3.4.4 16-Mar-2002  jdolecek Catch up with -current.
 1.3.4.3 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.3.4.2 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.3.4.1 02-Sep-2001  thorpej file linux_signal.h was added on branch kqueue on 2001-09-13 01:15:20 +0000
 1.3.2.1 01-Oct-2001  fvdl Catch up with -current.
 1.8.16.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.8.14.1 29-Apr-2005  kent sync with -current
 1.8.6.2 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.8.6.1 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.9.4.2 07-Dec-2007  yamt sync with head
 1.9.4.1 21-Jun-2006  yamt sync with head.
 1.11.56.1 08-Dec-2007  ad Sync with head.
 1.11.52.1 08-Dec-2007  mjf Sync with HEAD.
 1.11.46.1 09-Jan-2008  matt sync with HEAD
 1.11.44.1 09-Dec-2007  jmcneill Sync with HEAD.
 1.12.16.1 16-May-2008  yamt sync with head.
 1.12.14.1 18-May-2008  yamt sync with head.
 1.12.12.1 02-Jun-2008  mjf Sync with HEAD.
 1.13.64.1 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.13.44.1 03-Dec-2017  jdolecek update from HEAD
 1.6 25-Jan-2014  njoly 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.5 28-Apr-2008  martin branches: 1.5.34; 1.5.44; 1.5.50;
Remove clause 3 and 4 from TNF licenses
 1.4 11-Dec-2005  christos branches: 1.4.70; 1.4.72; 1.4.74;
merge ktrace-lwp.
 1.3 26-Feb-2005  perry nuke trailing whitespace
 1.2 26-Jul-2003  jdolecek branches: 1.2.8; 1.2.10;
add LINUX_SO_PEERNAME, LINUX_SO_TIMESTAMP where it has been missing
fix value for LINUX_SO_DETACH_FILTER on couple places (unused anyway)

g/c LINUX_SCM_TIMESTAMP definition for some archs, it will be defined
in generic linux_socket.h
 1.1 26-Aug-2001  manu branches: 1.1.4; 1.1.6; 1.1.24;
Preliminary work on Linux/mips compat, more to come soon...
 1.1.24.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.1.24.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.24.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.24.1 03-Aug-2004  skrll Sync with HEAD
 1.1.6.2 21-Sep-2001  nathanw Catch up to -current.
 1.1.6.1 26-Aug-2001  nathanw file linux_socket.h was added on branch nathanw_sa on 2001-09-21 22:35:17 +0000
 1.1.4.2 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.1.4.1 26-Aug-2001  thorpej file linux_socket.h was added on branch kqueue on 2001-09-13 01:15:20 +0000
 1.2.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.2.8.1 29-Apr-2005  kent sync with -current
 1.4.74.1 16-May-2008  yamt sync with head.
 1.4.72.1 18-May-2008  yamt sync with head.
 1.4.70.1 02-Jun-2008  mjf Sync with HEAD.
 1.5.50.1 18-May-2014  rmind sync with head
 1.5.44.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.5.34.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.93 28-Sep-2024  christos regen
 1.92 01-Jul-2024  christos regen
 1.91 29-Jun-2024  christos branches: 1.91.2;
regen
 1.90 19-Aug-2023  christos regen
 1.89 18-Aug-2023  christos regen
 1.88 29-Jul-2023  christos regen
 1.87 28-Jul-2023  christos regen
 1.86 02-Dec-2021  ryo regen
 1.85 24-Nov-2021  ryo regen
 1.84 20-Sep-2021  thorpej Regen for preadv(2) / pwritev(2).
 1.83 20-Sep-2021  thorpej Regen for eventfd.
 1.82 19-Sep-2021  thorpej Regen for timerfd.
 1.81 19-Sep-2021  thorpej Regen for POSIX timer syscalls.
 1.80 26-Apr-2020  thorpej branches: 1.80.2;
Regen for native futex calls.
 1.79 09-Nov-2019  jdolecek regen
 1.78 10-Aug-2018  pgoyette Regen
 1.77 10-May-2017  riastradh branches: 1.77.8; 1.77.10;
regen
 1.76 09-Feb-2017  christos branches: 1.76.4;
regen
 1.75 09-Feb-2017  christos regen
 1.74 04-Feb-2017  christos regen
 1.73 03-Feb-2017  christos regen
 1.72 02-Feb-2017  christos regen
 1.71 16-Jan-2017  christos regen all
 1.70 13-Jan-2017  christos branches: 1.70.2;
regen
 1.69 02-Jan-2017  martin Regen (something apparently went wrong in previous)
 1.68 02-Jan-2017  manu Regen
 1.67 24-Jul-2016  njoly Regen for readlink/readlinkat signatures.
 1.66 27-Oct-2015  njoly branches: 1.66.2;
Regen.
 1.65 25-Oct-2015  njoly Regen for posix chown family cleanup.
 1.64 24-Sep-2015  christos regen
 1.63 07-Mar-2015  christos regen
 1.62 22-Nov-2014  njoly branches: 1.62.2;
Regen for ppoll signature fix
 1.61 31-May-2014  njoly branches: 1.61.2;
Regen for munmap(2) signature.
 1.60 29-May-2014  njoly Regen for utimes(2) change.
 1.59 20-May-2014  njoly Regen for getgroups/setgroups update.
 1.58 17-May-2014  njoly Regen for fadvise64 offset types changes.
 1.57 06-May-2014  njoly Regen for mknod device argument type change.
 1.56 04-May-2014  njoly Regen for pread/pwrite 64bit offset argument.
 1.55 08-Apr-2014  njoly Regen.
 1.54 08-Dec-2013  njoly branches: 1.54.2;
Regen.
 1.53 19-Nov-2013  chs regen
 1.52 07-Nov-2013  njoly Regen for dup/dup2/dup3 argument types fix.
 1.51 24-Sep-2013  njoly Regen for utimensat(2).
 1.50 08-Apr-2013  pooka branches: 1.50.4;
regen for utimes
 1.49 19-Sep-2012  pooka regen for ppoll (and, apparently, SYCALL_ARG_PTR)
 1.48 18-Nov-2011  christos branches: 1.48.10;
- add sigtimedwait support.
- merge the siginfo population code.
 1.47 30-May-2011  alnsn branches: 1.47.4;
Regenerate files to pick up correct RCS Ids. Suggested by Chris Badura.
 1.46 30-May-2011  alnsn Add fadvise64 and fadvise64_64 syscalls to compat_linux and compat_linux32.
 1.45 15-Apr-2011  he Regenerate these files after adding pipe2() and dup3().
 1.44 20-Feb-2011  matt Regen.
 1.43 07-Jul-2010  chs branches: 1.43.2; 1.43.4;
regen
 1.42 14-Dec-2009  matt branches: 1.42.2; 1.42.4;
Regen (new makesyscalls.sh)
 1.41 24-Nov-2009  njoly Regen for personality(2) update.
 1.40 17-Jun-2009  njoly Regen for sendmsg/recvmsg definitions update.
 1.39 08-Jun-2009  njoly Regen for rt_queueinfo(2) update.
 1.38 17-Jan-2009  njoly branches: 1.38.2;
Regen for wait4 update.
 1.37 15-Jan-2009  njoly Rengen for compat50 update.
 1.36 13-Jan-2009  pooka Regen to prove I didn't screw up the conversion: purely RCSID changes.
 1.35 19-Nov-2008  ad Regen.
 1.34 12-Nov-2008  njoly Regen for nanosleep(2) fix.
 1.33 23-Apr-2008  ad branches: 1.33.2; 1.33.4; 1.33.8; 1.33.10; 1.33.12;
Regen.
 1.32 04-Apr-2008  njoly branches: 1.32.2;
Regen for linux_sys_msync removal.
 1.31 24-Dec-2007  njoly branches: 1.31.6;
Regen for linux_sys_getpgid removal.
 1.30 21-Dec-2007  njoly Regen for getfsuid/setfsgid syscall exchange.
 1.29 20-Dec-2007  dsl regen
 1.28 16-Nov-2007  njoly branches: 1.28.2; 1.28.6;
Regen, for syscalls cleanup.
 1.27 04-Mar-2007  christos branches: 1.27.14; 1.27.16; 1.27.20; 1.27.22;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.26 10-Jun-2006  christos branches: 1.26.12;
regen
 1.25 11-Dec-2005  christos branches: 1.25.4; 1.25.8; 1.25.14;
merge ktrace-lwp.
 1.24 16-May-2005  fvdl branches: 1.24.2;
Regen.
 1.23 16-May-2005  fvdl Regen.
 1.22 26-Feb-2005  perry regen
 1.21 26-Feb-2005  perry regen
 1.20 20-Sep-2004  jdolecek branches: 1.20.4; 1.20.6;
regen:
implement support for Linux statfs64() syscall - 64bit variant of statfs()
 1.19 08-Sep-2004  jdolecek regen: add exit_group(2)
 1.18 01-Aug-2004  jdolecek regen - sync syscall lists with Linux kernel 2.6.7
 1.17 01-Aug-2004  jdolecek regen:

connect madvise(2) and mincore(2) - apparently the newer Linux libs
don't stub it anymore, so allow the application to take advantage
of them

the Linux calls appear to be compatible in the flag values and semantics,
so a wrapper is not necessary
 1.16 10-Aug-2003  jdolecek regen - added wrapper for Linux ftruncate64()
 1.15 23-Jun-2003  christos branches: 1.15.2;
Regen.
 1.14 18-Jan-2003  thorpej Regen for correct RCS ID.
 1.13 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.12 01-Nov-2002  jdolecek nsysent set to 256, and use linux_sys_nosys()
 1.11 10-Apr-2002  christos branches: 1.11.4;
regen
 1.10 22-Mar-2002  christos regen
 1.9 18-Feb-2002  rafal Regen: Use linux_sys_{g,s}setrlimit, remove linux_sys_ugetrlimit since
linux/mips doesn't seem to have one.
 1.8 15-Feb-2002  christos Regen
 1.7 15-Feb-2002  christos - add a real linux_sys___sysctl because the mib numbers are different.
implement only the kernel version getting entries.
- make the signal conversion functions consistent; dest is arg 1.
- make linux_fakedev deal with block and char devices differently.
- add linux_sys_ugetrlimit, and flesh out the regular get/setrlimit so
that they work properly.
- add linux_mmap2 [untested].
- bump kernel to 2.4.18, and make the date be valentine's day :-)
- linux_sys_*stat64 family was totally busted. Fix it.

tested only on i386.

Status:
gdb, telnet, work
jdk-1.4.0 extractor works, jdk still coredumps.

christos
 1.6 20-Nov-2001  manu branches: 1.6.2;
Fixed the Linux signal trampoline and linux_sys_sigreturn(). Linux signal
delivery now seems fully functionnal.
 1.5 13-Nov-2001  lukem add RCSIDs (including regeneration of files as appropriate)
 1.4 14-Oct-2001  manu Fixed some mistakes in signal handling (this is still broken)
Added some code to set linux's uname kernel version to 2.4.0 (usefull for
testing with glibc-2.2). This is currently guarded by a #if 0.
 1.3 06-Oct-2001  manu Added socket operations to Linux Mips emulation
 1.2 30-Sep-2001  manu branches: 1.2.2;
Implements parts of sysmips() and fctnl64() emulation
 1.1 22-Sep-2001  manu branches: 1.1.2;
More work on Linux compat for Mips: system calls mapping.
 1.1.2.11 11-Nov-2002  nathanw Catch up to -current
 1.1.2.10 29-May-2002  nathanw Regen.
 1.1.2.9 17-Apr-2002  nathanw Catch up to -current.
 1.1.2.8 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.1.2.7 28-Feb-2002  nathanw Catch up to -current.
 1.1.2.6 08-Jan-2002  nathanw Catch up to -current.
 1.1.2.5 06-Dec-2001  wdk struct proc -> struct lwp changes for COMPAT_LINUX support on Mips
processors.
 1.1.2.4 22-Oct-2001  nathanw Catch up to -current.
 1.1.2.3 08-Oct-2001  nathanw Catch up to -current.
 1.1.2.2 26-Sep-2001  nathanw Catch up to -current.
Again.
 1.1.2.1 22-Sep-2001  nathanw file linux_syscall.h was added on branch nathanw_sa on 2001-09-26 19:54:47 +0000
 1.2.2.3 11-Oct-2001  fvdl Catch up with -current. Fix some bogons in the sparc64 kbd/ms
attach code. cd18xx conversion provided by mrg.
 1.2.2.2 01-Oct-2001  fvdl Catch up with -current.
 1.2.2.1 30-Sep-2001  fvdl file linux_syscall.h was added on branch thorpej-devvp on 2001-10-01 12:43:39 +0000
 1.6.2.4 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.6.2.3 16-Mar-2002  jdolecek Catch up with -current.
 1.6.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.6.2.1 20-Nov-2001  thorpej file linux_syscall.h was added on branch kqueue on 2002-01-10 19:51:34 +0000
 1.11.4.3 14-Jun-2004  jmc Regen for changes in ticket #1708
 1.11.4.2 11-May-2004  tron Regen for ticket 1686.
 1.11.4.1 22-Oct-2003  jmc Regen files (requested by tv in ticket #1427)

Proper support for mmap2
 1.15.2.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.15.2.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.15.2.4 24-Sep-2004  skrll Sync with HEAD.
 1.15.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.15.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.15.2.1 03-Aug-2004  skrll Sync with HEAD
 1.20.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.20.4.1 29-Apr-2005  kent sync with -current
 1.24.2.4 21-Jan-2008  yamt sync with head
 1.24.2.3 07-Dec-2007  yamt sync with head
 1.24.2.2 03-Sep-2007  yamt sync with head.
 1.24.2.1 21-Jun-2006  yamt sync with head.
 1.25.14.1 19-Jun-2006  chap Sync with head.
 1.25.8.1 26-Jun-2006  yamt sync with head.
 1.25.4.1 09-Sep-2006  rpaulo sync with head
 1.26.12.1 12-Mar-2007  rmind Sync with HEAD.
 1.27.22.2 27-Dec-2007  mjf Sync with HEAD.
 1.27.22.1 19-Nov-2007  mjf Sync with HEAD.
 1.27.20.1 18-Nov-2007  bouyer Sync with HEAD
 1.27.16.1 09-Jan-2008  matt sync with HEAD
 1.27.14.1 21-Nov-2007  joerg Sync with HEAD.
 1.28.6.1 02-Jan-2008  bouyer Sync with HEAD
 1.28.2.1 26-Dec-2007  ad Sync with head.
 1.31.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.31.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.32.2.1 18-May-2008  yamt sync with head.
 1.33.12.1 20-Nov-2008  snj Regen for ticket 81.
 1.33.10.1 19-Jan-2009  skrll Sync with HEAD.
 1.33.8.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.33.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.33.2.4 11-Aug-2010  yamt sync with head.
 1.33.2.3 11-Mar-2010  yamt sync with head
 1.33.2.2 20-Jun-2009  yamt sync with head
 1.33.2.1 04-May-2009  yamt sync with head.
 1.38.2.1 23-Jul-2009  jym Sync with HEAD.
 1.42.4.3 31-May-2011  rmind sync with head
 1.42.4.2 21-Apr-2011  rmind sync with head
 1.42.4.1 05-Mar-2011  rmind sync with head
 1.42.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.43.4.1 05-Mar-2011  bouyer Sync with HEAD
 1.43.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.47.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.47.4.2 30-Oct-2012  yamt sync with head
 1.47.4.1 17-Apr-2012  yamt sync with head
 1.48.10.4 03-Dec-2017  jdolecek update from HEAD
 1.48.10.3 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.48.10.2 23-Jun-2013  tls resync from head
 1.48.10.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.50.4.1 18-May-2014  rmind sync with head
 1.54.2.1 10-Aug-2014  tls Rebase.
 1.61.2.1 17-Apr-2017  snj regen for ticket 1354
 1.62.2.5 28-Aug-2017  skrll Sync with HEAD
 1.62.2.4 05-Feb-2017  skrll Sync with HEAD
 1.62.2.3 05-Oct-2016  skrll Sync with HEAD
 1.62.2.2 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.62.2.1 06-Apr-2015  skrll Sync with HEAD
 1.66.2.3 20-Mar-2017  pgoyette Sync with HEAD
 1.66.2.2 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.66.2.1 26-Jul-2016  pgoyette Sync with HEAD
 1.70.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.76.4.1 11-May-2017  pgoyette Sync with HEAD
 1.77.10.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.77.10.1 10-Jun-2019  christos Sync with HEAD
 1.77.8.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.80.2.2 17-Dec-2020  thorpej Regen for preadv(2) and pwritev(2).
 1.80.2.1 15-Dec-2020  thorpej Regen for eventfd, timerfd, POSIX timers.
 1.91.2.1 02-Aug-2025  perseant Sync with HEAD
 1.92 28-Sep-2024  christos regen
 1.91 01-Jul-2024  christos regen
 1.90 29-Jun-2024  christos branches: 1.90.2;
regen
 1.89 19-Aug-2023  christos regen
 1.88 18-Aug-2023  christos regen
 1.87 29-Jul-2023  christos regen
 1.86 28-Jul-2023  christos regen
 1.85 02-Dec-2021  ryo regen
 1.84 24-Nov-2021  ryo regen
 1.83 20-Sep-2021  thorpej Regen for preadv(2) / pwritev(2).
 1.82 20-Sep-2021  thorpej Regen for eventfd.
 1.81 19-Sep-2021  thorpej Regen for timerfd.
 1.80 19-Sep-2021  thorpej Regen for POSIX timer syscalls.
 1.79 26-Apr-2020  thorpej branches: 1.79.2;
Regen for native futex calls.
 1.78 09-Nov-2019  jdolecek regen
 1.77 10-Aug-2018  pgoyette Regen
 1.76 10-May-2017  riastradh branches: 1.76.8; 1.76.10;
regen
 1.75 09-Feb-2017  christos branches: 1.75.4;
regen
 1.74 09-Feb-2017  christos regen
 1.73 04-Feb-2017  christos regen
 1.72 03-Feb-2017  christos regen
 1.71 02-Feb-2017  christos regen
 1.70 16-Jan-2017  christos regen all
 1.69 13-Jan-2017  christos branches: 1.69.2;
regen
 1.68 02-Jan-2017  martin Regen (something apparently went wrong in previous)
 1.67 02-Jan-2017  manu Regen
 1.66 24-Jul-2016  njoly Regen for readlink/readlinkat signatures.
 1.65 27-Oct-2015  njoly branches: 1.65.2;
Regen.
 1.64 25-Oct-2015  njoly Regen for posix chown family cleanup.
 1.63 24-Sep-2015  christos regen
 1.62 07-Mar-2015  christos regen
 1.61 22-Nov-2014  njoly branches: 1.61.2;
Regen for ppoll signature fix
 1.60 31-May-2014  njoly branches: 1.60.2;
Regen for munmap(2) signature.
 1.59 29-May-2014  njoly Regen for utimes(2) change.
 1.58 20-May-2014  njoly Regen for getgroups/setgroups update.
 1.57 17-May-2014  njoly Regen for fadvise64 offset types changes.
 1.56 06-May-2014  njoly Regen for mknod device argument type change.
 1.55 04-May-2014  njoly Regen for pread/pwrite 64bit offset argument.
 1.54 08-Apr-2014  njoly Regen.
 1.53 08-Dec-2013  njoly branches: 1.53.2;
Regen.
 1.52 19-Nov-2013  chs regen
 1.51 07-Nov-2013  njoly Regen for dup/dup2/dup3 argument types fix.
 1.50 24-Sep-2013  njoly Regen for utimensat(2).
 1.49 08-Apr-2013  pooka branches: 1.49.4;
regen for utimes
 1.48 19-Sep-2012  pooka regen for ppoll (and, apparently, SYCALL_ARG_PTR)
 1.47 18-Nov-2011  christos branches: 1.47.10;
- add sigtimedwait support.
- merge the siginfo population code.
 1.46 30-May-2011  alnsn branches: 1.46.4;
Regenerate files to pick up correct RCS Ids. Suggested by Chris Badura.
 1.45 30-May-2011  alnsn Add fadvise64 and fadvise64_64 syscalls to compat_linux and compat_linux32.
 1.44 15-Apr-2011  he Regenerate these files after adding pipe2() and dup3().
 1.43 20-Feb-2011  matt Regen.
 1.42 07-Jul-2010  chs branches: 1.42.2; 1.42.4;
regen
 1.41 14-Dec-2009  matt branches: 1.41.2; 1.41.4;
Regen (new makesyscalls.sh)
 1.40 24-Nov-2009  njoly Regen for personality(2) update.
 1.39 17-Jun-2009  njoly Regen for sendmsg/recvmsg definitions update.
 1.38 08-Jun-2009  njoly Regen for rt_queueinfo(2) update.
 1.37 17-Jan-2009  njoly branches: 1.37.2;
Regen for wait4 update.
 1.36 15-Jan-2009  njoly Rengen for compat50 update.
 1.35 13-Jan-2009  pooka Regen to prove I didn't screw up the conversion: purely RCSID changes.
 1.34 19-Nov-2008  ad Regen.
 1.33 12-Nov-2008  njoly Regen for nanosleep(2) fix.
 1.32 23-Apr-2008  ad branches: 1.32.2; 1.32.4; 1.32.8; 1.32.10; 1.32.12;
Regen.
 1.31 04-Apr-2008  njoly branches: 1.31.2;
Regen for linux_sys_msync removal.
 1.30 24-Dec-2007  njoly branches: 1.30.6;
Regen for linux_sys_getpgid removal.
 1.29 21-Dec-2007  njoly Regen for getfsuid/setfsgid syscall exchange.
 1.28 20-Dec-2007  dsl regen
 1.27 16-Nov-2007  njoly branches: 1.27.2; 1.27.6;
Regen, for syscalls cleanup.
 1.26 04-Mar-2007  christos branches: 1.26.14; 1.26.16; 1.26.20; 1.26.22;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.25 10-Jun-2006  christos branches: 1.25.12;
regen
 1.24 11-Dec-2005  christos branches: 1.24.4; 1.24.8; 1.24.14;
merge ktrace-lwp.
 1.23 16-May-2005  fvdl branches: 1.23.2;
Regen.
 1.22 16-May-2005  fvdl Regen.
 1.21 26-Feb-2005  perry regen
 1.20 26-Feb-2005  perry regen
 1.19 20-Sep-2004  jdolecek branches: 1.19.4; 1.19.6;
regen:
implement support for Linux statfs64() syscall - 64bit variant of statfs()
 1.18 08-Sep-2004  jdolecek regen: add exit_group(2)
 1.17 01-Aug-2004  jdolecek regen - sync syscall lists with Linux kernel 2.6.7
 1.16 01-Aug-2004  jdolecek regen:

connect madvise(2) and mincore(2) - apparently the newer Linux libs
don't stub it anymore, so allow the application to take advantage
of them

the Linux calls appear to be compatible in the flag values and semantics,
so a wrapper is not necessary
 1.15 10-Aug-2003  jdolecek regen - added wrapper for Linux ftruncate64()
 1.14 23-Jun-2003  christos branches: 1.14.2;
Regen.
 1.13 18-Jan-2003  thorpej Regen for correct RCS ID.
 1.12 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.11 10-Apr-2002  christos branches: 1.11.4;
regen
 1.10 22-Mar-2002  christos regen
 1.9 18-Feb-2002  rafal Regen: Use linux_sys_{g,s}setrlimit, remove linux_sys_ugetrlimit since
linux/mips doesn't seem to have one.
 1.8 15-Feb-2002  christos Regen
 1.7 15-Feb-2002  christos - add a real linux_sys___sysctl because the mib numbers are different.
implement only the kernel version getting entries.
- make the signal conversion functions consistent; dest is arg 1.
- make linux_fakedev deal with block and char devices differently.
- add linux_sys_ugetrlimit, and flesh out the regular get/setrlimit so
that they work properly.
- add linux_mmap2 [untested].
- bump kernel to 2.4.18, and make the date be valentine's day :-)
- linux_sys_*stat64 family was totally busted. Fix it.

tested only on i386.

Status:
gdb, telnet, work
jdk-1.4.0 extractor works, jdk still coredumps.

christos
 1.6 20-Nov-2001  manu branches: 1.6.2;
Fixed the Linux signal trampoline and linux_sys_sigreturn(). Linux signal
delivery now seems fully functionnal.
 1.5 13-Nov-2001  lukem add RCSIDs (including regeneration of files as appropriate)
 1.4 14-Oct-2001  manu Fixed some mistakes in signal handling (this is still broken)
Added some code to set linux's uname kernel version to 2.4.0 (usefull for
testing with glibc-2.2). This is currently guarded by a #if 0.
 1.3 06-Oct-2001  manu Added socket operations to Linux Mips emulation
 1.2 30-Sep-2001  manu branches: 1.2.2;
Implements parts of sysmips() and fctnl64() emulation
 1.1 22-Sep-2001  manu branches: 1.1.2;
More work on Linux compat for Mips: system calls mapping.
 1.1.2.11 29-May-2002  nathanw Regen.
 1.1.2.10 17-Apr-2002  nathanw Catch up to -current.
 1.1.2.9 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.1.2.8 28-Feb-2002  nathanw Catch up to -current.
 1.1.2.7 08-Jan-2002  nathanw Catch up to -current.
 1.1.2.6 06-Dec-2001  wdk struct proc -> struct lwp changes for COMPAT_LINUX support on Mips
processors.
 1.1.2.5 14-Nov-2001  nathanw Catch up to -current.
 1.1.2.4 22-Oct-2001  nathanw Catch up to -current.
 1.1.2.3 08-Oct-2001  nathanw Catch up to -current.
 1.1.2.2 26-Sep-2001  nathanw Catch up to -current.
Again.
 1.1.2.1 22-Sep-2001  nathanw file linux_syscallargs.h was added on branch nathanw_sa on 2001-09-26 19:54:47 +0000
 1.2.2.3 11-Oct-2001  fvdl Catch up with -current. Fix some bogons in the sparc64 kbd/ms
attach code. cd18xx conversion provided by mrg.
 1.2.2.2 01-Oct-2001  fvdl Catch up with -current.
 1.2.2.1 30-Sep-2001  fvdl file linux_syscallargs.h was added on branch thorpej-devvp on 2001-10-01 12:43:40 +0000
 1.6.2.4 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.6.2.3 16-Mar-2002  jdolecek Catch up with -current.
 1.6.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.6.2.1 20-Nov-2001  thorpej file linux_syscallargs.h was added on branch kqueue on 2002-01-10 19:51:35 +0000
 1.11.4.3 14-Jun-2004  jmc Regen for changes in ticket #1708
 1.11.4.2 11-May-2004  tron Regen for ticket 1686.
 1.11.4.1 22-Oct-2003  jmc Regen files (requested by tv in ticket #1427)

Proper support for mmap2
 1.14.2.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.14.2.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.14.2.4 24-Sep-2004  skrll Sync with HEAD.
 1.14.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.14.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.14.2.1 03-Aug-2004  skrll Sync with HEAD
 1.19.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.19.4.1 29-Apr-2005  kent sync with -current
 1.23.2.4 21-Jan-2008  yamt sync with head
 1.23.2.3 07-Dec-2007  yamt sync with head
 1.23.2.2 03-Sep-2007  yamt sync with head.
 1.23.2.1 21-Jun-2006  yamt sync with head.
 1.24.14.1 19-Jun-2006  chap Sync with head.
 1.24.8.1 26-Jun-2006  yamt sync with head.
 1.24.4.1 09-Sep-2006  rpaulo sync with head
 1.25.12.1 12-Mar-2007  rmind Sync with HEAD.
 1.26.22.2 27-Dec-2007  mjf Sync with HEAD.
 1.26.22.1 19-Nov-2007  mjf Sync with HEAD.
 1.26.20.1 18-Nov-2007  bouyer Sync with HEAD
 1.26.16.1 09-Jan-2008  matt sync with HEAD
 1.26.14.1 21-Nov-2007  joerg Sync with HEAD.
 1.27.6.1 02-Jan-2008  bouyer Sync with HEAD
 1.27.2.1 26-Dec-2007  ad Sync with head.
 1.30.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.30.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.31.2.1 18-May-2008  yamt sync with head.
 1.32.12.1 20-Nov-2008  snj Regen for ticket 81.
 1.32.10.1 19-Jan-2009  skrll Sync with HEAD.
 1.32.8.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.32.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.32.2.4 11-Aug-2010  yamt sync with head.
 1.32.2.3 11-Mar-2010  yamt sync with head
 1.32.2.2 20-Jun-2009  yamt sync with head
 1.32.2.1 04-May-2009  yamt sync with head.
 1.37.2.1 23-Jul-2009  jym Sync with HEAD.
 1.41.4.3 31-May-2011  rmind sync with head
 1.41.4.2 21-Apr-2011  rmind sync with head
 1.41.4.1 05-Mar-2011  rmind sync with head
 1.41.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.42.4.1 05-Mar-2011  bouyer Sync with HEAD
 1.42.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.46.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.46.4.2 30-Oct-2012  yamt sync with head
 1.46.4.1 17-Apr-2012  yamt sync with head
 1.47.10.4 03-Dec-2017  jdolecek update from HEAD
 1.47.10.3 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.47.10.2 23-Jun-2013  tls resync from head
 1.47.10.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.49.4.1 18-May-2014  rmind sync with head
 1.53.2.1 10-Aug-2014  tls Rebase.
 1.60.2.1 17-Apr-2017  snj regen for ticket 1354
 1.61.2.5 28-Aug-2017  skrll Sync with HEAD
 1.61.2.4 05-Feb-2017  skrll Sync with HEAD
 1.61.2.3 05-Oct-2016  skrll Sync with HEAD
 1.61.2.2 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.61.2.1 06-Apr-2015  skrll Sync with HEAD
 1.65.2.3 20-Mar-2017  pgoyette Sync with HEAD
 1.65.2.2 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.65.2.1 26-Jul-2016  pgoyette Sync with HEAD
 1.69.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.75.4.1 11-May-2017  pgoyette Sync with HEAD
 1.76.10.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.76.10.1 10-Jun-2019  christos Sync with HEAD
 1.76.8.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.79.2.2 17-Dec-2020  thorpej Regen for preadv(2) and pwritev(2).
 1.79.2.1 15-Dec-2020  thorpej Regen for eventfd, timerfd, POSIX timers.
 1.90.2.1 02-Aug-2025  perseant Sync with HEAD
 1.92 28-Sep-2024  christos regen
 1.91 01-Jul-2024  christos regen
 1.90 29-Jun-2024  christos branches: 1.90.2;
regen
 1.89 19-Aug-2023  christos regen
 1.88 18-Aug-2023  christos regen
 1.87 29-Jul-2023  christos regen
 1.86 28-Jul-2023  christos regen
 1.85 02-Dec-2021  ryo regen
 1.84 24-Nov-2021  ryo regen
 1.83 20-Sep-2021  thorpej Regen for preadv(2) / pwritev(2).
 1.82 20-Sep-2021  thorpej Regen for eventfd.
 1.81 19-Sep-2021  thorpej Regen for timerfd.
 1.80 19-Sep-2021  thorpej Regen for POSIX timer syscalls.
 1.79 26-Apr-2020  thorpej branches: 1.79.2;
Regen for native futex calls.
 1.78 09-Nov-2019  jdolecek regen
 1.77 10-Aug-2018  pgoyette Regen
 1.76 10-May-2017  riastradh branches: 1.76.8; 1.76.10;
regen
 1.75 09-Feb-2017  christos branches: 1.75.4;
regen
 1.74 09-Feb-2017  christos regen
 1.73 04-Feb-2017  christos regen
 1.72 03-Feb-2017  christos regen
 1.71 02-Feb-2017  christos regen
 1.70 16-Jan-2017  christos regen all
 1.69 13-Jan-2017  christos branches: 1.69.2;
regen
 1.68 02-Jan-2017  martin Regen (something apparently went wrong in previous)
 1.67 02-Jan-2017  manu Regen
 1.66 24-Jul-2016  njoly Regen for readlink/readlinkat signatures.
 1.65 27-Oct-2015  njoly branches: 1.65.2;
Regen.
 1.64 25-Oct-2015  njoly Regen for posix chown family cleanup.
 1.63 24-Sep-2015  christos regen
 1.62 07-Mar-2015  christos regen
 1.61 22-Nov-2014  njoly branches: 1.61.2;
Regen for ppoll signature fix
 1.60 31-May-2014  njoly branches: 1.60.2;
Regen for munmap(2) signature.
 1.59 29-May-2014  njoly Regen for utimes(2) change.
 1.58 20-May-2014  njoly Regen for getgroups/setgroups update.
 1.57 17-May-2014  njoly Regen for fadvise64 offset types changes.
 1.56 06-May-2014  njoly Regen for mknod device argument type change.
 1.55 04-May-2014  njoly Regen for pread/pwrite 64bit offset argument.
 1.54 08-Apr-2014  njoly Regen.
 1.53 08-Dec-2013  njoly branches: 1.53.2;
Regen.
 1.52 19-Nov-2013  chs regen
 1.51 07-Nov-2013  njoly Regen for dup/dup2/dup3 argument types fix.
 1.50 24-Sep-2013  njoly Regen for utimensat(2).
 1.49 08-Apr-2013  pooka branches: 1.49.4;
regen for utimes
 1.48 19-Sep-2012  pooka regen for ppoll (and, apparently, SYCALL_ARG_PTR)
 1.47 18-Nov-2011  christos branches: 1.47.10;
- add sigtimedwait support.
- merge the siginfo population code.
 1.46 30-May-2011  alnsn branches: 1.46.4;
Regenerate files to pick up correct RCS Ids. Suggested by Chris Badura.
 1.45 30-May-2011  alnsn Add fadvise64 and fadvise64_64 syscalls to compat_linux and compat_linux32.
 1.44 15-Apr-2011  he Regenerate these files after adding pipe2() and dup3().
 1.43 20-Feb-2011  matt Regen.
 1.42 07-Jul-2010  chs branches: 1.42.2; 1.42.4;
regen
 1.41 14-Dec-2009  matt branches: 1.41.2; 1.41.4;
Regen (new makesyscalls.sh)
 1.40 24-Nov-2009  njoly Regen for personality(2) update.
 1.39 17-Jun-2009  njoly Regen for sendmsg/recvmsg definitions update.
 1.38 08-Jun-2009  njoly Regen for rt_queueinfo(2) update.
 1.37 17-Jan-2009  njoly branches: 1.37.2;
Regen for wait4 update.
 1.36 15-Jan-2009  njoly Rengen for compat50 update.
 1.35 13-Jan-2009  pooka Regen to prove I didn't screw up the conversion: purely RCSID changes.
 1.34 19-Nov-2008  ad Regen.
 1.33 12-Nov-2008  njoly Regen for nanosleep(2) fix.
 1.32 23-Apr-2008  ad branches: 1.32.2; 1.32.4; 1.32.8; 1.32.10; 1.32.12;
Regen.
 1.31 04-Apr-2008  njoly branches: 1.31.2;
Regen for linux_sys_msync removal.
 1.30 24-Dec-2007  njoly branches: 1.30.6;
Regen for linux_sys_getpgid removal.
 1.29 21-Dec-2007  njoly Regen for getfsuid/setfsgid syscall exchange.
 1.28 20-Dec-2007  dsl regen
 1.27 16-Nov-2007  njoly branches: 1.27.2; 1.27.6;
Regen, for syscalls cleanup.
 1.26 09-Feb-2007  ad branches: 1.26.18; 1.26.20; 1.26.24; 1.26.26;
Merge newlock2 to head.
 1.25 10-Jun-2006  christos branches: 1.25.6;
regen
 1.24 11-Dec-2005  christos branches: 1.24.4; 1.24.8; 1.24.14;
merge ktrace-lwp.
 1.23 16-May-2005  fvdl branches: 1.23.2;
Regen.
 1.22 16-May-2005  fvdl Regen.
 1.21 26-Feb-2005  perry regen
 1.20 26-Feb-2005  perry regen
 1.19 20-Sep-2004  jdolecek branches: 1.19.4; 1.19.6;
regen:
implement support for Linux statfs64() syscall - 64bit variant of statfs()
 1.18 08-Sep-2004  jdolecek regen: add exit_group(2)
 1.17 01-Aug-2004  jdolecek regen - sync syscall lists with Linux kernel 2.6.7
 1.16 01-Aug-2004  jdolecek regen:

connect madvise(2) and mincore(2) - apparently the newer Linux libs
don't stub it anymore, so allow the application to take advantage
of them

the Linux calls appear to be compatible in the flag values and semantics,
so a wrapper is not necessary
 1.15 10-Aug-2003  jdolecek regen - added wrapper for Linux ftruncate64()
 1.14 23-Jun-2003  christos branches: 1.14.2;
Regen.
 1.13 18-Jan-2003  thorpej Regen for correct RCS ID.
 1.12 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.11 10-Apr-2002  christos branches: 1.11.4;
regen
 1.10 22-Mar-2002  christos regen
 1.9 18-Feb-2002  rafal Regen: Use linux_sys_{g,s}setrlimit, remove linux_sys_ugetrlimit since
linux/mips doesn't seem to have one.
 1.8 15-Feb-2002  christos Regen
 1.7 15-Feb-2002  christos - add a real linux_sys___sysctl because the mib numbers are different.
implement only the kernel version getting entries.
- make the signal conversion functions consistent; dest is arg 1.
- make linux_fakedev deal with block and char devices differently.
- add linux_sys_ugetrlimit, and flesh out the regular get/setrlimit so
that they work properly.
- add linux_mmap2 [untested].
- bump kernel to 2.4.18, and make the date be valentine's day :-)
- linux_sys_*stat64 family was totally busted. Fix it.

tested only on i386.

Status:
gdb, telnet, work
jdk-1.4.0 extractor works, jdk still coredumps.

christos
 1.6 20-Nov-2001  manu branches: 1.6.2;
Fixed the Linux signal trampoline and linux_sys_sigreturn(). Linux signal
delivery now seems fully functionnal.
 1.5 13-Nov-2001  lukem add RCSIDs (including regeneration of files as appropriate)
 1.4 14-Oct-2001  manu Fixed some mistakes in signal handling (this is still broken)
Added some code to set linux's uname kernel version to 2.4.0 (usefull for
testing with glibc-2.2). This is currently guarded by a #if 0.
 1.3 06-Oct-2001  manu Added socket operations to Linux Mips emulation
 1.2 30-Sep-2001  manu branches: 1.2.2;
Implements parts of sysmips() and fctnl64() emulation
 1.1 22-Sep-2001  manu branches: 1.1.2;
More work on Linux compat for Mips: system calls mapping.
 1.1.2.11 29-May-2002  nathanw Regen.
 1.1.2.10 17-Apr-2002  nathanw Catch up to -current.
 1.1.2.9 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.1.2.8 28-Feb-2002  nathanw Catch up to -current.
 1.1.2.7 08-Jan-2002  nathanw Catch up to -current.
 1.1.2.6 06-Dec-2001  wdk struct proc -> struct lwp changes for COMPAT_LINUX support on Mips
processors.
 1.1.2.5 14-Nov-2001  nathanw Catch up to -current.
 1.1.2.4 22-Oct-2001  nathanw Catch up to -current.
 1.1.2.3 08-Oct-2001  nathanw Catch up to -current.
 1.1.2.2 26-Sep-2001  nathanw Catch up to -current.
Again.
 1.1.2.1 22-Sep-2001  nathanw file linux_syscalls.c was added on branch nathanw_sa on 2001-09-26 19:54:47 +0000
 1.2.2.3 11-Oct-2001  fvdl Catch up with -current. Fix some bogons in the sparc64 kbd/ms
attach code. cd18xx conversion provided by mrg.
 1.2.2.2 01-Oct-2001  fvdl Catch up with -current.
 1.2.2.1 30-Sep-2001  fvdl file linux_syscalls.c was added on branch thorpej-devvp on 2001-10-01 12:43:40 +0000
 1.6.2.4 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.6.2.3 16-Mar-2002  jdolecek Catch up with -current.
 1.6.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.6.2.1 20-Nov-2001  thorpej file linux_syscalls.c was added on branch kqueue on 2002-01-10 19:51:35 +0000
 1.11.4.3 14-Jun-2004  jmc Regen for changes in ticket #1708
 1.11.4.2 11-May-2004  tron Regen for ticket 1686.
 1.11.4.1 22-Oct-2003  jmc Regen files (requested by tv in ticket #1427)

Proper support for mmap2
 1.14.2.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.14.2.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.14.2.4 24-Sep-2004  skrll Sync with HEAD.
 1.14.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.14.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.14.2.1 03-Aug-2004  skrll Sync with HEAD
 1.19.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.19.4.1 29-Apr-2005  kent sync with -current
 1.23.2.4 21-Jan-2008  yamt sync with head
 1.23.2.3 07-Dec-2007  yamt sync with head
 1.23.2.2 26-Feb-2007  yamt sync with head.
 1.23.2.1 21-Jun-2006  yamt sync with head.
 1.24.14.1 19-Jun-2006  chap Sync with head.
 1.24.8.1 26-Jun-2006  yamt sync with head.
 1.24.4.1 09-Sep-2006  rpaulo sync with head
 1.25.6.1 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.26.26.2 27-Dec-2007  mjf Sync with HEAD.
 1.26.26.1 19-Nov-2007  mjf Sync with HEAD.
 1.26.24.1 18-Nov-2007  bouyer Sync with HEAD
 1.26.20.1 09-Jan-2008  matt sync with HEAD
 1.26.18.1 21-Nov-2007  joerg Sync with HEAD.
 1.27.6.1 02-Jan-2008  bouyer Sync with HEAD
 1.27.2.1 26-Dec-2007  ad Sync with head.
 1.30.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.30.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.31.2.1 18-May-2008  yamt sync with head.
 1.32.12.1 20-Nov-2008  snj Regen for ticket 81.
 1.32.10.1 19-Jan-2009  skrll Sync with HEAD.
 1.32.8.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.32.4.2 14-May-2008  wrstuden Per discussion with ad, remove most of the #include <sys/sa.h> lines
as they were including sa.h just for the type(s) needed for syscallargs.h.

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

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

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

I think this reduction is very good thing.
 1.32.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.32.2.4 11-Aug-2010  yamt sync with head.
 1.32.2.3 11-Mar-2010  yamt sync with head
 1.32.2.2 20-Jun-2009  yamt sync with head
 1.32.2.1 04-May-2009  yamt sync with head.
 1.37.2.1 23-Jul-2009  jym Sync with HEAD.
 1.41.4.3 31-May-2011  rmind sync with head
 1.41.4.2 21-Apr-2011  rmind sync with head
 1.41.4.1 05-Mar-2011  rmind sync with head
 1.41.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.42.4.1 05-Mar-2011  bouyer Sync with HEAD
 1.42.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.46.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.46.4.2 30-Oct-2012  yamt sync with head
 1.46.4.1 17-Apr-2012  yamt sync with head
 1.47.10.4 03-Dec-2017  jdolecek update from HEAD
 1.47.10.3 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.47.10.2 23-Jun-2013  tls resync from head
 1.47.10.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.49.4.1 18-May-2014  rmind sync with head
 1.53.2.1 10-Aug-2014  tls Rebase.
 1.60.2.1 17-Apr-2017  snj regen for ticket 1354
 1.61.2.4 05-Feb-2017  skrll Sync with HEAD
 1.61.2.3 05-Oct-2016  skrll Sync with HEAD
 1.61.2.2 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.61.2.1 06-Apr-2015  skrll Sync with HEAD
 1.65.2.3 20-Mar-2017  pgoyette Sync with HEAD
 1.65.2.2 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.65.2.1 26-Jul-2016  pgoyette Sync with HEAD
 1.69.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.75.4.1 11-May-2017  pgoyette Sync with HEAD
 1.76.10.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.76.10.1 10-Jun-2019  christos Sync with HEAD
 1.76.8.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.79.2.2 17-Dec-2020  thorpej Regen for preadv(2) and pwritev(2).
 1.79.2.1 15-Dec-2020  thorpej Regen for eventfd, timerfd, POSIX timers.
 1.90.2.1 02-Aug-2025  perseant Sync with HEAD
 1.92 28-Sep-2024  christos regen
 1.91 01-Jul-2024  christos regen
 1.90 29-Jun-2024  christos branches: 1.90.2;
regen
 1.89 19-Aug-2023  christos regen
 1.88 18-Aug-2023  christos regen
 1.87 29-Jul-2023  christos regen
 1.86 28-Jul-2023  christos regen
 1.85 02-Dec-2021  ryo regen
 1.84 24-Nov-2021  ryo regen
 1.83 20-Sep-2021  thorpej Regen for preadv(2) / pwritev(2).
 1.82 20-Sep-2021  thorpej Regen for eventfd.
 1.81 19-Sep-2021  thorpej Regen for timerfd.
 1.80 19-Sep-2021  thorpej Regen for POSIX timer syscalls.
 1.79 26-Apr-2020  thorpej branches: 1.79.2;
Regen for native futex calls.
 1.78 09-Nov-2019  jdolecek regen
 1.77 10-Aug-2018  pgoyette Regen
 1.76 10-May-2017  riastradh branches: 1.76.8; 1.76.10;
regen
 1.75 09-Feb-2017  christos branches: 1.75.4;
regen
 1.74 09-Feb-2017  christos regen
 1.73 04-Feb-2017  christos regen
 1.72 03-Feb-2017  christos regen
 1.71 02-Feb-2017  christos regen
 1.70 16-Jan-2017  christos regen all
 1.69 13-Jan-2017  christos branches: 1.69.2;
regen
 1.68 02-Jan-2017  martin Regen (something apparently went wrong in previous)
 1.67 02-Jan-2017  manu Regen
 1.66 24-Jul-2016  njoly Regen for readlink/readlinkat signatures.
 1.65 27-Oct-2015  njoly branches: 1.65.2;
Regen.
 1.64 25-Oct-2015  njoly Regen for posix chown family cleanup.
 1.63 24-Sep-2015  christos regen
 1.62 07-Mar-2015  christos regen
 1.61 22-Nov-2014  njoly branches: 1.61.2;
Regen for ppoll signature fix
 1.60 31-May-2014  njoly branches: 1.60.2;
Regen for munmap(2) signature.
 1.59 29-May-2014  njoly Regen for utimes(2) change.
 1.58 20-May-2014  njoly Regen for getgroups/setgroups update.
 1.57 17-May-2014  njoly Regen for fadvise64 offset types changes.
 1.56 06-May-2014  njoly Regen for mknod device argument type change.
 1.55 04-May-2014  njoly Regen for pread/pwrite 64bit offset argument.
 1.54 08-Apr-2014  njoly Regen.
 1.53 08-Dec-2013  njoly branches: 1.53.2;
Regen.
 1.52 19-Nov-2013  chs regen
 1.51 07-Nov-2013  njoly Regen for dup/dup2/dup3 argument types fix.
 1.50 24-Sep-2013  njoly Regen for utimensat(2).
 1.49 08-Apr-2013  pooka branches: 1.49.4;
regen for utimes
 1.48 19-Sep-2012  pooka regen for ppoll (and, apparently, SYCALL_ARG_PTR)
 1.47 18-Nov-2011  christos branches: 1.47.10;
- add sigtimedwait support.
- merge the siginfo population code.
 1.46 30-May-2011  alnsn branches: 1.46.4;
Regenerate files to pick up correct RCS Ids. Suggested by Chris Badura.
 1.45 30-May-2011  alnsn Add fadvise64 and fadvise64_64 syscalls to compat_linux and compat_linux32.
 1.44 15-Apr-2011  he Regenerate these files after adding pipe2() and dup3().
 1.43 20-Feb-2011  matt Regen.
 1.42 07-Jul-2010  chs branches: 1.42.2; 1.42.4;
regen
 1.41 14-Dec-2009  matt branches: 1.41.2; 1.41.4;
Regen (new makesyscalls.sh)
 1.40 24-Nov-2009  njoly Regen for personality(2) update.
 1.39 17-Jun-2009  njoly Regen for sendmsg/recvmsg definitions update.
 1.38 08-Jun-2009  njoly Regen for rt_queueinfo(2) update.
 1.37 17-Jan-2009  njoly branches: 1.37.2;
Regen for wait4 update.
 1.36 15-Jan-2009  njoly Rengen for compat50 update.
 1.35 13-Jan-2009  pooka Regen to prove I didn't screw up the conversion: purely RCSID changes.
 1.34 19-Nov-2008  ad Regen.
 1.33 12-Nov-2008  njoly Regen for nanosleep(2) fix.
 1.32 23-Apr-2008  ad branches: 1.32.2; 1.32.4; 1.32.8; 1.32.10; 1.32.12;
Regen.
 1.31 04-Apr-2008  njoly branches: 1.31.2;
Regen for linux_sys_msync removal.
 1.30 24-Dec-2007  njoly branches: 1.30.6;
Regen for linux_sys_getpgid removal.
 1.29 21-Dec-2007  njoly Regen for getfsuid/setfsgid syscall exchange.
 1.28 20-Dec-2007  dsl regen
 1.27 16-Nov-2007  njoly branches: 1.27.2; 1.27.6;
Regen, for syscalls cleanup.
 1.26 09-Feb-2007  ad branches: 1.26.18; 1.26.20; 1.26.24; 1.26.26;
Merge newlock2 to head.
 1.25 10-Jun-2006  christos branches: 1.25.6;
regen
 1.24 11-Dec-2005  christos branches: 1.24.4; 1.24.8; 1.24.14;
merge ktrace-lwp.
 1.23 16-May-2005  fvdl branches: 1.23.2;
Regen.
 1.22 16-May-2005  fvdl Regen.
 1.21 26-Feb-2005  perry regen
 1.20 26-Feb-2005  perry regen
 1.19 20-Sep-2004  jdolecek branches: 1.19.4; 1.19.6;
regen:
implement support for Linux statfs64() syscall - 64bit variant of statfs()
 1.18 08-Sep-2004  jdolecek regen: add exit_group(2)
 1.17 01-Aug-2004  jdolecek regen - sync syscall lists with Linux kernel 2.6.7
 1.16 01-Aug-2004  jdolecek regen:

connect madvise(2) and mincore(2) - apparently the newer Linux libs
don't stub it anymore, so allow the application to take advantage
of them

the Linux calls appear to be compatible in the flag values and semantics,
so a wrapper is not necessary
 1.15 10-Aug-2003  jdolecek regen - added wrapper for Linux ftruncate64()
 1.14 23-Jun-2003  christos branches: 1.14.2;
Regen.
 1.13 18-Jan-2003  thorpej Regen for correct RCS ID.
 1.12 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.11 01-Nov-2002  jdolecek nsysent set to 256, and use linux_sys_nosys()
 1.10 10-Apr-2002  christos branches: 1.10.4;
regen
 1.9 22-Mar-2002  christos regen
 1.8 18-Feb-2002  rafal Regen: Use linux_sys_{g,s}setrlimit, remove linux_sys_ugetrlimit since
linux/mips doesn't seem to have one.
 1.7 15-Feb-2002  christos Regen
 1.6 20-Nov-2001  manu branches: 1.6.2;
Fixed the Linux signal trampoline and linux_sys_sigreturn(). Linux signal
delivery now seems fully functionnal.
 1.5 13-Nov-2001  lukem add RCSIDs (including regeneration of files as appropriate)
 1.4 14-Oct-2001  manu Fixed some mistakes in signal handling (this is still broken)
Added some code to set linux's uname kernel version to 2.4.0 (usefull for
testing with glibc-2.2). This is currently guarded by a #if 0.
 1.3 06-Oct-2001  manu Added socket operations to Linux Mips emulation
 1.2 30-Sep-2001  manu branches: 1.2.2;
Implements parts of sysmips() and fctnl64() emulation
 1.1 22-Sep-2001  manu branches: 1.1.2;
One file that was missing from a previous commit
 1.1.2.12 11-Nov-2002  nathanw Catch up to -current
 1.1.2.11 29-May-2002  nathanw Regen.
 1.1.2.10 17-Apr-2002  nathanw Catch up to -current.
 1.1.2.9 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.1.2.8 28-Feb-2002  nathanw Catch up to -current.
 1.1.2.7 08-Jan-2002  nathanw Catch up to -current.
 1.1.2.6 06-Dec-2001  wdk struct proc -> struct lwp changes for COMPAT_LINUX support on Mips
processors.
 1.1.2.5 14-Nov-2001  nathanw Catch up to -current.
 1.1.2.4 22-Oct-2001  nathanw Catch up to -current.
 1.1.2.3 08-Oct-2001  nathanw Catch up to -current.
 1.1.2.2 26-Sep-2001  nathanw Catch up to -current.
Again.
 1.1.2.1 22-Sep-2001  nathanw file linux_sysent.c was added on branch nathanw_sa on 2001-09-26 19:54:47 +0000
 1.2.2.3 11-Oct-2001  fvdl Catch up with -current. Fix some bogons in the sparc64 kbd/ms
attach code. cd18xx conversion provided by mrg.
 1.2.2.2 01-Oct-2001  fvdl Catch up with -current.
 1.2.2.1 30-Sep-2001  fvdl file linux_sysent.c was added on branch thorpej-devvp on 2001-10-01 12:43:40 +0000
 1.6.2.4 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.6.2.3 16-Mar-2002  jdolecek Catch up with -current.
 1.6.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.6.2.1 20-Nov-2001  thorpej file linux_sysent.c was added on branch kqueue on 2002-01-10 19:51:35 +0000
 1.10.4.3 14-Jun-2004  jmc Regen for changes in ticket #1708
 1.10.4.2 11-May-2004  tron Regen for ticket 1686.
 1.10.4.1 22-Oct-2003  jmc Regen files (requested by tv in ticket #1427)

Proper support for mmap2
 1.14.2.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.14.2.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.14.2.4 24-Sep-2004  skrll Sync with HEAD.
 1.14.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.14.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.14.2.1 03-Aug-2004  skrll Sync with HEAD
 1.19.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.19.4.1 29-Apr-2005  kent sync with -current
 1.23.2.4 21-Jan-2008  yamt sync with head
 1.23.2.3 07-Dec-2007  yamt sync with head
 1.23.2.2 26-Feb-2007  yamt sync with head.
 1.23.2.1 21-Jun-2006  yamt sync with head.
 1.24.14.1 19-Jun-2006  chap Sync with head.
 1.24.8.1 26-Jun-2006  yamt sync with head.
 1.24.4.1 09-Sep-2006  rpaulo sync with head
 1.25.6.1 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.26.26.2 27-Dec-2007  mjf Sync with HEAD.
 1.26.26.1 19-Nov-2007  mjf Sync with HEAD.
 1.26.24.1 18-Nov-2007  bouyer Sync with HEAD
 1.26.20.1 09-Jan-2008  matt sync with HEAD
 1.26.18.1 21-Nov-2007  joerg Sync with HEAD.
 1.27.6.1 02-Jan-2008  bouyer Sync with HEAD
 1.27.2.1 26-Dec-2007  ad Sync with head.
 1.30.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.30.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.31.2.1 18-May-2008  yamt sync with head.
 1.32.12.1 20-Nov-2008  snj Regen for ticket 81.
 1.32.10.1 19-Jan-2009  skrll Sync with HEAD.
 1.32.8.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.32.4.2 14-May-2008  wrstuden Per discussion with ad, remove most of the #include <sys/sa.h> lines
as they were including sa.h just for the type(s) needed for syscallargs.h.

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

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

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

I think this reduction is very good thing.
 1.32.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.32.2.4 11-Aug-2010  yamt sync with head.
 1.32.2.3 11-Mar-2010  yamt sync with head
 1.32.2.2 20-Jun-2009  yamt sync with head
 1.32.2.1 04-May-2009  yamt sync with head.
 1.37.2.1 23-Jul-2009  jym Sync with HEAD.
 1.41.4.3 31-May-2011  rmind sync with head
 1.41.4.2 21-Apr-2011  rmind sync with head
 1.41.4.1 05-Mar-2011  rmind sync with head
 1.41.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.42.4.1 05-Mar-2011  bouyer Sync with HEAD
 1.42.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.46.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.46.4.2 30-Oct-2012  yamt sync with head
 1.46.4.1 17-Apr-2012  yamt sync with head
 1.47.10.4 03-Dec-2017  jdolecek update from HEAD
 1.47.10.3 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.47.10.2 23-Jun-2013  tls resync from head
 1.47.10.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.49.4.1 18-May-2014  rmind sync with head
 1.53.2.1 10-Aug-2014  tls Rebase.
 1.60.2.1 17-Apr-2017  snj regen for ticket 1354
 1.61.2.4 05-Feb-2017  skrll Sync with HEAD
 1.61.2.3 05-Oct-2016  skrll Sync with HEAD
 1.61.2.2 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.61.2.1 06-Apr-2015  skrll Sync with HEAD
 1.65.2.3 20-Mar-2017  pgoyette Sync with HEAD
 1.65.2.2 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.65.2.1 26-Jul-2016  pgoyette Sync with HEAD
 1.69.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.75.4.1 11-May-2017  pgoyette Sync with HEAD
 1.76.10.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.76.10.1 10-Jun-2019  christos Sync with HEAD
 1.76.8.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.79.2.2 17-Dec-2020  thorpej Regen for preadv(2) and pwritev(2).
 1.79.2.1 15-Dec-2020  thorpej Regen for eventfd, timerfd, POSIX timers.
 1.90.2.1 02-Aug-2025  perseant Sync with HEAD
 1.5 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.4 11-Dec-2005  christos branches: 1.4.70; 1.4.72; 1.4.74;
merge ktrace-lwp.
 1.3 26-Feb-2005  perry nuke trailing whitespace
 1.2 02-Sep-2001  manu branches: 1.2.4; 1.2.6; 1.2.24; 1.2.32; 1.2.34;
Fixed indent problems
 1.1 26-Aug-2001  manu Preliminary work on Linux/Mips emul. More to come soon...
 1.2.34.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.2.32.1 29-Apr-2005  kent sync with -current
 1.2.24.1 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.2.6.2 21-Sep-2001  nathanw Catch up to -current.
 1.2.6.1 02-Sep-2001  nathanw file linux_termios.h was added on branch nathanw_sa on 2001-09-21 22:35:17 +0000
 1.2.4.2 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.2.4.1 02-Sep-2001  thorpej file linux_termios.h was added on branch kqueue on 2001-09-13 01:15:20 +0000
 1.4.74.1 16-May-2008  yamt sync with head.
 1.4.72.1 18-May-2008  yamt sync with head.
 1.4.70.1 02-Jun-2008  mjf Sync with HEAD.
 1.11 11-Jan-2009  christos merge christos-time_t
 1.10 28-Apr-2008  martin branches: 1.10.8; 1.10.14;
Remove clause 3 and 4 from TNF licenses
 1.9 11-Dec-2005  christos branches: 1.9.70; 1.9.72; 1.9.74;
merge ktrace-lwp.
 1.8 26-Feb-2005  perry nuke trailing whitespace
 1.7 20-Sep-2004  jdolecek branches: 1.7.4; 1.7.6;
move definition of linux_fsid_t to common/linux_types.h - it's identical
across all Linux archs
 1.6 19-Sep-2004  jdolecek move definition of struct linux_stafs to common/linux_types.h, and use
explicit size types - the structure definition is actually identical
on currently support COMPAT_LINUX archs, so no point to have 6 copies of it
in the tree
 1.5 17-Feb-2002  rafal branches: 1.5.16;
the MIPS stat64 struct doesn't have a separate ino64 field, but the ino field
is a u_longlong.
 1.4 06-Oct-2001  manu Added socket operations to Linux Mips emulation
 1.3 22-Sep-2001  manu Fixed errors in header files
 1.2 02-Sep-2001  manu branches: 1.2.2; 1.2.4; 1.2.6;
Added 64 bits support in header files.
All headers should be common to 32 bits MIPS and 64 bits MIPS now.
 1.1 26-Aug-2001  manu Preliminary work on Linux/Mips emul
 1.2.6.5 28-Feb-2002  nathanw Catch up to -current.
 1.2.6.4 22-Oct-2001  nathanw Catch up to -current.
 1.2.6.3 26-Sep-2001  nathanw Catch up to -current.
Again.
 1.2.6.2 21-Sep-2001  nathanw Catch up to -current.
 1.2.6.1 02-Sep-2001  nathanw file linux_types.h was added on branch nathanw_sa on 2001-09-21 22:35:17 +0000
 1.2.4.4 16-Mar-2002  jdolecek Catch up with -current.
 1.2.4.3 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2.4.2 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.2.4.1 02-Sep-2001  thorpej file linux_types.h was added on branch kqueue on 2001-09-13 01:15:20 +0000
 1.2.2.2 11-Oct-2001  fvdl Catch up with -current. Fix some bogons in the sparc64 kbd/ms
attach code. cd18xx conversion provided by mrg.
 1.2.2.1 01-Oct-2001  fvdl Catch up with -current.
 1.5.16.2 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.5.16.1 24-Sep-2004  skrll Sync with HEAD.
 1.7.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.7.4.1 29-Apr-2005  kent sync with -current
 1.9.74.2 04-May-2009  yamt sync with head.
 1.9.74.1 16-May-2008  yamt sync with head.
 1.9.72.1 18-May-2008  yamt sync with head.
 1.9.70.2 17-Jan-2009  mjf Sync with HEAD.
 1.9.70.1 02-Jun-2008  mjf Sync with HEAD.
 1.10.14.2 11-Jan-2009  christos add linux_suseconds_t
 1.10.14.1 28-Apr-2008  christos file linux_types.h was added on branch christos-time_t on 2009-01-11 00:17:51 +0000
 1.10.8.1 19-Jan-2009  skrll Sync with HEAD.
 1.4 11-Dec-2005  christos merge ktrace-lwp.
 1.3 01-Aug-2004  jdolecek sync the syscall lists with Linux kernel 2.6.7
 1.2 01-Nov-2002  jdolecek branches: 1.2.6;
add appropriate nsysent, and use linux_sys_nosys as sys_nosys
 1.1 30-Sep-1998  erh branches: 1.1.24;
Stubs for future development of linux compat architechtures.
 1.1.24.1 11-Nov-2002  nathanw Catch up to -current
 1.2.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.6.1 03-Aug-2004  skrll Sync with HEAD
 1.83 01-Oct-2024  riastradh sys/compat/linux/arch/*/syscalls.master: Nix trailing whitespace.

No functional change intended.
 1.82 28-Sep-2024  christos Linux GSoC-2024: renameat2, clone3, sync_file_range, syncfs (Shivraj Jamgade)
 1.81 01-Jul-2024  christos Add linux POSIX message queue support (Ricardo Branco)
 1.80 29-Jun-2024  christos branches: 1.80.2;
From gsoc 2024: Implement faccessat2 and getcpu (Shivraz)
 1.79 19-Aug-2023  christos Add inotify* syscalls GSoC 2023 (Theodore Preduta)
 1.78 18-Aug-2023  christos Add linux waitid(2) from GSoC 2023 (Theodore Preduta)
 1.77 29-Jul-2023  christos typo
 1.76 29-Jul-2023  christos Add/fix statx, readahead, close_range. From GSoC 2023 by Theodore Preduta
 1.75 28-Jul-2023  christos add epoll syscalls
 1.74 02-Dec-2021  ryo add prlimit64(2) syscall to COMPAT_LINUX and COMPAT_LINUX32
 1.73 24-Nov-2021  ryo add getrandom(2) syscall entry
 1.72 20-Sep-2021  thorpej Add preadv(2) and pwritev(2) system calls to COMPAT_LINUX and COMPAT_LINUX32.
 1.71 20-Sep-2021  thorpej Add the eventfd system calls to COMPAT_LINUX and COMPAT_LINUX32.
 1.70 19-Sep-2021  thorpej Add the timerfd syscalls to COMPAT_LINUX and COMPAT_LINUX32.
 1.69 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.68 26-Apr-2020  thorpej branches: 1.68.2;
Add a NetBSD native futex implementation, mostly written by riastradh@.
Map the COMPAT_LINUX futex calls to the native ones.
 1.67 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.66 09-Feb-2017  christos branches: 1.66.14;
revert listen
 1.65 09-Feb-2017  christos fix listen
 1.64 04-Feb-2017  christos fix broken entries that prevented compilation.
 1.63 03-Feb-2017  christos add missing unimpl and sendmmsg and recvmmsg
 1.62 02-Feb-2017  christos implement accept4
XXX: mips looks busted (the syscalls file has lots of NOARGS syscalls that
should be STD).
 1.61 02-Jan-2017  manu branches: 1.61.2;
Add pselect6 Linux system call.
This lets Matlab R2016A run on NetBSD/amd64
 1.60 24-Jul-2016  njoly Small cleanup. Adjust readlink/readlinkat signatures to reduce diffs with
native.
 1.59 27-Oct-2015  njoly branches: 1.59.2;
Fix wrong gid types from previous.
 1.58 25-Oct-2015  njoly Cleanup posix chown family syscalls to match native (alpha, mips and
powerpc).
 1.57 22-Nov-2014  njoly branches: 1.57.2;
Fix ppoll signature (int ->u_int)
 1.56 31-May-2014  njoly branches: 1.56.2;
Fix munmap(2) signature.
 1.55 29-May-2014  njoly For utimes(2), use compat_50_sys_utimes() instead of local version.
 1.54 20-May-2014  njoly Fix getgroups/setgroups signature.
 1.53 17-May-2014  njoly Fix fadvise64 syscalls to use 64bit offset types.
 1.52 06-May-2014  njoly Reduce diffs between archs; make mknod device argument unsigned.
 1.51 04-May-2014  njoly Fix pread/pwrite syscalls which need a 64bit offset argument.
 1.50 08-Apr-2014  njoly Adjust read/write/readv/writev signature to match native versions.
 1.49 08-Dec-2013  njoly branches: 1.49.2;
Sprinkle a few more linux_umode_t where appropriate.
Reduce diffs between archs.
 1.48 19-Nov-2013  chs add the *at() syscalls.
 1.47 07-Nov-2013  njoly Fix dup/dup2/dup3 argument types (u_int -> int).
 1.46 24-Sep-2013  njoly Add utimensat(2) for compat linux.
 1.45 08-Apr-2013  pooka branches: 1.45.4;
support utimes on non-alpha linux platforms
 1.44 19-Sep-2012  pooka emulate ppoll which is essentially our pollts
 1.43 18-Nov-2011  christos branches: 1.43.10;
add sigtimedwait
 1.42 09-Jul-2011  christos branches: 1.42.2;
the first argument of {g,s}etitimer() is int not u_int.
 1.41 30-May-2011  alnsn Add fadvise64 and fadvise64_64 syscalls to compat_linux and compat_linux32.
 1.40 15-Apr-2011  he Add dup3() and pipe2() for these archs as well.
 1.39 20-Feb-2011  matt Change some ints to longs (for LP64).
 1.38 07-Jul-2010  chs branches: 1.38.2; 1.38.4;
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 24-Nov-2009  njoly branches: 1.37.2; 1.37.4;
Update personality(2) to match Linux definition where the argument is an
unsigned long.
 1.36 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.35 08-Jun-2009  njoly Update rt_queueinfo(2) definition, and kill a corresponding comment.
 1.34 17-Jan-2009  njoly branches: 1.34.2;
Convert linux/linux32 wait(4) to use a compat50 rusage structure.
 1.33 15-Jan-2009  njoly Update some syscalls/arguments to use the new compat50 equivalents.
 1.32 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.31 19-Nov-2008  ad Make the emulations, exec formats, coredump, NFS, and the NFS server
into modules. By and large this commit:

- shuffles header files and ifdefs
- splits code out where necessary to be modular
- adds module glue for each of the components
- adds/replaces hooks for things that can be installed at runtime
 1.30 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.29 23-Apr-2008  ad branches: 1.29.2; 1.29.4; 1.29.8; 1.29.10; 1.29.12;
-SYCALL_MPSAFE
 1.28 04-Apr-2008  njoly branches: 1.28.2;
Cleanup. Kill linux_sys_msync and use sys___msync13 instead.
No functional changes expected.
 1.27 24-Dec-2007  njoly branches: 1.27.6;
Kill unneeded linux_sys_getpgid and use native sys_getpgid instead.
 1.26 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.25 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.24 16-Nov-2007  njoly branches: 1.24.2; 1.24.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.23 04-Mar-2007  christos branches: 1.23.14; 1.23.16; 1.23.20; 1.23.22;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.22 09-Feb-2007  ad branches: 1.22.2;
Merge newlock2 to head.
 1.21 10-Jun-2006  christos branches: 1.21.6;
linux getpriority is off-by-20 so use our own function.
From PR/33671: Nicolas Joly
 1.20 11-Dec-2005  christos branches: 1.20.4; 1.20.8; 1.20.14;
merge ktrace-lwp.
 1.19 16-May-2005  fvdl branches: 1.19.2;
Add clock_* POSIX functions.
 1.18 16-May-2005  fvdl Add *xattr functions (they all return EOPNOTSUPP).
 1.17 26-Feb-2005  perry nuke trailing whitespace
 1.16 20-Sep-2004  jdolecek branches: 1.16.4; 1.16.6;
implement support for Linux statfs64() syscall - 64bit variant of statfs()
 1.15 08-Sep-2004  jdolecek implement basic exit_group(2), which just terminates calling thread;
apparently not many apps use thread groups yet, at least not with default
SuSE 9.1 libraries, so this is enough for now
 1.14 01-Aug-2004  jdolecek sync the syscall lists with Linux kernel 2.6.7
 1.13 01-Aug-2004  jdolecek connect madvise(2) and mincore(2) - apparently the newer Linux libs
don't stub it anymore, so allow the application to take advantage
of them

the Linux calls appear to be compatible in the flag values and semantics,
so a wrapper is not necessary
 1.12 10-Aug-2003  jdolecek add Linux compat arg wrapper for ftruncate64(), and change linux compat
truncate64() wrapper to translate args structure
NetBSD truncate() and ftrucate() have hidden 'pad' argument, so we have
to do the argument translation

Problem found and patch supplied in PR kern/22360 by Ales Krenek

This is the last of syscalls with hidden 'pad' arg we didn't have
wrapper for; all the others (lseek, mmap, pwrite, pread) already had
wrapper before.
 1.11 23-Jun-2003  christos branches: 1.11.2;
PR/21937: Todd Vierling: Proper support for mmap2
 1.10 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.9 10-Apr-2002  christos branches: 1.9.4;
add getdents64
 1.8 22-Mar-2002  christos add mprotect, nuke mmap2
 1.7 17-Feb-2002  rafal Use linux_sys_{g,s}etrlimit() since there's a common implementation now; but
MIPS has no sys_ugetrlimit, so don't declare it (209 is UNIMPL in the OSS
Linux-mips tree)
 1.6 15-Feb-2002  christos proper comment.
 1.5 15-Feb-2002  christos - add a real linux_sys___sysctl because the mib numbers are different.
implement only the kernel version getting entries.
- make the signal conversion functions consistent; dest is arg 1.
- make linux_fakedev deal with block and char devices differently.
- add linux_sys_ugetrlimit, and flesh out the regular get/setrlimit so
that they work properly.
- add linux_mmap2 [untested].
- bump kernel to 2.4.18, and make the date be valentine's day :-)
- linux_sys_*stat64 family was totally busted. Fix it.

tested only on i386.

Status:
gdb, telnet, work
jdk-1.4.0 extractor works, jdk still coredumps.

christos
 1.4 20-Nov-2001  manu branches: 1.4.2;
Fixed the Linux signal trampoline and linux_sys_sigreturn(). Linux signal
delivery now seems fully functionnal.
 1.3 06-Oct-2001  manu Added socket operations to Linux Mips emulation
 1.2 30-Sep-2001  manu branches: 1.2.2;
Implements parts of sysmips() and fctnl64() emulation
 1.1 22-Sep-2001  manu branches: 1.1.2;
More work on Linux compat for Mips: system calls mapping.
 1.1.2.9 29-May-2002  nathanw #include <sys/sa.h> before <sys/syscallargs.h>, to provide sa_upcall_t
now that <sys/param.h> doesn't include <sys/sa.h>.

(Behold the Power of Ed)
 1.1.2.8 17-Apr-2002  nathanw Catch up to -current.
 1.1.2.7 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.1.2.6 28-Feb-2002  nathanw Catch up to -current.
 1.1.2.5 08-Jan-2002  nathanw Catch up to -current.
 1.1.2.4 22-Oct-2001  nathanw Catch up to -current.
 1.1.2.3 08-Oct-2001  nathanw Catch up to -current.
 1.1.2.2 26-Sep-2001  nathanw Catch up to -current.
Again.
 1.1.2.1 22-Sep-2001  nathanw file syscalls.master was added on branch nathanw_sa on 2001-09-26 19:54:47 +0000
 1.2.2.3 11-Oct-2001  fvdl Catch up with -current. Fix some bogons in the sparc64 kbd/ms
attach code. cd18xx conversion provided by mrg.
 1.2.2.2 01-Oct-2001  fvdl Catch up with -current.
 1.2.2.1 30-Sep-2001  fvdl file syscalls.master was added on branch thorpej-devvp on 2001-10-01 12:43:41 +0000
 1.4.2.4 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.4.2.3 16-Mar-2002  jdolecek Catch up with -current.
 1.4.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.4.2.1 20-Nov-2001  thorpej file syscalls.master was added on branch kqueue on 2002-01-10 19:51:35 +0000
 1.9.4.3 14-Jun-2004  jmc Pullup patch (requested by skrll in ticket #1708)

Bring netbsd-1-6 inline with -current sources after the mistakes in ticket #1686
 1.9.4.2 11-May-2004  tron Pull up revision 1.12 via patch (requested by wennmach in ticket #1686):
add Linux compat arg wrapper for ftruncate64(), and change linux compat
truncate64() wrapper to translate args structure
NetBSD truncate() and ftrucate() have hidden 'pad' argument, so we have
to do the argument translation
Problem found and patch supplied in PR kern/22360 by Ales Krenek
This is the last of syscalls with hidden 'pad' arg we didn't have
wrapper for; all the others (lseek, mmap, pwrite, pread) already had
wrapper before.
 1.9.4.1 22-Oct-2003  jmc Regen files (requested by tv in ticket #1427)

Proper support for mmap2
 1.11.2.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.11.2.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.11.2.4 24-Sep-2004  skrll Sync with HEAD.
 1.11.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.11.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.11.2.1 03-Aug-2004  skrll Sync with HEAD
 1.16.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.16.4.1 29-Apr-2005  kent sync with -current
 1.19.2.5 21-Jan-2008  yamt sync with head
 1.19.2.4 07-Dec-2007  yamt sync with head
 1.19.2.3 03-Sep-2007  yamt sync with head.
 1.19.2.2 26-Feb-2007  yamt sync with head.
 1.19.2.1 21-Jun-2006  yamt sync with head.
 1.20.14.1 19-Jun-2006  chap Sync with head.
 1.20.8.1 26-Jun-2006  yamt sync with head.
 1.20.4.1 09-Sep-2006  rpaulo sync with head
 1.21.6.1 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.22.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.23.22.2 27-Dec-2007  mjf Sync with HEAD.
 1.23.22.1 19-Nov-2007  mjf Sync with HEAD.
 1.23.20.1 18-Nov-2007  bouyer Sync with HEAD
 1.23.16.1 09-Jan-2008  matt sync with HEAD
 1.23.14.1 21-Nov-2007  joerg Sync with HEAD.
 1.24.6.1 02-Jan-2008  bouyer Sync with HEAD
 1.24.2.1 26-Dec-2007  ad Sync with head.
 1.27.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.27.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.28.2.1 18-May-2008  yamt sync with head.
 1.29.12.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.29.10.1 19-Jan-2009  skrll Sync with HEAD.
 1.29.8.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.29.4.2 14-May-2008  wrstuden Per discussion with ad, remove most of the #include <sys/sa.h> lines
as they were including sa.h just for the type(s) needed for syscallargs.h.

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

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

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

I think this reduction is very good thing.
 1.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.4 11-Aug-2010  yamt sync with head.
 1.29.2.3 11-Mar-2010  yamt sync with head
 1.29.2.2 20-Jun-2009  yamt sync with head
 1.29.2.1 04-May-2009  yamt sync with head.
 1.34.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.4.1 05-Mar-2011  bouyer Sync with HEAD
 1.38.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.42.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.42.2.2 30-Oct-2012  yamt sync with head
 1.42.2.1 17-Apr-2012  yamt sync with head
 1.43.10.4 03-Dec-2017  jdolecek update from HEAD
 1.43.10.3 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.43.10.2 23-Jun-2013  tls resync from head
 1.43.10.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.45.4.1 18-May-2014  rmind sync with head
 1.49.2.1 10-Aug-2014  tls Rebase.
 1.56.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.57.2.4 28-Aug-2017  skrll Sync with HEAD
 1.57.2.3 05-Feb-2017  skrll Sync with HEAD
 1.57.2.2 05-Oct-2016  skrll Sync with HEAD
 1.57.2.1 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 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.61.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.66.14.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.68.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.68.2.1 15-Dec-2020  thorpej Add Linux eventfd, timerfd, and POSIX timer calls.
 1.80.2.1 02-Aug-2025  perseant Sync with HEAD
 1.4 29-May-2024  christos 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 03-Oct-1998  christos branches: 1.2.184; 1.2.194; 1.2.200; 1.2.210;
Attempt to fix the mess.
 1.1 30-Sep-1998  erh Stubs for future development of linux compat architechtures.
 1.2.210.1 10-Aug-2014  tls Rebase.
 1.2.200.1 18-May-2014  rmind sync with head
 1.2.194.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.184.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.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 07-Jul-2010  chs branches: 1.10.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.9 02-Feb-2008  dsl branches: 1.9.10; 1.9.30; 1.9.32;
Extract the fcntl64() suppoort from linux_file64.c into linux_fcntl64.c
Unravel some of the knots that caused linux_file64.c to be compiled twice
for an amd64 kernel (once for linux and once for linux32) with different
parts being skipped each time.
 1.8 01-Sep-2006  matt branches: 1.8.28; 1.8.34;
When calling PTRACE from an LKM, use sysent[SYS_ptrace].sy_call in case
the sys_ptrace symbol isn't present.
 1.7 30-Aug-2006  matt Update to deal with options PTRACE
 1.6 11-Dec-2005  christos branches: 1.6.4; 1.6.8;
merge ktrace-lwp.
 1.5 25-Jul-2004  chs branches: 1.5.12;
remove the LINUX_SP_WRAP hack since it doesn't seem to be needed anymore,
and removing it lets us go back to mapping the stack non-executable again.
 1.4 19-May-2002  jdolecek branches: 1.4.8; 1.4.10;
add missing linux_file64.c, which is needed now
 1.3 31-Mar-2002  christos branches: 1.3.2;
bring the reverse signal mapping array into linux_signo.c
 1.2 03-Sep-2001  manu Fixed indent
 1.1 19-Jan-2001  manu branches: 1.1.2; 1.1.4; 1.1.6;
Added previously created files for powerpc Linux compatibility to the kernel
config system
 1.1.6.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.6.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.1.4.3 20-Jun-2002  nathanw Catch up to -current.
 1.1.4.2 17-Apr-2002  nathanw Catch up to -current.
 1.1.4.1 21-Sep-2001  nathanw Catch up to -current.
 1.1.2.2 11-Feb-2001  bouyer Sync with HEAD.
 1.1.2.1 19-Jan-2001  bouyer file files.linux_powerpc was added on branch thorpej_scsipi on 2001-02-11 19:13:49 +0000
 1.3.2.1 30-May-2002  gehenna Catch up with -current.
 1.4.10.1 26-Jul-2004  tron Pull up revision 1.5 (requested by chs in ticket #715):
remove the LINUX_SP_WRAP hack since it doesn't seem to be needed anymore,
and removing it lets us go back to mapping the stack non-executable again.
 1.4.8.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.8.2 18-Sep-2004  skrll Sync with HEAD.
 1.4.8.1 03-Aug-2004  skrll Sync with HEAD
 1.5.12.2 04-Feb-2008  yamt sync with head.
 1.5.12.1 30-Dec-2006  yamt sync with head.
 1.6.8.1 03-Sep-2006  yamt sync with head.
 1.6.4.1 09-Sep-2006  rpaulo sync with head
 1.8.34.1 18-Feb-2008  mjf Sync with HEAD.
 1.8.28.1 23-Mar-2008  matt sync with HEAD
 1.9.32.2 31-May-2011  rmind sync with head
 1.9.32.1 05-Mar-2011  rmind sync with head
 1.9.30.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.9.10.1 11-Aug-2010  yamt sync with head.
 1.10.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.8 17-Dec-2013  njoly 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.7 28-Apr-2008  martin branches: 1.7.34; 1.7.44; 1.7.50;
Remove clause 3 and 4 from TNF licenses
 1.6 11-Dec-2005  christos branches: 1.6.70; 1.6.72; 1.6.74;
merge ktrace-lwp.
 1.5 26-Feb-2005  perry nuke trailing whitespace
 1.4 12-Feb-2001  manu branches: 1.4.24; 1.4.32; 1.4.34;
Clarified comments about the LINUX_SCERR_SIGN macro
 1.3 11-Feb-2001  manu Moved the fix for negative errno returned to userland on the PowerPC to a
more machine independent fashion
 1.2 04-Feb-2001  christos branches: 1.2.2;
cosmetic fixes.
 1.1 19-Jan-2001  manu Added Linux errno mapping for powerpc
 1.2.2.3 12-Mar-2001  bouyer Sync with HEAD.
 1.2.2.2 11-Feb-2001  bouyer Sync with HEAD.
 1.2.2.1 04-Feb-2001  bouyer file linux_errno.h was added on branch thorpej_scsipi on 2001-02-11 19:13:49 +0000
 1.4.34.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.4.32.1 29-Apr-2005  kent sync with -current
 1.4.24.1 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.6.74.1 16-May-2008  yamt sync with head.
 1.6.72.1 18-May-2008  yamt sync with head.
 1.6.70.1 02-Jun-2008  mjf Sync with HEAD.
 1.7.50.1 18-May-2014  rmind sync with head
 1.7.44.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.7.34.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.25 26-Nov-2021  ryo - LINUX_GO_RT0_SIGNATURE for compat_linux is no longer enabled by default.
it is now defined in each arch same as the other *_SIGNATURE definitions.
- add new LINUX32_GO_RT0_SIGNATURE for compat_linux32, and is defined in amd64 and aarch64.
 1.24 12-Feb-2017  chs es_arglen is now in units of bytes, update the emulations accordingly.
 1.23 09-Feb-2014  chs branches: 1.23.6; 1.23.10; 1.23.14;
account for the 16 bytes of AT_RANDOM data in the stack setup. fixes PR 48518.
use cprng_strong32() instead of random(). add AT_RANDOM support for linux32.
 1.22 25-Jan-2014  skrll More alignment spellos
 1.21 28-Apr-2008  martin branches: 1.21.34; 1.21.44; 1.21.50;
Remove clause 3 and 4 from TNF licenses
 1.20 11-Dec-2005  christos branches: 1.20.70; 1.20.72; 1.20.74;
merge ktrace-lwp.
 1.19 26-Feb-2005  perry nuke trailing whitespace
 1.18 25-Jul-2004  chs branches: 1.18.4; 1.18.6;
remove the LINUX_SP_WRAP hack since it doesn't seem to be needed anymore,
and removing it lets us go back to mapping the stack non-executable again.
 1.17 16-Jun-2004  manu COMPAT_LINUX/powerpc used the native stack setup routine, but now the
native version does non executable mappings on the stack. This is a
showstopper for Linux binaries.

To fix that we supply a copy f the native stack setup function for Linux
binaries, with the executable bit set.
 1.16 14-Aug-2003  christos branches: 1.16.2;
remove the args from the macro.
 1.15 08-Aug-2003  christos - GC all the setup_stack functions
- add one for linux/i386
 1.14 01-Mar-2003  thorpej branches: 1.14.2;
Do the syscall_plain/syscall_fancy dance on ARM. Shaves a fair number
of cycles off the syscall overhead.

Since all COMPAT_LINUX platforms now support __HAVE_SYSCALL_INTERN,
garbage-collect the LINUX_SYSCALL_FUNCTION stuff.
 1.13 13-Nov-2002  jdolecek add generic linux compat ELF copyargs function

this gives:
* linux sysconf(_SC_CLK_TCK) gives correct value for linux binaries (hz)
even if hz != 100
* glibc gets proper information on real/effective uid and enables
secure mode for suid binaries

g/c LINUX_COPYARGS_FUNCTION, replaced by linux ELF copyargs function
g/c alpha-specific linux ELF copyargs function and linux ELF defines
 1.12 13-Nov-2002  jdolecek need to use Aux32Info explicitly, not AuxInfo alone, to work
within context of kern/exec_conf.c
 1.11 13-Nov-2002  jdolecek eliminate remaining LinuxAuxInfo
 1.10 13-Nov-2002  jdolecek need to use LINUX_ELF_AUX_ENTRIES in LINUX_ELF_AUX_ARGSIZ
how this ever could have worked?
 1.9 13-Nov-2002  jdolecek use generic ELF AuxInfo, no need to define a 'linux' variant here
simplify LINUX_ELF_AUX_ARGSIZ definition, LINUX_SP_WRAP is always defined here
 1.8 26-Aug-2002  christos Implement passing AT_{E,R}{U,G}ID in the elf aux vector, like solaris.
- pass struct proc to copyargs.
- eliminate svr4_copyargs, since it is the same as ours now.
 1.7 12-Aug-2002  mrg don't need systm.h here
 1.6 17-Jan-2002  bjh21 branches: 1.6.8;
On platforms that don't __HAVE_SYSCALL_INTERN, define LINUX_SYSCALL_FUNCTION
to be the value of emul_linux.e_syscall that we want. This allows it to differ
between machines, so I can have a separate linux_syscall() on arm.
 1.5 30-Aug-2001  manu Enable the GCC signature test so that ld.so will be executable (needed for
Linux's ldd)
 1.4 29-Jul-2001  christos Adjust to the new copyargs() footprint.
 1.3 26-Jul-2001  wiz auxilliary -> auxiliary
 1.2 04-Feb-2001  christos branches: 1.2.2; 1.2.4; 1.2.6;
cosmetic fixes.
 1.1 19-Jan-2001  manu Added various header files for initial Linux compatibility on powerpc ports
 1.2.6.4 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.2.6.3 11-Feb-2002  jdolecek Sync w/ -current.
 1.2.6.2 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.2.6.1 03-Aug-2001  lukem update to -current
 1.2.4.6 11-Dec-2002  thorpej Sync with HEAD.
 1.2.4.5 27-Aug-2002  nathanw Catch up to -current.
 1.2.4.4 13-Aug-2002  nathanw Catch up to -current.
 1.2.4.3 28-Feb-2002  nathanw Catch up to -current.
 1.2.4.2 21-Sep-2001  nathanw Catch up to -current.
 1.2.4.1 24-Aug-2001  nathanw Catch up with -current.
 1.2.2.2 11-Feb-2001  bouyer Sync with HEAD.
 1.2.2.1 04-Feb-2001  bouyer file linux_exec.h was added on branch thorpej_scsipi on 2001-02-11 19:13:50 +0000
 1.6.8.1 29-Aug-2002  gehenna catch up with -current.
 1.14.2.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.14.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.14.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.14.2.1 03-Aug-2004  skrll Sync with HEAD
 1.16.2.2 26-Jul-2004  tron Pull up revision 1.18 (requested by chs in ticket #715):
remove the LINUX_SP_WRAP hack since it doesn't seem to be needed anymore,
and removing it lets us go back to mapping the stack non-executable again.
 1.16.2.1 19-Jun-2004  grant Pull up revision 1.17 (requested by manu in ticket #511):

COMPAT_LINUX/powerpc fixes for non-executable stack.
 1.18.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.18.4.1 29-Apr-2005  kent sync with -current
 1.20.74.1 16-May-2008  yamt sync with head.
 1.20.72.1 18-May-2008  yamt sync with head.
 1.20.70.1 02-Jun-2008  mjf Sync with HEAD.
 1.21.50.1 18-May-2014  rmind sync with head
 1.21.44.2 03-Dec-2017  jdolecek update from HEAD
 1.21.44.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.21.34.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.23.14.1 21-Apr-2017  bouyer Sync with HEAD
 1.23.10.1 20-Mar-2017  pgoyette Sync with HEAD
 1.23.6.1 28-Aug-2017  skrll Sync with HEAD
 1.25 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.24 21-Feb-2012  rjs branches: 1.24.32; 1.24.44;
Switch to ANSI style declaration.
 1.23 03-Feb-2012  matt branches: 1.23.2;
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.22 07-Jul-2010  chs branches: 1.22.8; 1.22.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.21 28-Apr-2008  martin branches: 1.21.20; 1.21.22;
Remove clause 3 and 4 from TNF licenses
 1.20 23-Jul-2006  ad branches: 1.20.54; 1.20.56; 1.20.58;
Use the LWP cached credentials where sane.
 1.19 15-May-2006  yamt include kauth.h for kauth_cred_getegid, etc.
 1.18 14-May-2006  elad integrate kauth.
 1.17 11-Dec-2005  christos branches: 1.17.4; 1.17.6; 1.17.8; 1.17.10; 1.17.12;
merge ktrace-lwp.
 1.16 26-Feb-2005  perry branches: 1.16.4;
nuke trailing whitespace
 1.15 25-Jul-2004  chs branches: 1.15.4; 1.15.6;
remove the LINUX_SP_WRAP hack since it doesn't seem to be needed anymore,
and removing it lets us go back to mapping the stack non-executable again.
 1.14 18-Jun-2004  manu include <sys/resourcevar.h>. It is not required for building -current,
but it is for -netbsd-2-0. Next step is to pull up the change...
 1.13 16-Jun-2004  manu COMPAT_LINUX/powerpc used the native stack setup routine, but now the
native version does non executable mappings on the stack. This is a
showstopper for Linux binaries.

To fix that we supply a copy f the native stack setup function for Linux
binaries, with the executable bit set.
 1.12 29-Jun-2003  fvdl branches: 1.12.2; 1.12.4;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.11 29-Jun-2003  darrenr 'struct proc *' -> 'struct lwp *' as required to get GENERIC for macppc built
 1.10 01-Apr-2003  thorpej Use PAGE_SIZE rather than NBPG.
 1.9 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.8 13-Nov-2002  jdolecek branches: 1.8.2;
use generic ELF AuxInfo, no need to define a 'linux' variant here
simplify LINUX_ELF_AUX_ARGSIZ definition, LINUX_SP_WRAP is always defined here
 1.7 26-Aug-2002  christos Implement passing AT_{E,R}{U,G}ID in the elf aux vector, like solaris.
- pass struct proc to copyargs.
- eliminate svr4_copyargs, since it is the same as ours now.
 1.6 13-Nov-2001  lukem branches: 1.6.8; 1.6.10;
add RCSIDs (including regeneration of files as appropriate)
 1.5 08-Aug-2001  christos PR/13652: Katsuomi Hamajima: Fix compile error.
 1.4 29-Jul-2001  christos Adjust to the new copyargs() footprint.
 1.3 13-Jun-2001  wiz branches: 1.3.2;
It's "extern int", not "extern".
Macppc kernels with LINUX_COMPAT now compile again.
 1.2 04-Feb-2001  christos branches: 1.2.2; 1.2.4;
cosmetic fixes.
 1.1 19-Jan-2001  manu Added powerpc specific code for Linux compatibility on powerpc ports
 1.2.4.7 11-Dec-2002  thorpej Sync with HEAD.
 1.2.4.6 27-Aug-2002  nathanw Catch up to -current.
 1.2.4.5 12-Jul-2002  nathanw No longer need to pull in lwp.h; proc.h pulls it in for us.
 1.2.4.4 24-Jun-2002  nathanw LWPify changes.
 1.2.4.3 14-Nov-2001  nathanw Catch up to -current.
 1.2.4.2 24-Aug-2001  nathanw Catch up with -current.
 1.2.4.1 21-Jun-2001  nathanw Catch up to -current.
 1.2.2.2 11-Feb-2001  bouyer Sync with HEAD.
 1.2.2.1 04-Feb-2001  bouyer file linux_exec_powerpc.c was added on branch thorpej_scsipi on 2001-02-11 19:13:50 +0000
 1.3.2.4 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.3.2.3 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.3.2.2 25-Aug-2001  thorpej Merge Aug 24 -current into the kqueue branch.
 1.3.2.1 03-Aug-2001  lukem update to -current
 1.6.10.2 18-Jun-2004  jmc Back out last commit. Only releng commits to the branches w/o prior approval
 1.6.10.1 18-Jun-2004  manu Include resourcevar.h, which is not required for building -current but
is for the 2.0 branch. Next step is a pull-up...
 1.6.8.1 29-Aug-2002  gehenna catch up with -current.
 1.8.2.1 18-Dec-2002  gmcgarry Merge pcred and ucred, and poolify. TBD: check backward compatibility
and factor-out some higher-level functionality.
 1.12.4.3 26-Jul-2004  tron Pull up revision 1.15 (requested by chs in ticket #715):
remove the LINUX_SP_WRAP hack since it doesn't seem to be needed anymore,
and removing it lets us go back to mapping the stack non-executable again.
 1.12.4.2 19-Jun-2004  grant Pull up revision 1.14 (requested by manu in ticket #511):

include <sys/resourcevar.h> for the netbsd-2-0 branch.
 1.12.4.1 19-Jun-2004  grant Pull up revision 1.13 (requested by manu in ticket #511):

COMPAT_LINUX/powerpc fixes for non-executable stack.
 1.12.2.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.12.2.4 18-Nov-2004  skrll Adapt to branch. macppc release builds.
 1.12.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.12.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.12.2.1 03-Aug-2004  skrll Sync with HEAD
 1.15.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.15.4.1 29-Apr-2005  kent sync with -current
 1.16.4.2 30-Dec-2006  yamt sync with head.
 1.16.4.1 21-Jun-2006  yamt sync with head.
 1.17.12.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.17.10.1 08-Mar-2006  elad Adapt to kernel authorization KPI.
 1.17.8.2 11-Aug-2006  yamt sync with head
 1.17.8.1 24-May-2006  yamt sync with head.
 1.17.6.1 01-Jun-2006  kardel Sync with head.
 1.17.4.1 09-Sep-2006  rpaulo sync with head
 1.20.58.2 11-Aug-2010  yamt sync with head.
 1.20.58.1 16-May-2008  yamt sync with head.
 1.20.56.1 18-May-2008  yamt sync with head.
 1.20.54.1 02-Jun-2008  mjf Sync with HEAD.
 1.21.22.1 05-Mar-2011  rmind sync with head
 1.21.20.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.22.12.2 24-Feb-2012  mrg sync to -current.
 1.22.12.1 18-Feb-2012  mrg merge to -current.
 1.22.8.1 17-Apr-2012  yamt sync with head
 1.23.2.1 24-Feb-2012  riz Pull up following revision(s) (requested by rjs in ticket #46):
sys/compat/linux/arch/powerpc/linux_exec_powerpc.c: revision 1.24
Switch to ANSI style declaration.
 1.24.44.1 03-Aug-2022  martin Pull up following revision(s), all via patch
(requested by riastradh in ticket #1487):

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

sys/compat: Memset zero before copyout.

Just in case of uninitialized padding which would lead to kernel
stack disclosure. If the compiler can prove the memset redundant
then it can optimize it away; otherwise better safe than sorry.
 1.24.32.1 21-Jun-2023  martin Pull up following revision(s) (requested by riastradh in ticket #1836):

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

sys/compat: Memset zero before copyout.

Just in case of uninitialized padding which would lead to kernel
stack disclosure. If the compiler can prove the memset redundant
then it can optimize it away; otherwise better safe than sorry.
 1.10 25-Jun-2014  njoly Add a few missing open(2) flags (LINUX_O_*). Fix alpha wrong values.
 1.9 02-Nov-2010  chs branches: 1.9.18; 1.9.32;
define LINUX_O_CLOEXEC.
sort definitions by value.
consistently use hex instead of octal for the values.
 1.8 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.7 28-Apr-2008  martin branches: 1.7.20; 1.7.22;
Remove clause 3 and 4 from TNF licenses
 1.6 11-Dec-2005  christos branches: 1.6.70; 1.6.72; 1.6.74;
merge ktrace-lwp.
 1.5 26-Feb-2005  perry nuke trailing whitespace
 1.4 30-Sep-2001  manu branches: 1.4.18; 1.4.26; 1.4.28;
Added initial support for fcntl64 system call (file locking is not
implemented)
 1.3 04-Feb-2001  christos branches: 1.3.2; 1.3.4; 1.3.6; 1.3.8;
cosmetic fixes.
 1.2 21-Jan-2001  manu Fixed wrong open() Linux flags definition (octal instead of hexadecimal)
 1.1 19-Jan-2001  manu Added various header files for initial Linux compatibility on powerpc ports
 1.3.8.1 01-Oct-2001  fvdl Catch up with -current.
 1.3.6.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.3.4.1 08-Oct-2001  nathanw Catch up to -current.
 1.3.2.2 11-Feb-2001  bouyer Sync with HEAD.
 1.3.2.1 04-Feb-2001  bouyer file linux_fcntl.h was added on branch thorpej_scsipi on 2001-02-11 19:13:50 +0000
 1.4.28.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.4.26.1 29-Apr-2005  kent sync with -current
 1.4.18.1 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.6.74.2 09-Oct-2010  yamt sync with head
 1.6.74.1 16-May-2008  yamt sync with head.
 1.6.72.1 18-May-2008  yamt sync with head.
 1.6.70.1 02-Jun-2008  mjf Sync with HEAD.
 1.7.22.1 05-Mar-2011  rmind sync with head
 1.7.20.2 06-Nov-2010  uebayasi Sync with HEAD.
 1.7.20.1 22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.9.32.1 10-Aug-2014  tls Rebase.
 1.9.18.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.2 08-Jun-2001  hannken branches: 1.2.120; 1.2.122; 1.2.124;
Close coment of CVS tag.
 1.1 19-Jan-2001  manu branches: 1.1.2; 1.1.4;
Added various header files for initial Linux compatibility on powerpc ports
 1.1.4.1 21-Jun-2001  nathanw Catch up to -current.
 1.1.2.2 11-Feb-2001  bouyer Sync with HEAD.
 1.1.2.1 19-Jan-2001  bouyer file linux_ioctl.h was added on branch thorpej_scsipi on 2001-02-11 19:13:51 +0000
 1.2.124.1 16-May-2008  yamt sync with head.
 1.2.122.1 18-May-2008  yamt sync with head.
 1.2.120.1 02-Jun-2008  mjf Sync with HEAD.
 1.51 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.50 03-May-2017  chs branches: 1.50.2; 1.50.14;
add missing arg to fpu_discard().
 1.49 16-Mar-2017  chs branches: 1.49.4;
allow pcu_save() and pcu_discard() to be called on other threads,
ptrace needs to use it that way.
 1.48 09-Nov-2014  maxv branches: 1.48.2; 1.48.4; 1.48.6;
Do not uselessly include <sys/malloc.h>.
 1.47 27-Jan-2013  mbalmer branches: 1.47.12;
exitting -> exiting.
 1.46 05-May-2011  matt branches: 1.46.4; 1.46.14;
Adapt to new PCU based FPU code.
 1.45 20-Jan-2011  he save_fpu_lwp() was renamed to fpu_save_lwp(), so follow suit.
 1.44 18-Jan-2011  matt branches: 1.44.2;
Deal with changes in the trapframe.
 1.43 14-Jan-2011  rmind branches: 1.43.2;
Retire struct user, remove sys/user.h inclusions. Note sys/user.h header
as obsolete. Remove USER_TO_UAREA/UAREA_TO_USER macros.

Various #include fixes and review by matt@.
 1.42 07-Jul-2010  chs many changes for COMPAT_LINUX:
- update the linux syscall table for each platform.
- support new-style (NPTL) linux pthreads on all platforms.
clone() with CLONE_THREAD uses 1 process with many LWPs
instead of separate processes.
- move the contents of sys__lwp_setprivate() into a new
lwp_setprivate() and use that everywhere.
- update linux_release[] and linux32_release[] to "2.6.18".
- adjust placement of emul fork/exec/exit hooks as needed
and adjust other emul code to match.
- convert all struct emul definitions to use named initializers.
- change the pid allocator to allow multiple pids to refer to the same proc.
- remove a few fields from struct proc that are no longer needed.
- disable the non-functional "vdso" code in linux32/amd64,
glibc works fine without it.
- fix a race in the futex code where we could miss a wakeup after
a requeue operation.
- redo futex locking to be a little more efficient.
 1.41 02-Feb-2010  wiz branches: 1.41.2; 1.41.4;
Missing printf in sys/compat/linux/arch/powerpc/linux_machdep.c
found by cppcheck and reported by Henning Petersen in PR 42720.
 1.40 23-Nov-2009  rmind Use lwp_getpcb() in compat code, clean from struct user.
 1.39 28-Apr-2008  martin branches: 1.39.2; 1.39.22;
Remove clause 3 and 4 from TNF licenses
 1.38 24-Apr-2008  ad branches: 1.38.2;
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.37 20-Dec-2007  dsl branches: 1.37.6; 1.37.8;
Convert all the system call entry points from:
int foo(struct lwp *l, void *v, register_t *retval)
to:
int foo(struct lwp *l, const struct foo_args *uap, register_t *retval)
Fixup compat code to not write into 'uap' and (in some cases) to actually
pass a correctly formatted 'uap' structure with the right name to the
next routine.
A few 'compat' routines that just call standard ones have been deleted.
All the 'compat' code compiles (along with the kernels required to test
build it).
98% done by automated scripts.
 1.36 08-Dec-2007  dsl branches: 1.36.4;
ANSIfy most of the function definitions in sys/compat (but not ndis).
All by the magic of sed ...
 1.35 19-Oct-2007  ad branches: 1.35.4;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.34 05-Mar-2007  tsutsui branches: 1.34.2; 1.34.14; 1.34.16; 1.34.20;
Use (char *) cast on pointer arith.
 1.33 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.32 09-Feb-2007  ad branches: 1.32.2;
Merge newlock2 to head.
 1.31 11-Dec-2005  christos branches: 1.31.20;
merge ktrace-lwp.
 1.30 20-May-2005  fvdl branches: 1.30.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.29 26-Feb-2005  perry nuke trailing whitespace
 1.28 17-Apr-2004  matt branches: 1.28.4; 1.28.6;
Switch to using PSL_USEROK_P()
Use new save_fpu_lwp sematics to save or discard the fpu state appropriately.
 1.27 26-Mar-2004  drochner all ports define __HAVE_SIGINFO now, so remove the CPP conditionals
 1.26 08-Oct-2003  thorpej Use ksi_signo accessor macro.
 1.25 26-Sep-2003  simonb Fix "constify sendsig/trapsignal" fallout for non-siginfo'd archs. Test
compiled on most architectures.
 1.24 25-Sep-2003  christos constify sendsig/trapsignal
 1.23 25-Sep-2003  matt Add siginfo support for PowerPC.
 1.22 29-Jun-2003  fvdl branches: 1.22.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.21 29-Jun-2003  darrenr 'struct proc *' -> 'struct lwp *' as required to get GENERIC for macppc built
 1.20 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.19 25-Sep-2002  thorpej Don't include <sys/map.h>.
 1.18 28-Jul-2002  chs restructure the FPU and AltiVEC code so that it works for MP.
 1.17 09-Jul-2002  matt Change fpuproc to curcpu()->ci_fpuproc.
 1.16 04-Jul-2002  thorpej Add kernel support for having userland provide the signal trampoline:

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

Changes to libc to use the new facility will be checked in later. Kernel
version not bumped; we will ride the 1.6C bump made recently.
 1.15 20-May-2002  jdolecek whitespace fixes
 1.14 31-Mar-2002  christos branches: 1.14.2;
make signal array handling uniform, and put signal arrays in a separate
file. This is simular to errno array handling.
 1.13 15-Feb-2002  christos - add a real linux_sys___sysctl because the mib numbers are different.
implement only the kernel version getting entries.
- make the signal conversion functions consistent; dest is arg 1.
- make linux_fakedev deal with block and char devices differently.
- add linux_sys_ugetrlimit, and flesh out the regular get/setrlimit so
that they work properly.
- add linux_mmap2 [untested].
- bump kernel to 2.4.18, and make the date be valentine's day :-)
- linux_sys_*stat64 family was totally busted. Fix it.

tested only on i386.

Status:
gdb, telnet, work
jdk-1.4.0 extractor works, jdk still coredumps.

christos
 1.12 13-Nov-2001  lukem add RCSIDs (including regeneration of files as appropriate)
 1.11 13-Jun-2001  wiz branches: 1.11.2;
#include <machine/fpu.h> for save_fpu()
#ifdef 0 two unused and un-prototyped functions.
Following a hint by Andrw Cagney on port-macppc.
 1.10 30-May-2001  mrg use _KERNEL_OPT.
 1.9 27-May-2001  manu Fixed two typo in comments
 1.8 11-Apr-2001  manu Integrated security review for signal delivery by Wolfgang Solfrank
 1.7 22-Mar-2001  manu Added a missing native to linux signal number translation in linux_sendsig(),
when building the trap frape
 1.6 18-Mar-2001  manu Fixed typos in comments
 1.5 05-Feb-2001  manu branches: 1.5.2; 1.5.4;
Modified a cast so that it builds again
 1.4 04-Feb-2001  christos cosmetic fixes.
 1.3 26-Jan-2001  manu Moved include <sys/ioctl.h> so that we can build without WSCONS enabled.
 1.2 25-Jan-2001  manu Fixed wrong signal handler argument setup. The emulated sigcontext still has some problems.
 1.1 19-Jan-2001  manu Added powerpc specific code for Linux compatibility on powerpc ports
 1.5.4.11 18-Oct-2002  nathanw Catch up to -current.
 1.5.4.10 02-Aug-2002  nathanw LWPify.
 1.5.4.9 01-Aug-2002  nathanw Catch up to -current.
 1.5.4.8 24-Jun-2002  nathanw LWPify changes.
 1.5.4.7 20-Jun-2002  nathanw Catch up to -current.
 1.5.4.6 29-May-2002  nathanw #include <sys/sa.h> before <sys/syscallargs.h>, to provide sa_upcall_t
now that <sys/param.h> doesn't include <sys/sa.h>.

(Behold the Power of Ed)
 1.5.4.5 17-Apr-2002  nathanw Catch up to -current.
 1.5.4.4 28-Feb-2002  nathanw Catch up to -current.
 1.5.4.3 14-Nov-2001  nathanw Catch up to -current.
 1.5.4.2 21-Jun-2001  nathanw Catch up to -current.
 1.5.4.1 09-Apr-2001  nathanw Catch up with -current.
 1.5.2.4 21-Apr-2001  bouyer Sync with HEAD
 1.5.2.3 27-Mar-2001  bouyer Sync with HEAD.
 1.5.2.2 11-Feb-2001  bouyer Sync with HEAD.
 1.5.2.1 05-Feb-2001  bouyer file linux_machdep.c was added on branch thorpej_scsipi on 2001-02-11 19:13:51 +0000
 1.11.2.5 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.11.2.4 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.11.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.11.2.2 16-Mar-2002  jdolecek Catch up with -current.
 1.11.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.14.2.3 29-Aug-2002  gehenna catch up with -current.
 1.14.2.2 15-Jul-2002  gehenna catch up with -current.
 1.14.2.1 30-May-2002  gehenna Catch up with -current.
 1.22.2.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.22.2.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.22.2.4 18-Nov-2004  skrll Adapt to branch. macppc release builds.
 1.22.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.22.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.22.2.1 03-Aug-2004  skrll Sync with HEAD
 1.28.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.28.4.1 29-Apr-2005  kent sync with -current
 1.30.2.5 21-Jan-2008  yamt sync with head
 1.30.2.4 27-Oct-2007  yamt sync with head.
 1.30.2.3 03-Sep-2007  yamt sync with head.
 1.30.2.2 26-Feb-2007  yamt sync with head.
 1.30.2.1 21-Jun-2006  yamt sync with head.
 1.31.20.3 06-Feb-2007  ad More compat changes.

XXX compat_irix, compat_mach and compat_darwin need work.
 1.31.20.2 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.31.20.1 27-Jan-2007  ad More compat changes.
 1.32.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.34.20.1 25-Oct-2007  bouyer Sync with HEAD.
 1.34.16.2 09-Jan-2008  matt sync with HEAD
 1.34.16.1 06-Nov-2007  matt sync with HEAD
 1.34.14.2 09-Dec-2007  jmcneill Sync with HEAD.
 1.34.14.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.34.2.1 23-Oct-2007  ad Sync with head.
 1.35.4.1 26-Dec-2007  ad Sync with head.
 1.36.4.1 02-Jan-2008  bouyer Sync with HEAD
 1.37.8.1 18-May-2008  yamt sync with head.
 1.37.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.38.2.3 11-Aug-2010  yamt sync with head.
 1.38.2.2 11-Mar-2010  yamt sync with head
 1.38.2.1 16-May-2008  yamt sync with head.
 1.39.22.1 07-Jan-2011  matt Deal with the trapframe changes.
 1.39.2.3 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.39.2.2 14-May-2008  wrstuden Per discussion with ad, remove most of the #include <sys/sa.h> lines
as they were including sa.h just for the type(s) needed for syscallargs.h.

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

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

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

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

Also, kern_sa.c has received partial cleanup. There's still more
to do, though.
 1.41.4.2 31-May-2011  rmind sync with head
 1.41.4.1 05-Mar-2011  rmind sync with head
 1.41.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.43.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.44.2.1 08-Feb-2011  bouyer Sync with HEAD
 1.46.14.2 03-Dec-2017  jdolecek update from HEAD
 1.46.14.1 25-Feb-2013  tls resync with head
 1.46.4.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.47.12.1 17-Jan-2015  martin Pull up following revision(s) (requested by maxv in ticket #427):
sys/compat/svr4/svr4_schedctl.c: revision 1.8
sys/netinet/tcp_timer.c: revision 1.88
sys/miscfs/genfs/layer_vfsops.c: revision 1.45
sys/compat/svr4/svr4_ioctl.c: revision 1.37
sys/ufs/chfs/chfs_vfsops.c: revision 1.14
sys/miscfs/fdesc/fdesc_vfsops.c: revision 1.91
sys/compat/linux/arch/i386/linux_ptrace.c: revision 1.30
sys/compat/common/kern_time_50.c: revision 1.28
sys/netinet6/ip6_forward.c: revision 1.74
sys/miscfs/umapfs/umap_vnops.c: revision 1.57
sys/compat/svr4/svr4_fcntl.c: revision 1.74
distrib/sets/lists/comp/mi: revision 1.1931
sys/netinet6/udp6_output.c: revision 1.46
sys/fs/puffs/puffs_compat.c: revision 1.3
sys/fs/udf/udf_rename.c: revision 1.11
sys/compat/svr4/svr4_filio.c: revision 1.24
sys/fs/udf/udf_rename.c: revision 1.12
sys/netinet/tcp_usrreq.c: revision 1.202
sys/miscfs/umapfs/umap_subr.c: revision 1.29
sys/compat/linux/common/linux_fadvise64.c: revision 1.3
sys/netinet/if_atm.c: revision 1.34
sys/miscfs/procfs/procfs_subr.c: revision 1.106
sys/miscfs/genfs/layer_subr.c: revision 1.37
sys/netinet/tcp_sack.c: revision 1.30
sys/compat/freebsd/freebsd_misc.c: revision 1.33
sys/compat/freebsd/freebsd_file.c: revision 1.33
sys/ufs/chfs/chfs_vnode.c: revision 1.12
sys/compat/svr4/svr4_ttold.c: revision 1.34
sys/compat/linux/common/linux_file.c: revision 1.114
sys/compat/linux/arch/mips/linux_machdep.c: revision 1.43
sys/compat/linux/common/linux_signal.c: revision 1.76
sys/compat/common/compat_util.c: revision 1.46
sys/compat/linux/arch/arm/linux_ptrace.c: revision 1.18
sys/compat/svr4/svr4_sockio.c: revision 1.36
sys/compat/linux/arch/arm/linux_machdep.c: revision 1.32
sys/compat/svr4/svr4_signal.c: revision 1.66
sys/kern/kern_exec.c: revision 1.410
sys/fs/puffs/puffs_vfsops.c: revision 1.115
sys/compat/svr4/svr4_exec_elf64.c: revision 1.15
sys/compat/linux/arch/i386/linux_machdep.c: revision 1.159
sys/compat/linux/arch/alpha/linux_machdep.c: revision 1.50
sys/compat/linux32/common/linux32_misc.c: revision 1.24
sys/netinet/in_pcb.c: revision 1.153
sys/sys/malloc.h: revision 1.116
sys/compat/common/if_43.c: revision 1.9
share/man/man9/Makefile: revision 1.380
sys/netinet/tcp_vtw.c: revision 1.12
sys/miscfs/umapfs/umap_vfsops.c: revision 1.95
sys/ufs/ext2fs/ext2fs_vfsops.c: revision 1.186
sys/compat/common/uipc_syscalls_43.c: revision 1.46
sys/ufs/ext2fs/ext2fs_vnops.c: revision 1.115
sys/fs/puffs/puffs_msgif.c: revision 1.97
sys/compat/svr4/svr4_ipc.c: revision 1.27
sys/compat/linux/common/linux_exec.c: revision 1.117
sys/ufs/ext2fs/ext2fs_readwrite.c: revision 1.66
sys/netinet/tcp_output.c: revision 1.179
sys/compat/svr4/svr4_termios.c: revision 1.28
sys/fs/udf/udf_strat_bootstrap.c: revision 1.4
sys/fs/puffs/puffs_subr.c: revision 1.67
sys/fs/puffs/puffs_node.c: revision 1.36
sys/miscfs/overlay/overlay_vnops.c: revision 1.21
sys/fs/cd9660/cd9660_node.c: revision 1.34
sys/netinet/raw_ip.c: revision 1.146
sys/sys/mallocvar.h: revision 1.13
sys/miscfs/overlay/overlay_vfsops.c: revision 1.63
share/man/man9/malloc.9: revision 1.50
sys/netinet6/dest6.c: revision 1.18
sys/compat/linux/common/linux_uselib.c: revision 1.33
sys/compat/linux/common/linux_socket.c: revision 1.120
share/man/man9/malloc.9: revision 1.51
sys/netinet/tcp_subr.c: revision 1.257
sys/compat/linux/common/linux_socketcall.c: revision 1.45
sys/compat/linux/common/linux_fadvise64_64.c: revision 1.3
sys/compat/freebsd/freebsd_ipc.c: revision 1.17
sys/compat/linux/common/linux_misc_notalpha.c: revision 1.109
sys/compat/linux/arch/alpha/linux_pipe.c: revision 1.17
sys/netinet6/in6_pcb.c: revision 1.132
sys/netinet6/in6_ifattach.c: revision 1.94
sys/compat/svr4/svr4_exec_elf32.c: revision 1.15
sys/miscfs/nullfs/null_vfsops.c: revision 1.90
sys/fs/cd9660/cd9660_util.c: revision 1.12
sys/compat/linux/arch/powerpc/linux_machdep.c: revision 1.48
sys/compat/freebsd/freebsd_exec_elf32.c: revision 1.20
sys/miscfs/procfs/procfs_vfsops.c: revision 1.94
sys/compat/linux/arch/powerpc/linux_ptrace.c: revision 1.28
sys/compat/linux/common/linux_sched.c: revision 1.67
sys/compat/linux/common/linux_exec_aout.c: revision 1.67
sys/compat/linux/common/linux_pipe.c: revision 1.67
sys/compat/linux/common/linux_llseek.c: revision 1.34
sys/compat/linux/arch/mips/linux_ptrace.c: revision 1.10
Do not uselessly include <sys/malloc.h>.
Cleanup:
- remove struct kmembuckets (dead)
- correctly deadify MALLOC_XX
- remove MALLOC_DEFINE_LIMIT and MALLOC_JUSTDEFINE_LIMIT (dead)
- remove malloc_roundup(), malloc_type_setlimit(), MALLOC_DEFINE_LIMIT()
and MALLOC_JUSTDEFINE_LIMIT() from man 9 malloc
New sentence, new line. Bump date for previous.
Obsolete malloc_roundup(9), malloc_type_setlimit(9) and MALLOC_DEFINE_LIMIT(9)
man pages.
 1.48.6.1 21-Apr-2017  bouyer Sync with HEAD
 1.48.4.1 20-Mar-2017  pgoyette Sync with HEAD
 1.48.2.1 28-Aug-2017  skrll Sync with HEAD
 1.49.4.1 11-May-2017  pgoyette Sync with HEAD
 1.50.14.1 03-Aug-2022  martin Pull up following revision(s), all via patch
(requested by riastradh in ticket #1487):

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

sys/compat: Memset zero before copyout.

Just in case of uninitialized padding which would lead to kernel
stack disclosure. If the compiler can prove the memset redundant
then it can optimize it away; otherwise better safe than sorry.
 1.50.2.1 21-Jun-2023  martin Pull up following revision(s) (requested by riastradh in ticket #1836):

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

sys/compat: Memset zero before copyout.

Just in case of uninitialized padding which would lead to kernel
stack disclosure. If the compiler can prove the memset redundant
then it can optimize it away; otherwise better safe than sorry.
 1.12 19-May-2025  andvar spelling and grammar fixes in comments.
 1.11 03-Dec-2021  andvar branches: 1.11.10;
fix various typos in comments, log messages and documentation.
 1.10 12-Nov-2008  ad Remove LKMs and switch to the module framework, pass 1.

Proposed on tech-kern@.
 1.9 28-Apr-2008  martin branches: 1.9.6; 1.9.8;
Remove clause 3 and 4 from TNF licenses
 1.8 04-Dec-2007  dsl branches: 1.8.12; 1.8.14; 1.8.16;
Remove all the __P
 1.7 11-Nov-2005  chs branches: 1.7.46; 1.7.48; 1.7.54; 1.7.58;
include additional headers that are now needed.
 1.6 26-Feb-2005  perry branches: 1.6.4;
nuke trailing whitespace
 1.5 06-Sep-2002  gehenna branches: 1.5.6; 1.5.14; 1.5.16;
Merge the gehenna-devsw branch into the trunk.

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

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

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

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

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

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

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

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

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.
 1.4 15-Feb-2002  christos branches: 1.4.8;
- add a real linux_sys___sysctl because the mib numbers are different.
implement only the kernel version getting entries.
- make the signal conversion functions consistent; dest is arg 1.
- make linux_fakedev deal with block and char devices differently.
- add linux_sys_ugetrlimit, and flesh out the regular get/setrlimit so
that they work properly.
- add linux_mmap2 [untested].
- bump kernel to 2.4.18, and make the date be valentine's day :-)
- linux_sys_*stat64 family was totally busted. Fix it.

tested only on i386.

Status:
gdb, telnet, work
jdk-1.4.0 extractor works, jdk still coredumps.

christos
 1.3 27-May-2001  manu branches: 1.3.2;
Fixed two typo in comments
 1.2 12-Apr-2001  manu Fixed an error in a comment
 1.1 19-Jan-2001  manu branches: 1.1.2; 1.1.4;
Added various header files for initial Linux compatibility on powerpc ports
 1.1.4.3 17-Sep-2002  nathanw Catch up to -current.
 1.1.4.2 28-Feb-2002  nathanw Catch up to -current.
 1.1.4.1 21-Jun-2001  nathanw Catch up to -current.
 1.1.2.3 21-Apr-2001  bouyer Sync with HEAD
 1.1.2.2 11-Feb-2001  bouyer Sync with HEAD.
 1.1.2.1 19-Jan-2001  bouyer file linux_machdep.h was added on branch thorpej_scsipi on 2001-02-11 19:13:51 +0000
 1.3.2.2 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.3.2.1 16-Mar-2002  jdolecek Catch up with -current.
 1.4.8.1 16-May-2002  gehenna Remove a hard-coded device major.
 1.5.16.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.5.14.1 29-Apr-2005  kent sync with -current
 1.5.6.2 11-Dec-2005  christos Sync with head.
 1.5.6.1 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.6.4.2 07-Dec-2007  yamt sync with head
 1.6.4.1 21-Jun-2006  yamt sync with head.
 1.7.58.1 08-Dec-2007  ad Sync with head.
 1.7.54.1 08-Dec-2007  mjf Sync with HEAD.
 1.7.48.1 09-Jan-2008  matt sync with HEAD
 1.7.46.1 09-Dec-2007  jmcneill Sync with HEAD.
 1.8.16.2 04-May-2009  yamt sync with head.
 1.8.16.1 16-May-2008  yamt sync with head.
 1.8.14.1 18-May-2008  yamt sync with head.
 1.8.12.2 17-Jan-2009  mjf Sync with HEAD.
 1.8.12.1 02-Jun-2008  mjf Sync with HEAD.
 1.9.8.1 19-Jan-2009  skrll Sync with HEAD.
 1.9.6.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.11.10.1 02-Aug-2025  perseant Sync with HEAD
 1.7 14-Mar-2015  njoly Support Linux MAP_LOCKED mmap flag.
 1.6 28-Apr-2008  martin branches: 1.6.44; 1.6.64;
Remove clause 3 and 4 from TNF licenses
 1.5 11-Dec-2005  christos branches: 1.5.70; 1.5.72; 1.5.74;
merge ktrace-lwp.
 1.4 26-Feb-2005  perry nuke trailing whitespace
 1.3 08-Sep-2001  manu branches: 1.3.18; 1.3.26; 1.3.28;
Removed a hack to make PowerPC mmap work. This could have side effects on
alpha and i386. It has been tested and works on i386.
 1.2 19-Jan-2001  manu branches: 1.2.2; 1.2.4; 1.2.6;
Added various header files for initial Linux compatibility on powerpc ports
 1.1 30-Sep-1998  erh branches: 1.1.12;
Stubs for future development of linux compat architechtures.
 1.1.12.1 11-Feb-2001  bouyer Sync with HEAD.
 1.2.6.1 01-Oct-2001  fvdl Catch up with -current.
 1.2.4.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.2.2.1 21-Sep-2001  nathanw Catch up to -current.
 1.3.28.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.3.26.1 29-Apr-2005  kent sync with -current
 1.3.18.1 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.5.74.1 16-May-2008  yamt sync with head.
 1.5.72.1 18-May-2008  yamt sync with head.
 1.5.70.1 02-Jun-2008  mjf Sync with HEAD.
 1.6.64.1 06-Apr-2015  skrll Sync with HEAD
 1.6.44.1 03-Dec-2017  jdolecek update from HEAD
 1.2 08-Sep-2001  manu Removed a hack to make PowerPC mmap work. This could have side effects on
alpha and i386. It has been tested and works on i386.
 1.1 19-Jan-2001  manu branches: 1.1.2; 1.1.4; 1.1.6; 1.1.8;
Added powerpc specific code for Linux compatibility on powerpc ports
 1.1.8.1 01-Oct-2001  fvdl Catch up with -current.
 1.1.6.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.1.4.1 28-Feb-2002  nathanw Catch up to -current.
 1.1.2.2 11-Feb-2001  bouyer Sync with HEAD.
 1.1.2.1 19-Jan-2001  bouyer file linux_mmap_powerpc.c was added on branch thorpej_scsipi on 2001-02-11 19:13:52 +0000
 1.34 05-Sep-2022  tsutsui G/C ISSET() macro copies. It has been defined in <sys/types.h> since 2006.
 1.33 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.32 23-May-2020  ad Move proc_lock into the data segment. It was dynamically allocated because
at the time we had mutex_obj_alloc() but not __cacheline_aligned.
 1.31 03-Sep-2018  riastradh branches: 1.31.4;
Rename min/max -> uimin/uimax for better honesty.

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

HOWEVER! Some subsystems have

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

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

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

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

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

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

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate. But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all. (Who knows, maybe in some cases integer
truncation is actually intended!)
 1.30 28-Aug-2017  kamil branches: 1.30.2; 1.30.4;
Remove the filesystem tracing feature

This is a legacy interface from 4.4BSD, and it was
introduced to overcome shortcomings of ptrace(2) at that time, which are
no longer relevant (performance). Today /proc/#/ctl offers a narrow
subset of ptrace(2) commands and is not applicable for modern
applications use beyond simplistic tracing scenarios.

This removal will simplify kernel internals. Users will still be able to
use all the other /proc files.

This change won't affect other procfs files neither Linux compat
features within mount_procfs(8). /proc/#/ctl isn't available on Linux.

Remove:
- /proc/#/ctl from mount_procfs(8)
- P_FSTRACE note from the documentation of ps(1)
- /proc/#/ctl and filesystem tracing documentation from mount_procfs(8)
- KAUTH_REQ_PROCESS_PROCFS_CTL documentation from kauth(9)
- source code file miscfs/procfs/procfs_ctl.c
- PFSctl and procfs_doctl() from sys/miscfs/procfs/procfs.h
- KAUTH_REQ_PROCESS_PROCFS_CTL from sys/sys/kauth.h
- PSL_FSTRACE (0x00010000) from sys/sys/proc.h
- P_FSTRACE (0x00010000) from sys/sys/sysctl.h

Reduce code complexity after removal of this functionality.

Update TODO.ptrace accordingly: remove two entries about /proc tracing.

Do not keep legacy notes as comments in the headers about removed
PSL_FSTRACE / P_FSTRACE, as this interface had little number of users
(close or equal to zero).

Proposed on tech-kern@.

All filesystem tracing utility users are encouraged to switch to ptrace(2).

Sponsored by <The NetBSD Foundation>
 1.29 13-Oct-2015  pgoyette branches: 1.29.10;
Don't release proc_lock until we're done looking at things that are
protected by the lock, particularly p_stat and p_waited. Found by
Robert Elz.

XXX Pullup to NetBSD-7, -6, -6-0, and -6-1
 1.28 09-Nov-2014  maxv branches: 1.28.2;
Do not uselessly include <sys/malloc.h>.
 1.27 26-Sep-2014  christos set error return on error (from max)
 1.26 21-Sep-2014  christos fix leak
 1.25 15-Apr-2014  maxv branches: 1.25.2;
There are two times the same branches.

} else if (addr == LUSR_OFF(__signal)) {
error = ENOTSUP;
} else if (addr == LUSR_OFF(__signal)) {
error = ENOTSUP;
}

Just delete one of them. Spotted by my code scanner.

ok christos@
 1.24 04-Jan-2014  dsl branches: 1.24.2;
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.23 01-Jul-2010  rmind branches: 1.23.8; 1.23.14; 1.23.18; 1.23.20; 1.23.22; 1.23.28;
Remove pfind() and pgfind(), fix locking in various broken uses of these.
Rename real routines to proc_find() and pgrp_find(), remove PFIND_* flags
and have consistent behaviour. Provide proc_find_raw() for special cases.
Fix memory leak in sysctl_proc_corename().

COMPAT_LINUX: rework ptrace() locking, minimise differences between
different versions per-arch.

Note: while this change adds some formal cosmetics for COMPAT_DARWIN and
COMPAT_IRIX - locking there is utterly broken (for ages).

Fixes PR/43176.
 1.22 21-Oct-2009  rmind branches: 1.22.2; 1.22.4;
Remove uarea swap-out functionality:

- Addresses the issue described in PR/38828.
- Some simplification in threading and sleepq subsystems.
- Eliminates pmap_collect() and, as a side note, allows pmap optimisations.
- Eliminates XS_CTL_DATA_ONSTACK in scsipi code.
- Avoids few scans on LWP list and thus potentially long holds of proc_lock.
- Cuts ~1.5k lines of code. Reduces amd64 kernel size by ~4k.
- Removes __SWAP_BROKEN cases.

Tested on x86, mips, acorn32 (thanks <mpumford>) and partly tested on
acorn26 (thanks to <bjh21>).

Discussed on <tech-kern>, reviewed by <ad>.
 1.21 17-Dec-2008  cegger kill MALLOC and FREE macros.
 1.20 12-Nov-2008  ad Remove LKMs and switch to the module framework, pass 1.

Proposed on tech-kern@.
 1.19 28-Apr-2008  martin branches: 1.19.2; 1.19.6; 1.19.8;
Remove clause 3 and 4 from TNF licenses
 1.18 23-Apr-2008  ad branches: 1.18.2;
Disable bitrotted linux ptrace interfaces, which are likely now a
security hole. Can be re-enabled at runtime. If you want to repair
them please look at the native implementation.
 1.17 20-Dec-2007  dsl branches: 1.17.6; 1.17.8;
Convert all the system call entry points from:
int foo(struct lwp *l, void *v, register_t *retval)
to:
int foo(struct lwp *l, const struct foo_args *uap, register_t *retval)
Fixup compat code to not write into 'uap' and (in some cases) to actually
pass a correctly formatted 'uap' structure with the right name to the
next routine.
A few 'compat' routines that just call standard ones have been deleted.
All the 'compat' code compiles (along with the kernels required to test
build it).
98% done by automated scripts.
 1.16 09-Jul-2007  ad branches: 1.16.8; 1.16.16; 1.16.20;
Merge some of the less invasive changes from the vmlocking branch:

- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
 1.15 04-Mar-2007  christos branches: 1.15.2; 1.15.4;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.14 09-Feb-2007  ad branches: 1.14.2;
Merge newlock2 to head.
 1.13 30-Aug-2006  matt branches: 1.13.2;
Update to deal with options PTRACE
 1.12 11-Dec-2005  christos branches: 1.12.4; 1.12.8;
merge ktrace-lwp.
 1.11 26-Feb-2005  perry branches: 1.11.4;
nuke trailing whitespace
 1.10 18-Jan-2003  thorpej branches: 1.10.2; 1.10.10; 1.10.12;
Merge the nathanw_sa branch.
 1.9 15-Nov-2001  lukem don't need <sys/types.h> when including <sys/param.h>
 1.8 13-Nov-2001  lukem add RCSIDs (including regeneration of files as appropriate)
 1.7 02-Jun-2001  manu branches: 1.7.2;
Fixed a rough buf in ptrace SETFPREGS (was using regs instead of fpregs)
 1.6 28-May-2001  manu Fixed a potential security problem (copyout after an error)
 1.5 27-May-2001  manu Implements correctly PEEKUSER and fixes various serious bugs. The status
of this file is not "officially broken" any more (gdb works).
 1.4 22-May-2001  manu Fixed ptrace() so that it is now possible to get traced process registers.
This makes Linux gdb able to run a Linux binary
 1.3 04-Feb-2001  christos branches: 1.3.2; 1.3.4;
cosmetic fixes.
 1.2 04-Feb-2001  manu Fixed a bug in Linux/powerpc ktrace support (it's still broken, anyway)
 1.1 19-Jan-2001  manu Added powerpc specific code for Linux compatibility on powerpc ports
 1.3.4.5 24-Jun-2002  nathanw LWPify changes.
 1.3.4.4 29-May-2002  nathanw #include <sys/sa.h> before <sys/syscallargs.h>, to provide sa_upcall_t
now that <sys/param.h> doesn't include <sys/sa.h>.

(Behold the Power of Ed)
 1.3.4.3 08-Jan-2002  nathanw Catch up to -current.
 1.3.4.2 14-Nov-2001  nathanw Catch up to -current.
 1.3.4.1 21-Jun-2001  nathanw Catch up to -current.
 1.3.2.2 11-Feb-2001  bouyer Sync with HEAD.
 1.3.2.1 04-Feb-2001  bouyer file linux_ptrace.c was added on branch thorpej_scsipi on 2001-02-11 19:13:52 +0000
 1.7.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.10.12.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.10.10.1 29-Apr-2005  kent sync with -current
 1.10.2.1 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.11.4.4 21-Jan-2008  yamt sync with head
 1.11.4.3 03-Sep-2007  yamt sync with head.
 1.11.4.2 26-Feb-2007  yamt sync with head.
 1.11.4.1 30-Dec-2006  yamt sync with head.
 1.12.8.1 03-Sep-2006  yamt sync with head.
 1.12.4.1 09-Sep-2006  rpaulo sync with head
 1.13.2.2 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.13.2.1 28-Jan-2007  ad powerpc changes.
 1.14.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.15.4.1 11-Jul-2007  mjf Sync with head.
 1.15.2.1 05-Apr-2007  ad Compile fixes.
 1.16.20.1 02-Jan-2008  bouyer Sync with HEAD
 1.16.16.1 26-Dec-2007  ad Sync with head.
 1.16.8.1 09-Jan-2008  matt sync with HEAD
 1.17.8.1 18-May-2008  yamt sync with head.
 1.17.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.17.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.18.2.4 11-Aug-2010  yamt sync with head.
 1.18.2.3 11-Mar-2010  yamt sync with head
 1.18.2.2 04-May-2009  yamt sync with head.
 1.18.2.1 16-May-2008  yamt sync with head.
 1.19.8.1 19-Jan-2009  skrll Sync with HEAD.
 1.19.6.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.19.2.2 14-May-2008  wrstuden Per discussion with ad, remove most of the #include <sys/sa.h> lines
as they were including sa.h just for the type(s) needed for syscallargs.h.

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

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

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

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

Also, kern_sa.c has received partial cleanup. There's still more
to do, though.
 1.22.4.1 03-Jul-2010  rmind sync with head
 1.22.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.23.28.1 15-Nov-2015  bouyer Pull up following revision(s) (requested by pgoyette in ticket #1335):
sys/compat/linux/arch/i386/linux_ptrace.c: revision 1.31
sys/compat/linux/arch/arm/linux_ptrace.c: revision 1.19
sys/compat/linux/arch/powerpc/linux_ptrace.c: revision 1.29
Don't release proc_lock until we're done looking at things that are
protected by the lock, particularly p_stat and p_waited. Found by
Robert Elz.
XXX Pullup to NetBSD-7, -6, -6-0, and -6-1
 1.23.22.1 18-May-2014  rmind sync with head
 1.23.20.1 15-Nov-2015  bouyer Pull up following revision(s) (requested by pgoyette in ticket #1335):
sys/compat/linux/arch/i386/linux_ptrace.c: revision 1.31
sys/compat/linux/arch/arm/linux_ptrace.c: revision 1.19
sys/compat/linux/arch/powerpc/linux_ptrace.c: revision 1.29
Don't release proc_lock until we're done looking at things that are
protected by the lock, particularly p_stat and p_waited. Found by
Robert Elz.
XXX Pullup to NetBSD-7, -6, -6-0, and -6-1
 1.23.18.2 03-Dec-2017  jdolecek update from HEAD
 1.23.18.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.23.14.1 15-Nov-2015  bouyer Pull up following revision(s) (requested by pgoyette in ticket #1335):
sys/compat/linux/arch/i386/linux_ptrace.c: revision 1.31
sys/compat/linux/arch/arm/linux_ptrace.c: revision 1.19
sys/compat/linux/arch/powerpc/linux_ptrace.c: revision 1.29
Don't release proc_lock until we're done looking at things that are
protected by the lock, particularly p_stat and p_waited. Found by
Robert Elz.
XXX Pullup to NetBSD-7, -6, -6-0, and -6-1
 1.23.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.24.2.1 10-Aug-2014  tls Rebase.
 1.25.2.3 05-Nov-2015  snj Pull up following revision(s) (requested by pgoyette in ticket #998):
sys/compat/linux/arch/arm/linux_ptrace.c: revision 1.19
sys/compat/linux/arch/i386/linux_ptrace.c: revision 1.31
sys/compat/linux/arch/powerpc/linux_ptrace.c: revision 1.29
Don't release proc_lock until we're done looking at things that are
protected by the lock, particularly p_stat and p_waited. Found by
Robert Elz.
 1.25.2.2 17-Jan-2015  martin branches: 1.25.2.2.2;
Pull up following revision(s) (requested by maxv in ticket #427):
sys/compat/svr4/svr4_schedctl.c: revision 1.8
sys/netinet/tcp_timer.c: revision 1.88
sys/miscfs/genfs/layer_vfsops.c: revision 1.45
sys/compat/svr4/svr4_ioctl.c: revision 1.37
sys/ufs/chfs/chfs_vfsops.c: revision 1.14
sys/miscfs/fdesc/fdesc_vfsops.c: revision 1.91
sys/compat/linux/arch/i386/linux_ptrace.c: revision 1.30
sys/compat/common/kern_time_50.c: revision 1.28
sys/netinet6/ip6_forward.c: revision 1.74
sys/miscfs/umapfs/umap_vnops.c: revision 1.57
sys/compat/svr4/svr4_fcntl.c: revision 1.74
distrib/sets/lists/comp/mi: revision 1.1931
sys/netinet6/udp6_output.c: revision 1.46
sys/fs/puffs/puffs_compat.c: revision 1.3
sys/fs/udf/udf_rename.c: revision 1.11
sys/compat/svr4/svr4_filio.c: revision 1.24
sys/fs/udf/udf_rename.c: revision 1.12
sys/netinet/tcp_usrreq.c: revision 1.202
sys/miscfs/umapfs/umap_subr.c: revision 1.29
sys/compat/linux/common/linux_fadvise64.c: revision 1.3
sys/netinet/if_atm.c: revision 1.34
sys/miscfs/procfs/procfs_subr.c: revision 1.106
sys/miscfs/genfs/layer_subr.c: revision 1.37
sys/netinet/tcp_sack.c: revision 1.30
sys/compat/freebsd/freebsd_misc.c: revision 1.33
sys/compat/freebsd/freebsd_file.c: revision 1.33
sys/ufs/chfs/chfs_vnode.c: revision 1.12
sys/compat/svr4/svr4_ttold.c: revision 1.34
sys/compat/linux/common/linux_file.c: revision 1.114
sys/compat/linux/arch/mips/linux_machdep.c: revision 1.43
sys/compat/linux/common/linux_signal.c: revision 1.76
sys/compat/common/compat_util.c: revision 1.46
sys/compat/linux/arch/arm/linux_ptrace.c: revision 1.18
sys/compat/svr4/svr4_sockio.c: revision 1.36
sys/compat/linux/arch/arm/linux_machdep.c: revision 1.32
sys/compat/svr4/svr4_signal.c: revision 1.66
sys/kern/kern_exec.c: revision 1.410
sys/fs/puffs/puffs_vfsops.c: revision 1.115
sys/compat/svr4/svr4_exec_elf64.c: revision 1.15
sys/compat/linux/arch/i386/linux_machdep.c: revision 1.159
sys/compat/linux/arch/alpha/linux_machdep.c: revision 1.50
sys/compat/linux32/common/linux32_misc.c: revision 1.24
sys/netinet/in_pcb.c: revision 1.153
sys/sys/malloc.h: revision 1.116
sys/compat/common/if_43.c: revision 1.9
share/man/man9/Makefile: revision 1.380
sys/netinet/tcp_vtw.c: revision 1.12
sys/miscfs/umapfs/umap_vfsops.c: revision 1.95
sys/ufs/ext2fs/ext2fs_vfsops.c: revision 1.186
sys/compat/common/uipc_syscalls_43.c: revision 1.46
sys/ufs/ext2fs/ext2fs_vnops.c: revision 1.115
sys/fs/puffs/puffs_msgif.c: revision 1.97
sys/compat/svr4/svr4_ipc.c: revision 1.27
sys/compat/linux/common/linux_exec.c: revision 1.117
sys/ufs/ext2fs/ext2fs_readwrite.c: revision 1.66
sys/netinet/tcp_output.c: revision 1.179
sys/compat/svr4/svr4_termios.c: revision 1.28
sys/fs/udf/udf_strat_bootstrap.c: revision 1.4
sys/fs/puffs/puffs_subr.c: revision 1.67
sys/fs/puffs/puffs_node.c: revision 1.36
sys/miscfs/overlay/overlay_vnops.c: revision 1.21
sys/fs/cd9660/cd9660_node.c: revision 1.34
sys/netinet/raw_ip.c: revision 1.146
sys/sys/mallocvar.h: revision 1.13
sys/miscfs/overlay/overlay_vfsops.c: revision 1.63
share/man/man9/malloc.9: revision 1.50
sys/netinet6/dest6.c: revision 1.18
sys/compat/linux/common/linux_uselib.c: revision 1.33
sys/compat/linux/common/linux_socket.c: revision 1.120
share/man/man9/malloc.9: revision 1.51
sys/netinet/tcp_subr.c: revision 1.257
sys/compat/linux/common/linux_socketcall.c: revision 1.45
sys/compat/linux/common/linux_fadvise64_64.c: revision 1.3
sys/compat/freebsd/freebsd_ipc.c: revision 1.17
sys/compat/linux/common/linux_misc_notalpha.c: revision 1.109
sys/compat/linux/arch/alpha/linux_pipe.c: revision 1.17
sys/netinet6/in6_pcb.c: revision 1.132
sys/netinet6/in6_ifattach.c: revision 1.94
sys/compat/svr4/svr4_exec_elf32.c: revision 1.15
sys/miscfs/nullfs/null_vfsops.c: revision 1.90
sys/fs/cd9660/cd9660_util.c: revision 1.12
sys/compat/linux/arch/powerpc/linux_machdep.c: revision 1.48
sys/compat/freebsd/freebsd_exec_elf32.c: revision 1.20
sys/miscfs/procfs/procfs_vfsops.c: revision 1.94
sys/compat/linux/arch/powerpc/linux_ptrace.c: revision 1.28
sys/compat/linux/common/linux_sched.c: revision 1.67
sys/compat/linux/common/linux_exec_aout.c: revision 1.67
sys/compat/linux/common/linux_pipe.c: revision 1.67
sys/compat/linux/common/linux_llseek.c: revision 1.34
sys/compat/linux/arch/mips/linux_ptrace.c: revision 1.10
Do not uselessly include <sys/malloc.h>.
Cleanup:
- remove struct kmembuckets (dead)
- correctly deadify MALLOC_XX
- remove MALLOC_DEFINE_LIMIT and MALLOC_JUSTDEFINE_LIMIT (dead)
- remove malloc_roundup(), malloc_type_setlimit(), MALLOC_DEFINE_LIMIT()
and MALLOC_JUSTDEFINE_LIMIT() from man 9 malloc
New sentence, new line. Bump date for previous.
Obsolete malloc_roundup(9), malloc_type_setlimit(9) and MALLOC_DEFINE_LIMIT(9)
man pages.
 1.25.2.1 30-Oct-2014  martin Pull up following revision(s) (requested by maxv in ticket #163):
sys/compat/linux/arch/i386/linux_ptrace.c: revision 1.29
sys/compat/linux/arch/powerpc/linux_ptrace.c: revision 1.26
sys/compat/linux/arch/powerpc/linux_ptrace.c: revision 1.27
Fix four memory leaks in compat/linux.
 1.25.2.2.2.1 05-Nov-2015  snj Pull up following revision(s) (requested by pgoyette in ticket #998):
sys/compat/linux/arch/arm/linux_ptrace.c: revision 1.19
sys/compat/linux/arch/i386/linux_ptrace.c: revision 1.31
sys/compat/linux/arch/powerpc/linux_ptrace.c: revision 1.29
Don't release proc_lock until we're done looking at things that are
protected by the lock, particularly p_stat and p_waited. Found by
Robert Elz.
 1.28.2.1 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.29.10.2 21-Jun-2023  martin Pull up following revision(s) (requested by riastradh in ticket #1836):

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

sys/compat: Memset zero before copyout.

Just in case of uninitialized padding which would lead to kernel
stack disclosure. If the compiler can prove the memset redundant
then it can optimize it away; otherwise better safe than sorry.
 1.29.10.1 12-Apr-2018  martin Pull up following revision(s) (requested by kamil in ticket #713):

sys/modules/procfs/Makefile: revision 1.4
sys/miscfs/procfs/procfs_vfsops.c: revision 1.98
bin/ps/ps.1: revision 1.108
sys/compat/linux/arch/i386/linux_ptrace.c: revision 1.32
sys/miscfs/procfs/procfs_vnops.c: revision 1.198
sys/kern/sys_ptrace_common.c: revision 1.23
sys/kern/sys_ptrace_common.c: revision 1.24
sbin/mount_procfs/mount_procfs.8: revision 1.36
sys/kern/sys_ptrace_common.c: revision 1.25
sys/kern/sys_ptrace.c: revision 1.5
sys/compat/linux/arch/powerpc/linux_ptrace.c: revision 1.30
sys/sys/proc.h: revision 1.342
sys/kern/sys_ptrace_common.c: revision 1.26
sys/miscfs/procfs/procfs_ctl.c: file removal
sys/kern/sys_ptrace_common.c: revision 1.27
sys/miscfs/procfs/procfs_subr.c: revision 1.109
sys/kern/sys_ptrace_common.c: revision 1.28
sys/secmodel/extensions/secmodel_extensions.c: revision 1.8
sys/kern/sys_ptrace_common.c: revision 1.29
sys/sys/ptrace.h: revision 1.62
sys/compat/netbsd32/netbsd32_signal.c: revision 1.45
share/man/man9/kauth.9: revision 1.109
sys/miscfs/procfs/files.procfs: revision 1.12
sys/compat/netbsd32/netbsd32.h: revision 1.115
sys/miscfs/procfs/procfs.h: revision 1.72
sys/compat/netbsd32/netbsd32_ptrace.c: revision 1.5
sys/kern/kern_sig.c: revision 1.337
sys/sys/kauth.h: revision 1.75
sys/sys/sysctl.h: revision 1.224
sys/kern/sys_ptrace_common.c: revision 1.30
sys/kern/sys_ptrace_common.c: revision 1.31
sys/kern/sys_ptrace_common.c: revision 1.32
sys/kern/sys_ptrace_common.c: revision 1.33
sys/compat/linux/arch/arm/linux_ptrace.c: revision 1.20
sys/kern/sys_ptrace_common.c: revision 1.34
sys/kern/sys_ptrace_common.c: revision 1.36
sys/kern/kern_proc.c: revision 1.207
sys/kern/kern_exit.c: revision 1.269
doc/TODO.ptrace: revision 1.29

Make {s,g}et{db,fp,}regs work again for PK_32 processes
XXX: pullup-8

add disgusting magic to handle compat_netbsd32 as a module.

use process_*reg32 instead of struct *reg32.

Remove the filesystem tracing feature

This is a legacy interface from 4.4BSD, and it was
introduced to overcome shortcomings of ptrace(2) at that time, which are
no longer relevant (performance). Today /proc/#/ctl offers a narrow
subset of ptrace(2) commands and is not applicable for modern
applications use beyond simplistic tracing scenarios.

This removal will simplify kernel internals. Users will still be able to
use all the other /proc files.

This change won't affect other procfs files neither Linux compat
features within mount_procfs(8). /proc/#/ctl isn't available on Linux.

Remove:
- /proc/#/ctl from mount_procfs(8)
- P_FSTRACE note from the documentation of ps(1)
- /proc/#/ctl and filesystem tracing documentation from mount_procfs(8)
- KAUTH_REQ_PROCESS_PROCFS_CTL documentation from kauth(9)
- source code file miscfs/procfs/procfs_ctl.c
- PFSctl and procfs_doctl() from sys/miscfs/procfs/procfs.h
- KAUTH_REQ_PROCESS_PROCFS_CTL from sys/sys/kauth.h
- PSL_FSTRACE (0x00010000) from sys/sys/proc.h
- P_FSTRACE (0x00010000) from sys/sys/sysctl.h

Reduce code complexity after removal of this functionality.

Update TODO.ptrace accordingly: remove two entries about /proc tracing.

Do not keep legacy notes as comments in the headers about removed

PSL_FSTRACE / P_FSTRACE, as this interface had little number of users
(close or equal to zero).
Proposed on tech-kern@.

All filesystem tracing utility users are encouraged to switch to ptrace(2).

Sponsored by <The NetBSD Foundation>

untangle the mess:
- factor out common code
- break each ptrace subcall to its own sub-function
.. more to come ...
- reduce ifdef ugliness by moving it up top.
- factor out PT_IO and make PT_{READ,WRITE}_{I,D} use it
- factor out PT_DUMPCORE
- factor out sendsig code
.. more to come ...

handle siginfo requests for ptrace32

ptrace: Partially undo PT_{READ,WRITE}_{I,D} and unbreak these commands

The refactored code did not work and was generating EFAULT.

Sponsored by <The NetBSD Foundation>

Merge the code back; the problem was that since we are reading/writing
to a kernel address for PT_{READ,WRITE}_{I,D} we need the kernel vmspace.
provide separate read and write functions to accomodate register functions
that need a size argument.

don't ignore error from copyout_piod

Use the proper process (the tracee) to get information about lwps and
registers and the tracer for vmspace.

Add new sysctl(3) entry: security.models.extensions.user_set_dbregs

Model this new sysctl(3) entry after "user_set_cpu_affinity" in the same
level of sysctl(3) switches.

Allow to read unconditionally Debug Registers (no change here). This is
convenient as even if a user of a debugger does not use hardware assisted
watchpoints/breakpoints, a debugger can still prompt these values to store
in an internal cache with context of registers. Reading them should have
no security concerns.

Add a paranoid MI switch that prohibits by default setting these registers
by a regular user (non-superuser). Make this switch disabled by default.
There are enough reserved bits out there to allow using them
unconditionally on hardened hosts.

Features shipped with Debug Registers are optional features in debuggers.
There is no reduction in elementary functionality.

Reviewed by <christos>

Sponsored by <The NetBSD Foundation>
 1.30.4.1 10-Jun-2019  christos Sync with HEAD
 1.30.2.1 06-Sep-2018  pgoyette Sync with HEAD

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

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

sys/compat: Memset zero before copyout.

Just in case of uninitialized padding which would lead to kernel
stack disclosure. If the compiler can prove the memset redundant
then it can optimize it away; otherwise better safe than sorry.
 1.7 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.6 11-Dec-2005  christos branches: 1.6.70; 1.6.72; 1.6.74;
merge ktrace-lwp.
 1.5 26-Feb-2005  perry nuke trailing whitespace
 1.4 31-Mar-2002  christos branches: 1.4.10; 1.4.18; 1.4.20;
bring the reverse signal mapping array into linux_signo.c
 1.3 31-Mar-2002  christos make signal array handling uniform, and put signal arrays in a separate
file. This is simular to errno array handling.
 1.2 13-Nov-2001  lukem add RCSIDs (including regeneration of files as appropriate)
 1.1 19-Jan-2001  manu branches: 1.1.2; 1.1.4; 1.1.6;
Added powerpc specific code for Linux compatibility on powerpc ports
 1.1.6.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.6.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.4.2 17-Apr-2002  nathanw Catch up to -current.
 1.1.4.1 14-Nov-2001  nathanw Catch up to -current.
 1.1.2.2 11-Feb-2001  bouyer Sync with HEAD.
 1.1.2.1 19-Jan-2001  bouyer file linux_sigarray.c was added on branch thorpej_scsipi on 2001-02-11 19:13:53 +0000
 1.4.20.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.4.18.1 29-Apr-2005  kent sync with -current
 1.4.10.1 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.6.74.1 16-May-2008  yamt sync with head.
 1.6.72.1 18-May-2008  yamt sync with head.
 1.6.70.1 02-Jun-2008  mjf Sync with HEAD.
 1.6 18-Nov-2011  christos - add sigtimedwait support.
- merge the siginfo population code.
 1.5 23-Nov-2008  njoly branches: 1.5.16;
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.4 28-Apr-2008  martin branches: 1.4.6; 1.4.8;
Remove clause 3 and 4 from TNF licenses
 1.3 11-Dec-2005  christos branches: 1.3.70; 1.3.72; 1.3.74;
merge ktrace-lwp.
 1.2 26-Feb-2005  perry nuke trailing whitespace
 1.1 19-Jan-2001  manu branches: 1.1.2; 1.1.26; 1.1.34; 1.1.36;
Added various header files for initial Linux compatibility on powerpc ports
 1.1.36.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.1.34.1 29-Apr-2005  kent sync with -current
 1.1.26.1 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.1.2.2 11-Feb-2001  bouyer Sync with HEAD.
 1.1.2.1 19-Jan-2001  bouyer file linux_siginfo.h was added on branch thorpej_scsipi on 2001-02-11 19:13:53 +0000
 1.3.74.2 04-May-2009  yamt sync with head.
 1.3.74.1 16-May-2008  yamt sync with head.
 1.3.72.1 18-May-2008  yamt sync with head.
 1.3.70.2 17-Jan-2009  mjf Sync with HEAD.
 1.3.70.1 02-Jun-2008  mjf Sync with HEAD.
 1.4.8.1 19-Jan-2009  skrll Sync with HEAD.
 1.4.6.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.5.16.1 17-Apr-2012  yamt sync with head
 1.11 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.10 04-Dec-2007  dsl branches: 1.10.12; 1.10.14; 1.10.16;
Remove all the __P
 1.9 11-Dec-2005  christos branches: 1.9.44; 1.9.46; 1.9.52; 1.9.56;
merge ktrace-lwp.
 1.8 19-Sep-2005  christos MINSIGSTKSZ on linux is different depending on the platform and usually
smaller than ours.
 1.7 19-May-2005  manu branches: 1.7.2;
Add support for Linux SA_RESTORER on amd64.
 1.6 26-Feb-2005  perry nuke trailing whitespace
 1.5 26-Nov-2002  christos branches: 1.5.6; 1.5.14; 1.5.16;
rename: s/sa_/<compat>sa/g
 1.4 19-Mar-2002  christos - Now that RT-signals fit, fix the array to deliver them. [i386 only].
- jdk-1.4 works perfectly now. :-)
 1.3 19-Feb-2002  nathanw Add LINUX_SA_NOCLDWAIT.
 1.2 26-Aug-2001  manu Fixed a typo in struct naming. This does not seems to impact anything.
 1.1 19-Jan-2001  manu branches: 1.1.2; 1.1.4; 1.1.6;
Added various header files for initial Linux compatibility on powerpc ports
 1.1.6.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.6.2 16-Mar-2002  jdolecek Catch up with -current.
 1.1.6.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.1.4.4 11-Dec-2002  thorpej Sync with HEAD.
 1.1.4.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.1.4.2 28-Feb-2002  nathanw Catch up to -current.
 1.1.4.1 21-Sep-2001  nathanw Catch up to -current.
 1.1.2.2 11-Feb-2001  bouyer Sync with HEAD.
 1.1.2.1 19-Jan-2001  bouyer file linux_signal.h was added on branch thorpej_scsipi on 2001-02-11 19:13:53 +0000
 1.5.16.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.5.14.1 29-Apr-2005  kent sync with -current
 1.5.6.2 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.5.6.1 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.7.2.2 07-Dec-2007  yamt sync with head
 1.7.2.1 21-Jun-2006  yamt sync with head.
 1.9.56.1 08-Dec-2007  ad Sync with head.
 1.9.52.1 08-Dec-2007  mjf Sync with HEAD.
 1.9.46.1 09-Jan-2008  matt sync with HEAD
 1.9.44.1 09-Dec-2007  jmcneill Sync with HEAD.
 1.10.16.1 16-May-2008  yamt sync with head.
 1.10.14.1 18-May-2008  yamt sync with head.
 1.10.12.1 02-Jun-2008  mjf Sync with HEAD.
 1.7 25-Jan-2014  njoly 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.6 28-Apr-2008  martin branches: 1.6.34; 1.6.44; 1.6.50;
Remove clause 3 and 4 from TNF licenses
 1.5 11-Dec-2005  christos branches: 1.5.70; 1.5.72; 1.5.74;
merge ktrace-lwp.
 1.4 26-Feb-2005  perry nuke trailing whitespace
 1.3 26-Jul-2003  jdolecek branches: 1.3.8; 1.3.10;
add LINUX_SO_PEERNAME, LINUX_SO_TIMESTAMP where it has been missing
fix value for LINUX_SO_DETACH_FILTER on couple places (unused anyway)

g/c LINUX_SCM_TIMESTAMP definition for some archs, it will be defined
in generic linux_socket.h
 1.2 26-Aug-2001  manu branches: 1.2.20;
Fiexed a typo in a #define
 1.1 19-Jan-2001  manu branches: 1.1.2; 1.1.4; 1.1.6;
Added various header files for initial Linux compatibility on powerpc ports
 1.1.6.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.1.4.1 21-Sep-2001  nathanw Catch up to -current.
 1.1.2.2 11-Feb-2001  bouyer Sync with HEAD.
 1.1.2.1 19-Jan-2001  bouyer file linux_socket.h was added on branch thorpej_scsipi on 2001-02-11 19:13:53 +0000
 1.2.20.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.2.20.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.20.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.20.1 03-Aug-2004  skrll Sync with HEAD
 1.3.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.3.8.1 29-Apr-2005  kent sync with -current
 1.5.74.1 16-May-2008  yamt sync with head.
 1.5.72.1 18-May-2008  yamt sync with head.
 1.5.70.1 02-Jun-2008  mjf Sync with HEAD.
 1.6.50.1 18-May-2014  rmind sync with head
 1.6.44.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.6.34.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 25-Jul-2004  chs remove the LINUX_SP_WRAP hack since it doesn't seem to be needed anymore,
and removing it lets us go back to mapping the stack non-executable again.
 1.2 19-Jan-2001  manu branches: 1.2.2; 1.2.26; 1.2.28;
Fixed a typo (two instructions dupliated at the end of code that were not reached)
 1.1 19-Jan-2001  manu Added powerpc specific code for Linux compatibility on powerpc ports
 1.2.28.1 26-Jul-2004  tron Pull up file removal (requested by chs in ticket #715):
remove the LINUX_SP_WRAP hack since it doesn't seem to be needed anymore,
and removing it lets us go back to mapping the stack non-executable again.
 1.2.26.1 03-Aug-2004  skrll Sync with HEAD
 1.2.2.2 11-Feb-2001  bouyer Sync with HEAD.
 1.2.2.1 19-Jan-2001  bouyer file linux_sp_wrap_powerpc.S was added on branch thorpej_scsipi on 2001-02-11 19:13:54 +0000
 1.99 28-Sep-2024  christos regen
 1.98 01-Jul-2024  christos regen
 1.97 29-Jun-2024  christos branches: 1.97.2;
regen
 1.96 19-Aug-2023  christos regen
 1.95 18-Aug-2023  christos regen
 1.94 29-Jul-2023  christos regen
 1.93 28-Jul-2023  christos regen
 1.92 02-Dec-2021  ryo regen
 1.91 24-Nov-2021  ryo regen
 1.90 20-Sep-2021  thorpej Regen for preadv(2) / pwritev(2).
 1.89 20-Sep-2021  thorpej Regen for eventfd.
 1.88 19-Sep-2021  thorpej Regen for timerfd.
 1.87 19-Sep-2021  thorpej Regen for POSIX timer syscalls.
 1.86 26-Apr-2020  thorpej branches: 1.86.2;
Regen for native futex calls.
 1.85 09-Nov-2019  jdolecek regen
 1.84 10-Aug-2018  pgoyette Regen
 1.83 10-May-2017  riastradh branches: 1.83.8; 1.83.10;
regen
 1.82 03-Feb-2017  christos branches: 1.82.4;
regen
 1.81 03-Feb-2017  martin regen
 1.80 16-Jan-2017  christos regen all
 1.79 13-Jan-2017  christos branches: 1.79.2;
regen
 1.78 02-Jan-2017  martin Regen (something apparently went wrong in previous)
 1.77 02-Jan-2017  manu Regen
 1.76 24-Jul-2016  njoly Regen for readlink/readlinkat signatures.
 1.75 27-Oct-2015  njoly branches: 1.75.2;
Regen.
 1.74 25-Oct-2015  njoly Regen for posix chown family cleanup.
 1.73 24-Sep-2015  christos regen
 1.72 07-Mar-2015  christos regen
 1.71 22-Nov-2014  njoly branches: 1.71.2;
Regen for ppoll signature fix
 1.70 31-May-2014  njoly branches: 1.70.2;
Regen for munmap(2) signature.
 1.69 20-May-2014  njoly Regen for getgroups/setgroups update.
 1.68 17-May-2014  njoly Regen for fadvise64 offset types changes.
 1.67 06-May-2014  njoly Regen for mknod device argument type change.
 1.66 04-May-2014  njoly Regen for pread/pwrite 64bit offset argument.
 1.65 08-Apr-2014  njoly Regen.
 1.64 10-Dec-2013  njoly branches: 1.64.2;
Regen.
 1.63 08-Dec-2013  njoly Regen.
 1.62 07-Nov-2013  njoly Regen for dup/dup2/dup3 argument types fix.
 1.61 24-Sep-2013  njoly Regen for utimensat(2).
 1.60 11-Aug-2013  pooka regen
 1.59 11-Aug-2013  pooka regen
 1.58 08-Apr-2013  pooka branches: 1.58.4;
regen for utimes
 1.57 19-Sep-2012  pooka regen for ppoll (and, apparently, SYCALL_ARG_PTR)
 1.56 18-Nov-2011  christos branches: 1.56.10;
- add sigtimedwait support.
- merge the siginfo population code.
 1.55 31-May-2011  njoly branches: 1.55.4;
Regen for fadvise64_64 typo fix.
 1.54 30-May-2011  alnsn Regenerate files to pick up correct RCS Ids. Suggested by Chris Badura.
 1.53 30-May-2011  alnsn Add fadvise64 and fadvise64_64 syscalls to compat_linux and compat_linux32.
 1.52 15-Apr-2011  he Regenerate these files after adding pipe2() and dup3().
 1.51 07-Jul-2010  chs branches: 1.51.2;
regen
 1.50 14-Dec-2009  matt branches: 1.50.2; 1.50.4;
Regen (new makesyscalls.sh)
 1.49 24-Nov-2009  njoly Regen for personality(2) update.
 1.48 08-Jun-2009  njoly Regen for rt_queueinfo(2) update.
 1.47 17-Jan-2009  njoly branches: 1.47.2;
Regen for wait4 update.
 1.46 15-Jan-2009  njoly Rengen for compat50 update.
 1.45 13-Jan-2009  pooka Regen to prove I didn't screw up the conversion: purely RCSID changes.
 1.44 19-Nov-2008  ad Regen.
 1.43 12-Nov-2008  njoly Regen for nanosleep(2) fix.
 1.42 23-Apr-2008  ad branches: 1.42.2; 1.42.4; 1.42.8; 1.42.10; 1.42.12;
Regen.
 1.41 04-Apr-2008  njoly branches: 1.41.2;
Regen for linux_sys_msync removal.
 1.40 24-Dec-2007  njoly branches: 1.40.6;
Regen for linux_sys_getpgid removal.
 1.39 21-Dec-2007  njoly Regen for getfsuid/setfsgid syscall exchange.
 1.38 20-Dec-2007  dsl regen
 1.37 16-Nov-2007  njoly branches: 1.37.2; 1.37.6;
Regen, for syscalls cleanup.
 1.36 04-Mar-2007  christos branches: 1.36.14; 1.36.16; 1.36.20; 1.36.22;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.35 01-Sep-2006  matt branches: 1.35.8;
Regen.
 1.34 30-Aug-2006  matt Regen
 1.33 10-Jun-2006  christos regen
 1.32 11-Dec-2005  christos branches: 1.32.4; 1.32.8; 1.32.14;
merge ktrace-lwp.
 1.31 18-Oct-2005  christos regen
 1.30 16-May-2005  fvdl branches: 1.30.2;
Regen.
 1.29 16-May-2005  fvdl Regen.
 1.28 26-Feb-2005  perry regen
 1.27 26-Feb-2005  perry regen
 1.26 20-Sep-2004  jdolecek branches: 1.26.4; 1.26.6;
regen:
implement support for Linux statfs64() syscall - 64bit variant of statfs()
 1.25 08-Sep-2004  jdolecek regen: add exit_group(2)
 1.24 01-Aug-2004  jdolecek regen - sync syscall lists with Linux kernel 2.6.7
 1.23 01-Aug-2004  jdolecek regen:

connect madvise(2) and mincore(2) - apparently the newer Linux libs
don't stub it anymore, so allow the application to take advantage
of them

the Linux calls appear to be compatible in the flag values and semantics,
so a wrapper is not necessary
 1.22 10-Aug-2003  jdolecek regen - added wrapper for Linux ftruncate64()
 1.21 23-Jun-2003  christos branches: 1.21.2;
Regen.
 1.20 18-Jan-2003  thorpej Regen for correct RCS ID.
 1.19 18-Jan-2003  thorpej Regen: Merge the nathanw_sa branch.
 1.18 01-Nov-2002  jdolecek regen: nsysent set to 256
 1.17 19-May-2002  jdolecek branches: 1.17.2;
hook in truncate64(2) and ftruncate64(2)
 1.16 12-May-2002  jdolecek branches: 1.16.2;
regen - 64 fs syscalls
 1.15 10-Apr-2002  christos regen
 1.14 22-Mar-2002  christos regen
 1.13 19-Feb-2002  nathanw Regen.
 1.12 15-Feb-2002  christos - add a real linux_sys___sysctl because the mib numbers are different.
implement only the kernel version getting entries.
- make the signal conversion functions consistent; dest is arg 1.
- make linux_fakedev deal with block and char devices differently.
- add linux_sys_ugetrlimit, and flesh out the regular get/setrlimit so
that they work properly.
- add linux_mmap2 [untested].
- bump kernel to 2.4.18, and make the date be valentine's day :-)
- linux_sys_*stat64 family was totally busted. Fix it.

tested only on i386.

Status:
gdb, telnet, work
jdk-1.4.0 extractor works, jdk still coredumps.

christos
 1.11 13-Nov-2001  lukem add RCSIDs (including regeneration of files as appropriate)
 1.10 08-Sep-2001  manu Removed a hack to make PowerPC mmap work. This could have side effects on
alpha and i386. It has been tested and works on i386.
 1.9 30-May-2001  mrg branches: 1.9.2; 1.9.4;
use _KERNEL_OPT.
 1.8 13-May-2001  manu Improved the accuracy of gettimeofday/settimeofday: Linux stores a srtuct
timezone in the kernel. We now keep track of it for emulated processes.
Tested for powerpc and i386. Untested on m68k, but it should be ok
Alpha has a particular implementation (osf1_sys_gettimeofday), and it has
therefore not been touched.
 1.7 30-Mar-2001  jdolecek regen - use linux_sys_nosys() instead sys_nosys()
 1.6 30-Mar-2001  jdolecek regen
 1.5 30-Mar-2001  jdolecek regen
 1.4 27-Jan-2001  thorpej branches: 1.4.2; 1.4.4;
Regen; getpid(2) is MP-safe.
 1.3 27-Jan-2001  thorpej Regen; add sy_flags.
 1.2 20-Jan-2001  manu Fix the "created from" field of files generated from syscalls.master (this
master file did not have a RCS Id at generation time, hence the problem)
 1.1 19-Jan-2001  manu Added various header files for initial Linux compatibility on powerpc ports
 1.4.4.10 11-Nov-2002  nathanw Catch up to -current
 1.4.4.9 20-Jun-2002  nathanw Catch up to -current.
 1.4.4.8 29-May-2002  nathanw Regen.
 1.4.4.7 17-Apr-2002  nathanw Catch up to -current.
 1.4.4.6 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.4.4.5 28-Feb-2002  nathanw Catch up to -current.
 1.4.4.4 14-Nov-2001  nathanw Catch up to -current.
 1.4.4.3 21-Sep-2001  nathanw Catch up to -current.
 1.4.4.2 21-Jun-2001  nathanw Catch up to -current.
 1.4.4.1 09-Apr-2001  nathanw Catch up with -current.
 1.4.2.3 21-Apr-2001  bouyer Sync with HEAD
 1.4.2.2 11-Feb-2001  bouyer Sync with HEAD.
 1.4.2.1 27-Jan-2001  bouyer file linux_syscall.h was added on branch thorpej_scsipi on 2001-02-11 19:13:54 +0000
 1.9.4.1 01-Oct-2001  fvdl Catch up with -current.
 1.9.2.4 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.9.2.3 16-Mar-2002  jdolecek Catch up with -current.
 1.9.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.9.2.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.16.2.1 30-May-2002  gehenna Catch up with -current.
 1.17.2.3 14-Jun-2004  jmc Regen for changes in ticket #1708
 1.17.2.2 11-May-2004  tron Regen for ticket 1686.
 1.17.2.1 22-Oct-2003  jmc Regen files (requested by tv in ticket #1427)

Proper support for mmap2
 1.21.2.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.21.2.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.21.2.4 24-Sep-2004  skrll Sync with HEAD.
 1.21.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.21.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.21.2.1 03-Aug-2004  skrll Sync with HEAD
 1.26.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.26.4.1 29-Apr-2005  kent sync with -current
 1.30.2.5 21-Jan-2008  yamt sync with head
 1.30.2.4 07-Dec-2007  yamt sync with head
 1.30.2.3 03-Sep-2007  yamt sync with head.
 1.30.2.2 30-Dec-2006  yamt sync with head.
 1.30.2.1 21-Jun-2006  yamt sync with head.
 1.32.14.1 19-Jun-2006  chap Sync with head.
 1.32.8.2 03-Sep-2006  yamt sync with head.
 1.32.8.1 26-Jun-2006  yamt sync with head.
 1.32.4.1 09-Sep-2006  rpaulo sync with head
 1.35.8.1 12-Mar-2007  rmind Sync with HEAD.
 1.36.22.2 27-Dec-2007  mjf Sync with HEAD.
 1.36.22.1 19-Nov-2007  mjf Sync with HEAD.
 1.36.20.1 18-Nov-2007  bouyer Sync with HEAD
 1.36.16.1 09-Jan-2008  matt sync with HEAD
 1.36.14.1 21-Nov-2007  joerg Sync with HEAD.
 1.37.6.1 02-Jan-2008  bouyer Sync with HEAD
 1.37.2.1 26-Dec-2007  ad Sync with head.
 1.40.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.40.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.41.2.1 18-May-2008  yamt sync with head.
 1.42.12.1 20-Nov-2008  snj Regen for ticket 81.
 1.42.10.1 19-Jan-2009  skrll Sync with HEAD.
 1.42.8.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.42.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.42.2.4 11-Aug-2010  yamt sync with head.
 1.42.2.3 11-Mar-2010  yamt sync with head
 1.42.2.2 20-Jun-2009  yamt sync with head
 1.42.2.1 04-May-2009  yamt sync with head.
 1.47.2.1 23-Jul-2009  jym Sync with HEAD.
 1.50.4.4 12-Jun-2011  rmind sync with head
 1.50.4.3 31-May-2011  rmind sync with head
 1.50.4.2 21-Apr-2011  rmind sync with head
 1.50.4.1 05-Mar-2011  rmind sync with head
 1.50.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.51.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.55.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.55.4.2 30-Oct-2012  yamt sync with head
 1.55.4.1 17-Apr-2012  yamt sync with head
 1.56.10.4 03-Dec-2017  jdolecek update from HEAD
 1.56.10.3 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.56.10.2 23-Jun-2013  tls resync from head
 1.56.10.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.58.4.2 18-May-2014  rmind sync with head
 1.58.4.1 28-Aug-2013  rmind sync with head
 1.64.2.1 10-Aug-2014  tls Rebase.
 1.70.2.1 17-Apr-2017  snj regen for ticket 1354
 1.71.2.4 05-Feb-2017  skrll Sync with HEAD
 1.71.2.3 05-Oct-2016  skrll Sync with HEAD
 1.71.2.2 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.71.2.1 06-Apr-2015  skrll Sync with HEAD
 1.75.2.3 20-Mar-2017  pgoyette Sync with HEAD
 1.75.2.2 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.75.2.1 26-Jul-2016  pgoyette Sync with HEAD
 1.79.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.82.4.1 11-May-2017  pgoyette Sync with HEAD
 1.83.10.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.83.10.1 10-Jun-2019  christos Sync with HEAD
 1.83.8.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.86.2.2 17-Dec-2020  thorpej Regen for preadv(2) and pwritev(2).
 1.86.2.1 15-Dec-2020  thorpej Regen for eventfd, timerfd, POSIX timers.
 1.97.2.1 02-Aug-2025  perseant Sync with HEAD
 1.98 28-Sep-2024  christos regen
 1.97 01-Jul-2024  christos regen
 1.96 29-Jun-2024  christos branches: 1.96.2;
regen
 1.95 19-Aug-2023  christos regen
 1.94 18-Aug-2023  christos regen
 1.93 29-Jul-2023  christos regen
 1.92 28-Jul-2023  christos regen
 1.91 02-Dec-2021  ryo regen
 1.90 24-Nov-2021  ryo regen
 1.89 20-Sep-2021  thorpej Regen for preadv(2) / pwritev(2).
 1.88 20-Sep-2021  thorpej Regen for eventfd.
 1.87 19-Sep-2021  thorpej Regen for timerfd.
 1.86 19-Sep-2021  thorpej Regen for POSIX timer syscalls.
 1.85 26-Apr-2020  thorpej branches: 1.85.2;
Regen for native futex calls.
 1.84 09-Nov-2019  jdolecek regen
 1.83 10-Aug-2018  pgoyette Regen
 1.82 10-May-2017  riastradh branches: 1.82.8; 1.82.10;
regen
 1.81 03-Feb-2017  christos branches: 1.81.4;
regen
 1.80 03-Feb-2017  martin regen
 1.79 16-Jan-2017  christos regen all
 1.78 13-Jan-2017  christos branches: 1.78.2;
regen
 1.77 02-Jan-2017  martin Regen (something apparently went wrong in previous)
 1.76 02-Jan-2017  manu Regen
 1.75 24-Jul-2016  njoly Regen for readlink/readlinkat signatures.
 1.74 27-Oct-2015  njoly branches: 1.74.2;
Regen.
 1.73 25-Oct-2015  njoly Regen for posix chown family cleanup.
 1.72 24-Sep-2015  christos regen
 1.71 07-Mar-2015  christos regen
 1.70 22-Nov-2014  njoly branches: 1.70.2;
Regen for ppoll signature fix
 1.69 31-May-2014  njoly branches: 1.69.2;
Regen for munmap(2) signature.
 1.68 20-May-2014  njoly Regen for getgroups/setgroups update.
 1.67 17-May-2014  njoly Regen for fadvise64 offset types changes.
 1.66 06-May-2014  njoly Regen for mknod device argument type change.
 1.65 04-May-2014  njoly Regen for pread/pwrite 64bit offset argument.
 1.64 08-Apr-2014  njoly Regen.
 1.63 10-Dec-2013  njoly branches: 1.63.2;
Regen.
 1.62 08-Dec-2013  njoly Regen.
 1.61 07-Nov-2013  njoly Regen for dup/dup2/dup3 argument types fix.
 1.60 24-Sep-2013  njoly Regen for utimensat(2).
 1.59 11-Aug-2013  pooka regen
 1.58 11-Aug-2013  pooka regen
 1.57 08-Apr-2013  pooka branches: 1.57.4;
regen for utimes
 1.56 19-Sep-2012  pooka regen for ppoll (and, apparently, SYCALL_ARG_PTR)
 1.55 18-Nov-2011  christos branches: 1.55.10;
- add sigtimedwait support.
- merge the siginfo population code.
 1.54 31-May-2011  njoly branches: 1.54.4;
Regen for fadvise64_64 typo fix.
 1.53 30-May-2011  alnsn Regenerate files to pick up correct RCS Ids. Suggested by Chris Badura.
 1.52 30-May-2011  alnsn Add fadvise64 and fadvise64_64 syscalls to compat_linux and compat_linux32.
 1.51 15-Apr-2011  he Regenerate these files after adding pipe2() and dup3().
 1.50 07-Jul-2010  chs branches: 1.50.2;
regen
 1.49 14-Dec-2009  matt branches: 1.49.2; 1.49.4;
Regen (new makesyscalls.sh)
 1.48 24-Nov-2009  njoly Regen for personality(2) update.
 1.47 08-Jun-2009  njoly Regen for rt_queueinfo(2) update.
 1.46 17-Jan-2009  njoly branches: 1.46.2;
Regen for wait4 update.
 1.45 15-Jan-2009  njoly Rengen for compat50 update.
 1.44 13-Jan-2009  pooka Regen to prove I didn't screw up the conversion: purely RCSID changes.
 1.43 19-Nov-2008  ad Regen.
 1.42 12-Nov-2008  njoly Regen for nanosleep(2) fix.
 1.41 23-Apr-2008  ad branches: 1.41.2; 1.41.4; 1.41.8; 1.41.10; 1.41.12;
Regen.
 1.40 04-Apr-2008  njoly branches: 1.40.2;
Regen for linux_sys_msync removal.
 1.39 24-Dec-2007  njoly branches: 1.39.6;
Regen for linux_sys_getpgid removal.
 1.38 21-Dec-2007  njoly Regen for getfsuid/setfsgid syscall exchange.
 1.37 20-Dec-2007  dsl regen
 1.36 16-Nov-2007  njoly branches: 1.36.2; 1.36.6;
Regen, for syscalls cleanup.
 1.35 04-Mar-2007  christos branches: 1.35.14; 1.35.16; 1.35.20; 1.35.22;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.34 01-Sep-2006  matt branches: 1.34.8;
Regen.
 1.33 30-Aug-2006  matt Regen
 1.32 10-Jun-2006  christos regen
 1.31 11-Dec-2005  christos branches: 1.31.4; 1.31.8; 1.31.14;
merge ktrace-lwp.
 1.30 18-Oct-2005  christos regen
 1.29 16-May-2005  fvdl branches: 1.29.2;
Regen.
 1.28 16-May-2005  fvdl Regen.
 1.27 26-Feb-2005  perry regen
 1.26 26-Feb-2005  perry regen
 1.25 20-Sep-2004  jdolecek branches: 1.25.4; 1.25.6;
regen:
implement support for Linux statfs64() syscall - 64bit variant of statfs()
 1.24 08-Sep-2004  jdolecek regen: add exit_group(2)
 1.23 01-Aug-2004  jdolecek regen - sync syscall lists with Linux kernel 2.6.7
 1.22 01-Aug-2004  jdolecek regen:

connect madvise(2) and mincore(2) - apparently the newer Linux libs
don't stub it anymore, so allow the application to take advantage
of them

the Linux calls appear to be compatible in the flag values and semantics,
so a wrapper is not necessary
 1.21 10-Aug-2003  jdolecek regen - added wrapper for Linux ftruncate64()
 1.20 23-Jun-2003  christos branches: 1.20.2;
Regen.
 1.19 18-Jan-2003  thorpej Regen for correct RCS ID.
 1.18 18-Jan-2003  thorpej Regen: Merge the nathanw_sa branch.
 1.17 19-May-2002  jdolecek branches: 1.17.2;
hook in truncate64(2) and ftruncate64(2)
 1.16 12-May-2002  jdolecek branches: 1.16.2;
regen - 64 fs syscalls
 1.15 10-Apr-2002  christos regen
 1.14 22-Mar-2002  christos regen
 1.13 19-Feb-2002  nathanw Regen.
 1.12 15-Feb-2002  christos - add a real linux_sys___sysctl because the mib numbers are different.
implement only the kernel version getting entries.
- make the signal conversion functions consistent; dest is arg 1.
- make linux_fakedev deal with block and char devices differently.
- add linux_sys_ugetrlimit, and flesh out the regular get/setrlimit so
that they work properly.
- add linux_mmap2 [untested].
- bump kernel to 2.4.18, and make the date be valentine's day :-)
- linux_sys_*stat64 family was totally busted. Fix it.

tested only on i386.

Status:
gdb, telnet, work
jdk-1.4.0 extractor works, jdk still coredumps.

christos
 1.11 13-Nov-2001  lukem add RCSIDs (including regeneration of files as appropriate)
 1.10 08-Sep-2001  manu Removed a hack to make PowerPC mmap work. This could have side effects on
alpha and i386. It has been tested and works on i386.
 1.9 30-May-2001  mrg branches: 1.9.2; 1.9.4;
use _KERNEL_OPT.
 1.8 13-May-2001  manu Improved the accuracy of gettimeofday/settimeofday: Linux stores a srtuct
timezone in the kernel. We now keep track of it for emulated processes.
Tested for powerpc and i386. Untested on m68k, but it should be ok
Alpha has a particular implementation (osf1_sys_gettimeofday), and it has
therefore not been touched.
 1.7 30-Mar-2001  jdolecek regen - use linux_sys_nosys() instead sys_nosys()
 1.6 30-Mar-2001  jdolecek regen
 1.5 30-Mar-2001  jdolecek regen
 1.4 27-Jan-2001  thorpej branches: 1.4.2; 1.4.4;
Regen; getpid(2) is MP-safe.
 1.3 27-Jan-2001  thorpej Regen; add sy_flags.
 1.2 20-Jan-2001  manu Fix the "created from" field of files generated from syscalls.master (this
master file did not have a RCS Id at generation time, hence the problem)
 1.1 19-Jan-2001  manu Added various header files for initial Linux compatibility on powerpc ports
 1.4.4.9 20-Jun-2002  nathanw Catch up to -current.
 1.4.4.8 29-May-2002  nathanw Regen.
 1.4.4.7 17-Apr-2002  nathanw Catch up to -current.
 1.4.4.6 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.4.4.5 28-Feb-2002  nathanw Catch up to -current.
 1.4.4.4 14-Nov-2001  nathanw Catch up to -current.
 1.4.4.3 21-Sep-2001  nathanw Catch up to -current.
 1.4.4.2 21-Jun-2001  nathanw Catch up to -current.
 1.4.4.1 09-Apr-2001  nathanw Catch up with -current.
 1.4.2.3 21-Apr-2001  bouyer Sync with HEAD
 1.4.2.2 11-Feb-2001  bouyer Sync with HEAD.
 1.4.2.1 27-Jan-2001  bouyer file linux_syscallargs.h was added on branch thorpej_scsipi on 2001-02-11 19:13:55 +0000
 1.9.4.1 01-Oct-2001  fvdl Catch up with -current.
 1.9.2.4 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.9.2.3 16-Mar-2002  jdolecek Catch up with -current.
 1.9.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.9.2.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.16.2.1 30-May-2002  gehenna Catch up with -current.
 1.17.2.3 14-Jun-2004  jmc Regen for changes in ticket #1708
 1.17.2.2 11-May-2004  tron Regen for ticket 1686.
 1.17.2.1 22-Oct-2003  jmc Regen files (requested by tv in ticket #1427)

Proper support for mmap2
 1.20.2.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.20.2.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.20.2.4 24-Sep-2004  skrll Sync with HEAD.
 1.20.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.20.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.20.2.1 03-Aug-2004  skrll Sync with HEAD
 1.25.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.25.4.1 29-Apr-2005  kent sync with -current
 1.29.2.5 21-Jan-2008  yamt sync with head
 1.29.2.4 07-Dec-2007  yamt sync with head
 1.29.2.3 03-Sep-2007  yamt sync with head.
 1.29.2.2 30-Dec-2006  yamt sync with head.
 1.29.2.1 21-Jun-2006  yamt sync with head.
 1.31.14.1 19-Jun-2006  chap Sync with head.
 1.31.8.2 03-Sep-2006  yamt sync with head.
 1.31.8.1 26-Jun-2006  yamt sync with head.
 1.31.4.1 09-Sep-2006  rpaulo sync with head
 1.34.8.1 12-Mar-2007  rmind Sync with HEAD.
 1.35.22.2 27-Dec-2007  mjf Sync with HEAD.
 1.35.22.1 19-Nov-2007  mjf Sync with HEAD.
 1.35.20.1 18-Nov-2007  bouyer Sync with HEAD
 1.35.16.1 09-Jan-2008  matt sync with HEAD
 1.35.14.1 21-Nov-2007  joerg Sync with HEAD.
 1.36.6.1 02-Jan-2008  bouyer Sync with HEAD
 1.36.2.1 26-Dec-2007  ad Sync with head.
 1.39.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.39.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.40.2.1 18-May-2008  yamt sync with head.
 1.41.12.1 20-Nov-2008  snj Regen for ticket 81.
 1.41.10.1 19-Jan-2009  skrll Sync with HEAD.
 1.41.8.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.41.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.41.2.4 11-Aug-2010  yamt sync with head.
 1.41.2.3 11-Mar-2010  yamt sync with head
 1.41.2.2 20-Jun-2009  yamt sync with head
 1.41.2.1 04-May-2009  yamt sync with head.
 1.46.2.1 23-Jul-2009  jym Sync with HEAD.
 1.49.4.4 12-Jun-2011  rmind sync with head
 1.49.4.3 31-May-2011  rmind sync with head
 1.49.4.2 21-Apr-2011  rmind sync with head
 1.49.4.1 05-Mar-2011  rmind sync with head
 1.49.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.50.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.54.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.54.4.2 30-Oct-2012  yamt sync with head
 1.54.4.1 17-Apr-2012  yamt sync with head
 1.55.10.4 03-Dec-2017  jdolecek update from HEAD
 1.55.10.3 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.55.10.2 23-Jun-2013  tls resync from head
 1.55.10.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.57.4.2 18-May-2014  rmind sync with head
 1.57.4.1 28-Aug-2013  rmind sync with head
 1.63.2.1 10-Aug-2014  tls Rebase.
 1.69.2.1 17-Apr-2017  snj regen for ticket 1354
 1.70.2.5 28-Aug-2017  skrll Sync with HEAD
 1.70.2.4 05-Feb-2017  skrll Sync with HEAD
 1.70.2.3 05-Oct-2016  skrll Sync with HEAD
 1.70.2.2 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.70.2.1 06-Apr-2015  skrll Sync with HEAD
 1.74.2.3 20-Mar-2017  pgoyette Sync with HEAD
 1.74.2.2 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.74.2.1 26-Jul-2016  pgoyette Sync with HEAD
 1.78.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.81.4.1 11-May-2017  pgoyette Sync with HEAD
 1.82.10.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.82.10.1 10-Jun-2019  christos Sync with HEAD
 1.82.8.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.85.2.2 17-Dec-2020  thorpej Regen for preadv(2) and pwritev(2).
 1.85.2.1 15-Dec-2020  thorpej Regen for eventfd, timerfd, POSIX timers.
 1.96.2.1 02-Aug-2025  perseant Sync with HEAD
 1.98 28-Sep-2024  christos regen
 1.97 01-Jul-2024  christos regen
 1.96 29-Jun-2024  christos branches: 1.96.2;
regen
 1.95 19-Aug-2023  christos regen
 1.94 18-Aug-2023  christos regen
 1.93 29-Jul-2023  christos regen
 1.92 28-Jul-2023  christos regen
 1.91 02-Dec-2021  ryo regen
 1.90 24-Nov-2021  ryo regen
 1.89 20-Sep-2021  thorpej Regen for preadv(2) / pwritev(2).
 1.88 20-Sep-2021  thorpej Regen for eventfd.
 1.87 19-Sep-2021  thorpej Regen for timerfd.
 1.86 19-Sep-2021  thorpej Regen for POSIX timer syscalls.
 1.85 26-Apr-2020  thorpej branches: 1.85.2;
Regen for native futex calls.
 1.84 09-Nov-2019  jdolecek regen
 1.83 10-Aug-2018  pgoyette Regen
 1.82 10-May-2017  riastradh branches: 1.82.8; 1.82.10;
regen
 1.81 03-Feb-2017  christos branches: 1.81.4;
regen
 1.80 03-Feb-2017  martin regen
 1.79 16-Jan-2017  christos regen all
 1.78 13-Jan-2017  christos branches: 1.78.2;
regen
 1.77 02-Jan-2017  martin Regen (something apparently went wrong in previous)
 1.76 02-Jan-2017  manu Regen
 1.75 24-Jul-2016  njoly Regen for readlink/readlinkat signatures.
 1.74 27-Oct-2015  njoly branches: 1.74.2;
Regen.
 1.73 25-Oct-2015  njoly Regen for posix chown family cleanup.
 1.72 24-Sep-2015  christos regen
 1.71 07-Mar-2015  christos regen
 1.70 22-Nov-2014  njoly branches: 1.70.2;
Regen for ppoll signature fix
 1.69 31-May-2014  njoly branches: 1.69.2;
Regen for munmap(2) signature.
 1.68 20-May-2014  njoly Regen for getgroups/setgroups update.
 1.67 17-May-2014  njoly Regen for fadvise64 offset types changes.
 1.66 06-May-2014  njoly Regen for mknod device argument type change.
 1.65 04-May-2014  njoly Regen for pread/pwrite 64bit offset argument.
 1.64 08-Apr-2014  njoly Regen.
 1.63 10-Dec-2013  njoly branches: 1.63.2;
Regen.
 1.62 08-Dec-2013  njoly Regen.
 1.61 07-Nov-2013  njoly Regen for dup/dup2/dup3 argument types fix.
 1.60 24-Sep-2013  njoly Regen for utimensat(2).
 1.59 11-Aug-2013  pooka regen
 1.58 11-Aug-2013  pooka regen
 1.57 08-Apr-2013  pooka branches: 1.57.4;
regen for utimes
 1.56 19-Sep-2012  pooka regen for ppoll (and, apparently, SYCALL_ARG_PTR)
 1.55 18-Nov-2011  christos branches: 1.55.10;
- add sigtimedwait support.
- merge the siginfo population code.
 1.54 31-May-2011  njoly branches: 1.54.4;
Regen for fadvise64_64 typo fix.
 1.53 30-May-2011  alnsn Regenerate files to pick up correct RCS Ids. Suggested by Chris Badura.
 1.52 30-May-2011  alnsn Add fadvise64 and fadvise64_64 syscalls to compat_linux and compat_linux32.
 1.51 15-Apr-2011  he Regenerate these files after adding pipe2() and dup3().
 1.50 07-Jul-2010  chs branches: 1.50.2;
regen
 1.49 14-Dec-2009  matt branches: 1.49.2; 1.49.4;
Regen (new makesyscalls.sh)
 1.48 24-Nov-2009  njoly Regen for personality(2) update.
 1.47 08-Jun-2009  njoly Regen for rt_queueinfo(2) update.
 1.46 17-Jan-2009  njoly branches: 1.46.2;
Regen for wait4 update.
 1.45 15-Jan-2009  njoly Rengen for compat50 update.
 1.44 13-Jan-2009  pooka Regen to prove I didn't screw up the conversion: purely RCSID changes.
 1.43 19-Nov-2008  ad Regen.
 1.42 12-Nov-2008  njoly Regen for nanosleep(2) fix.
 1.41 23-Apr-2008  ad branches: 1.41.2; 1.41.4; 1.41.8; 1.41.10; 1.41.12;
Regen.
 1.40 04-Apr-2008  njoly branches: 1.40.2;
Regen for linux_sys_msync removal.
 1.39 24-Dec-2007  njoly branches: 1.39.6;
Regen for linux_sys_getpgid removal.
 1.38 21-Dec-2007  njoly Regen for getfsuid/setfsgid syscall exchange.
 1.37 20-Dec-2007  dsl regen
 1.36 16-Nov-2007  njoly branches: 1.36.2; 1.36.6;
Regen, for syscalls cleanup.
 1.35 09-Feb-2007  ad branches: 1.35.18; 1.35.20; 1.35.24; 1.35.26;
Merge newlock2 to head.
 1.34 01-Sep-2006  matt branches: 1.34.2;
Regen.
 1.33 30-Aug-2006  matt Regen
 1.32 10-Jun-2006  christos regen
 1.31 11-Dec-2005  christos branches: 1.31.4; 1.31.8; 1.31.14;
merge ktrace-lwp.
 1.30 18-Oct-2005  christos regen
 1.29 16-May-2005  fvdl branches: 1.29.2;
Regen.
 1.28 16-May-2005  fvdl Regen.
 1.27 26-Feb-2005  perry regen
 1.26 26-Feb-2005  perry regen
 1.25 20-Sep-2004  jdolecek branches: 1.25.4; 1.25.6;
regen:
implement support for Linux statfs64() syscall - 64bit variant of statfs()
 1.24 08-Sep-2004  jdolecek regen: add exit_group(2)
 1.23 01-Aug-2004  jdolecek regen - sync syscall lists with Linux kernel 2.6.7
 1.22 01-Aug-2004  jdolecek regen:

connect madvise(2) and mincore(2) - apparently the newer Linux libs
don't stub it anymore, so allow the application to take advantage
of them

the Linux calls appear to be compatible in the flag values and semantics,
so a wrapper is not necessary
 1.21 10-Aug-2003  jdolecek regen - added wrapper for Linux ftruncate64()
 1.20 23-Jun-2003  christos branches: 1.20.2;
Regen.
 1.19 18-Jan-2003  thorpej Regen for correct RCS ID.
 1.18 18-Jan-2003  thorpej Regen: Merge the nathanw_sa branch.
 1.17 19-May-2002  jdolecek branches: 1.17.2;
hook in truncate64(2) and ftruncate64(2)
 1.16 12-May-2002  jdolecek branches: 1.16.2;
regen - 64 fs syscalls
 1.15 10-Apr-2002  christos regen
 1.14 22-Mar-2002  christos regen
 1.13 19-Feb-2002  nathanw Regen.
 1.12 15-Feb-2002  christos - add a real linux_sys___sysctl because the mib numbers are different.
implement only the kernel version getting entries.
- make the signal conversion functions consistent; dest is arg 1.
- make linux_fakedev deal with block and char devices differently.
- add linux_sys_ugetrlimit, and flesh out the regular get/setrlimit so
that they work properly.
- add linux_mmap2 [untested].
- bump kernel to 2.4.18, and make the date be valentine's day :-)
- linux_sys_*stat64 family was totally busted. Fix it.

tested only on i386.

Status:
gdb, telnet, work
jdk-1.4.0 extractor works, jdk still coredumps.

christos
 1.11 13-Nov-2001  lukem add RCSIDs (including regeneration of files as appropriate)
 1.10 08-Sep-2001  manu Removed a hack to make PowerPC mmap work. This could have side effects on
alpha and i386. It has been tested and works on i386.
 1.9 30-May-2001  mrg branches: 1.9.2; 1.9.4;
use _KERNEL_OPT.
 1.8 13-May-2001  manu Improved the accuracy of gettimeofday/settimeofday: Linux stores a srtuct
timezone in the kernel. We now keep track of it for emulated processes.
Tested for powerpc and i386. Untested on m68k, but it should be ok
Alpha has a particular implementation (osf1_sys_gettimeofday), and it has
therefore not been touched.
 1.7 30-Mar-2001  jdolecek regen - use linux_sys_nosys() instead sys_nosys()
 1.6 30-Mar-2001  jdolecek regen
 1.5 30-Mar-2001  jdolecek regen
 1.4 27-Jan-2001  thorpej branches: 1.4.2; 1.4.4;
Regen; getpid(2) is MP-safe.
 1.3 27-Jan-2001  thorpej Regen; add sy_flags.
 1.2 20-Jan-2001  manu Fix the "created from" field of files generated from syscalls.master (this
master file did not have a RCS Id at generation time, hence the problem)
 1.1 19-Jan-2001  manu Added powerpc specific code for Linux compatibility on powerpc ports
 1.4.4.9 20-Jun-2002  nathanw Catch up to -current.
 1.4.4.8 29-May-2002  nathanw Regen.
 1.4.4.7 17-Apr-2002  nathanw Catch up to -current.
 1.4.4.6 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.4.4.5 28-Feb-2002  nathanw Catch up to -current.
 1.4.4.4 14-Nov-2001  nathanw Catch up to -current.
 1.4.4.3 21-Sep-2001  nathanw Catch up to -current.
 1.4.4.2 21-Jun-2001  nathanw Catch up to -current.
 1.4.4.1 09-Apr-2001  nathanw Catch up with -current.
 1.4.2.3 21-Apr-2001  bouyer Sync with HEAD
 1.4.2.2 11-Feb-2001  bouyer Sync with HEAD.
 1.4.2.1 27-Jan-2001  bouyer file linux_syscalls.c was added on branch thorpej_scsipi on 2001-02-11 19:13:55 +0000
 1.9.4.1 01-Oct-2001  fvdl Catch up with -current.
 1.9.2.4 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.9.2.3 16-Mar-2002  jdolecek Catch up with -current.
 1.9.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.9.2.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.16.2.1 30-May-2002  gehenna Catch up with -current.
 1.17.2.3 14-Jun-2004  jmc Regen for changes in ticket #1708
 1.17.2.2 11-May-2004  tron Regen for ticket 1686.
 1.17.2.1 22-Oct-2003  jmc Regen files (requested by tv in ticket #1427)

Proper support for mmap2
 1.20.2.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.20.2.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.20.2.4 24-Sep-2004  skrll Sync with HEAD.
 1.20.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.20.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.20.2.1 03-Aug-2004  skrll Sync with HEAD
 1.25.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.25.4.1 29-Apr-2005  kent sync with -current
 1.29.2.5 21-Jan-2008  yamt sync with head
 1.29.2.4 07-Dec-2007  yamt sync with head
 1.29.2.3 26-Feb-2007  yamt sync with head.
 1.29.2.2 30-Dec-2006  yamt sync with head.
 1.29.2.1 21-Jun-2006  yamt sync with head.
 1.31.14.1 19-Jun-2006  chap Sync with head.
 1.31.8.2 03-Sep-2006  yamt sync with head.
 1.31.8.1 26-Jun-2006  yamt sync with head.
 1.31.4.1 09-Sep-2006  rpaulo sync with head
 1.34.2.1 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.35.26.2 27-Dec-2007  mjf Sync with HEAD.
 1.35.26.1 19-Nov-2007  mjf Sync with HEAD.
 1.35.24.1 18-Nov-2007  bouyer Sync with HEAD
 1.35.20.1 09-Jan-2008  matt sync with HEAD
 1.35.18.1 21-Nov-2007  joerg Sync with HEAD.
 1.36.6.1 02-Jan-2008  bouyer Sync with HEAD
 1.36.2.1 26-Dec-2007  ad Sync with head.
 1.39.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.39.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.40.2.1 18-May-2008  yamt sync with head.
 1.41.12.1 20-Nov-2008  snj Regen for ticket 81.
 1.41.10.1 19-Jan-2009  skrll Sync with HEAD.
 1.41.8.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.41.4.2 14-May-2008  wrstuden Per discussion with ad, remove most of the #include <sys/sa.h> lines
as they were including sa.h just for the type(s) needed for syscallargs.h.

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

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

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

I think this reduction is very good thing.
 1.41.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.41.2.4 11-Aug-2010  yamt sync with head.
 1.41.2.3 11-Mar-2010  yamt sync with head
 1.41.2.2 20-Jun-2009  yamt sync with head
 1.41.2.1 04-May-2009  yamt sync with head.
 1.46.2.1 23-Jul-2009  jym Sync with HEAD.
 1.49.4.4 12-Jun-2011  rmind sync with head
 1.49.4.3 31-May-2011  rmind sync with head
 1.49.4.2 21-Apr-2011  rmind sync with head
 1.49.4.1 05-Mar-2011  rmind sync with head
 1.49.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.50.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.54.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.54.4.2 30-Oct-2012  yamt sync with head
 1.54.4.1 17-Apr-2012  yamt sync with head
 1.55.10.4 03-Dec-2017  jdolecek update from HEAD
 1.55.10.3 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.55.10.2 23-Jun-2013  tls resync from head
 1.55.10.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.57.4.2 18-May-2014  rmind sync with head
 1.57.4.1 28-Aug-2013  rmind sync with head
 1.63.2.1 10-Aug-2014  tls Rebase.
 1.69.2.1 17-Apr-2017  snj regen for ticket 1354
 1.70.2.4 05-Feb-2017  skrll Sync with HEAD
 1.70.2.3 05-Oct-2016  skrll Sync with HEAD
 1.70.2.2 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.70.2.1 06-Apr-2015  skrll Sync with HEAD
 1.74.2.3 20-Mar-2017  pgoyette Sync with HEAD
 1.74.2.2 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.74.2.1 26-Jul-2016  pgoyette Sync with HEAD
 1.78.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.81.4.1 11-May-2017  pgoyette Sync with HEAD
 1.82.10.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.82.10.1 10-Jun-2019  christos Sync with HEAD
 1.82.8.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.85.2.2 17-Dec-2020  thorpej Regen for preadv(2) and pwritev(2).
 1.85.2.1 15-Dec-2020  thorpej Regen for eventfd, timerfd, POSIX timers.
 1.96.2.1 02-Aug-2025  perseant Sync with HEAD
 1.99 28-Sep-2024  christos regen
 1.98 01-Jul-2024  christos regen
 1.97 29-Jun-2024  christos branches: 1.97.2;
regen
 1.96 19-Aug-2023  christos regen
 1.95 18-Aug-2023  christos regen
 1.94 29-Jul-2023  christos regen
 1.93 28-Jul-2023  christos regen
 1.92 02-Dec-2021  ryo regen
 1.91 24-Nov-2021  ryo regen
 1.90 20-Sep-2021  thorpej Regen for preadv(2) / pwritev(2).
 1.89 20-Sep-2021  thorpej Regen for eventfd.
 1.88 19-Sep-2021  thorpej Regen for timerfd.
 1.87 19-Sep-2021  thorpej Regen for POSIX timer syscalls.
 1.86 26-Apr-2020  thorpej branches: 1.86.2;
Regen for native futex calls.
 1.85 09-Nov-2019  jdolecek regen
 1.84 10-Aug-2018  pgoyette Regen
 1.83 10-May-2017  riastradh branches: 1.83.8; 1.83.10;
regen
 1.82 03-Feb-2017  christos branches: 1.82.4;
regen
 1.81 03-Feb-2017  martin regen
 1.80 16-Jan-2017  christos regen all
 1.79 13-Jan-2017  christos branches: 1.79.2;
regen
 1.78 02-Jan-2017  martin Regen (something apparently went wrong in previous)
 1.77 02-Jan-2017  manu Regen
 1.76 24-Jul-2016  njoly Regen for readlink/readlinkat signatures.
 1.75 27-Oct-2015  njoly branches: 1.75.2;
Regen.
 1.74 25-Oct-2015  njoly Regen for posix chown family cleanup.
 1.73 24-Sep-2015  christos regen
 1.72 07-Mar-2015  christos regen
 1.71 22-Nov-2014  njoly branches: 1.71.2;
Regen for ppoll signature fix
 1.70 31-May-2014  njoly branches: 1.70.2;
Regen for munmap(2) signature.
 1.69 20-May-2014  njoly Regen for getgroups/setgroups update.
 1.68 17-May-2014  njoly Regen for fadvise64 offset types changes.
 1.67 06-May-2014  njoly Regen for mknod device argument type change.
 1.66 04-May-2014  njoly Regen for pread/pwrite 64bit offset argument.
 1.65 08-Apr-2014  njoly Regen.
 1.64 10-Dec-2013  njoly branches: 1.64.2;
Regen.
 1.63 08-Dec-2013  njoly Regen.
 1.62 07-Nov-2013  njoly Regen for dup/dup2/dup3 argument types fix.
 1.61 24-Sep-2013  njoly Regen for utimensat(2).
 1.60 11-Aug-2013  pooka regen
 1.59 11-Aug-2013  pooka regen
 1.58 08-Apr-2013  pooka branches: 1.58.4;
regen for utimes
 1.57 19-Sep-2012  pooka regen for ppoll (and, apparently, SYCALL_ARG_PTR)
 1.56 18-Nov-2011  christos branches: 1.56.10;
- add sigtimedwait support.
- merge the siginfo population code.
 1.55 31-May-2011  njoly branches: 1.55.4;
Regen for fadvise64_64 typo fix.
 1.54 30-May-2011  alnsn Regenerate files to pick up correct RCS Ids. Suggested by Chris Badura.
 1.53 30-May-2011  alnsn Add fadvise64 and fadvise64_64 syscalls to compat_linux and compat_linux32.
 1.52 15-Apr-2011  he Regenerate these files after adding pipe2() and dup3().
 1.51 07-Jul-2010  chs branches: 1.51.2;
regen
 1.50 14-Dec-2009  matt branches: 1.50.2; 1.50.4;
Regen (new makesyscalls.sh)
 1.49 24-Nov-2009  njoly Regen for personality(2) update.
 1.48 08-Jun-2009  njoly Regen for rt_queueinfo(2) update.
 1.47 17-Jan-2009  njoly branches: 1.47.2;
Regen for wait4 update.
 1.46 15-Jan-2009  njoly Rengen for compat50 update.
 1.45 13-Jan-2009  pooka Regen to prove I didn't screw up the conversion: purely RCSID changes.
 1.44 19-Nov-2008  ad Regen.
 1.43 12-Nov-2008  njoly Regen for nanosleep(2) fix.
 1.42 23-Apr-2008  ad branches: 1.42.2; 1.42.4; 1.42.8; 1.42.10; 1.42.12;
Regen.
 1.41 04-Apr-2008  njoly branches: 1.41.2;
Regen for linux_sys_msync removal.
 1.40 24-Dec-2007  njoly branches: 1.40.6;
Regen for linux_sys_getpgid removal.
 1.39 21-Dec-2007  njoly Regen for getfsuid/setfsgid syscall exchange.
 1.38 20-Dec-2007  dsl regen
 1.37 16-Nov-2007  njoly branches: 1.37.2; 1.37.6;
Regen, for syscalls cleanup.
 1.36 09-Feb-2007  ad branches: 1.36.18; 1.36.20; 1.36.24; 1.36.26;
Merge newlock2 to head.
 1.35 01-Sep-2006  matt branches: 1.35.2;
Regen.
 1.34 30-Aug-2006  matt Regen
 1.33 10-Jun-2006  christos regen
 1.32 11-Dec-2005  christos branches: 1.32.4; 1.32.8; 1.32.14;
merge ktrace-lwp.
 1.31 18-Oct-2005  christos regen
 1.30 16-May-2005  fvdl branches: 1.30.2;
Regen.
 1.29 16-May-2005  fvdl Regen.
 1.28 26-Feb-2005  perry regen
 1.27 26-Feb-2005  perry regen
 1.26 20-Sep-2004  jdolecek branches: 1.26.4; 1.26.6;
regen:
implement support for Linux statfs64() syscall - 64bit variant of statfs()
 1.25 08-Sep-2004  jdolecek regen: add exit_group(2)
 1.24 01-Aug-2004  jdolecek regen - sync syscall lists with Linux kernel 2.6.7
 1.23 01-Aug-2004  jdolecek regen:

connect madvise(2) and mincore(2) - apparently the newer Linux libs
don't stub it anymore, so allow the application to take advantage
of them

the Linux calls appear to be compatible in the flag values and semantics,
so a wrapper is not necessary
 1.22 10-Aug-2003  jdolecek regen - added wrapper for Linux ftruncate64()
 1.21 23-Jun-2003  christos branches: 1.21.2;
Regen.
 1.20 18-Jan-2003  thorpej Regen for correct RCS ID.
 1.19 18-Jan-2003  thorpej Regen: Merge the nathanw_sa branch.
 1.18 01-Nov-2002  jdolecek regen: nsysent set to 256
 1.17 19-May-2002  jdolecek branches: 1.17.2;
hook in truncate64(2) and ftruncate64(2)
 1.16 12-May-2002  jdolecek branches: 1.16.2;
regen - 64 fs syscalls
 1.15 10-Apr-2002  christos regen
 1.14 22-Mar-2002  christos regen
 1.13 19-Feb-2002  nathanw Regen.
 1.12 15-Feb-2002  christos - add a real linux_sys___sysctl because the mib numbers are different.
implement only the kernel version getting entries.
- make the signal conversion functions consistent; dest is arg 1.
- make linux_fakedev deal with block and char devices differently.
- add linux_sys_ugetrlimit, and flesh out the regular get/setrlimit so
that they work properly.
- add linux_mmap2 [untested].
- bump kernel to 2.4.18, and make the date be valentine's day :-)
- linux_sys_*stat64 family was totally busted. Fix it.

tested only on i386.

Status:
gdb, telnet, work
jdk-1.4.0 extractor works, jdk still coredumps.

christos
 1.11 13-Nov-2001  lukem add RCSIDs (including regeneration of files as appropriate)
 1.10 08-Sep-2001  manu Removed a hack to make PowerPC mmap work. This could have side effects on
alpha and i386. It has been tested and works on i386.
 1.9 30-May-2001  mrg branches: 1.9.2; 1.9.4;
use _KERNEL_OPT.
 1.8 13-May-2001  manu Improved the accuracy of gettimeofday/settimeofday: Linux stores a srtuct
timezone in the kernel. We now keep track of it for emulated processes.
Tested for powerpc and i386. Untested on m68k, but it should be ok
Alpha has a particular implementation (osf1_sys_gettimeofday), and it has
therefore not been touched.
 1.7 30-Mar-2001  jdolecek regen - use linux_sys_nosys() instead sys_nosys()
 1.6 30-Mar-2001  jdolecek regen
 1.5 30-Mar-2001  jdolecek regen
 1.4 27-Jan-2001  thorpej branches: 1.4.2; 1.4.4;
Regen; getpid(2) is MP-safe.
 1.3 27-Jan-2001  thorpej Regen; add sy_flags.
 1.2 20-Jan-2001  manu Fix the "created from" field of files generated from syscalls.master (this
master file did not have a RCS Id at generation time, hence the problem)
 1.1 19-Jan-2001  manu Added powerpc specific code for Linux compatibility on powerpc ports
 1.4.4.10 11-Nov-2002  nathanw Catch up to -current
 1.4.4.9 20-Jun-2002  nathanw Catch up to -current.
 1.4.4.8 29-May-2002  nathanw Regen.
 1.4.4.7 17-Apr-2002  nathanw Catch up to -current.
 1.4.4.6 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.4.4.5 28-Feb-2002  nathanw Catch up to -current.
 1.4.4.4 14-Nov-2001  nathanw Catch up to -current.
 1.4.4.3 21-Sep-2001  nathanw Catch up to -current.
 1.4.4.2 21-Jun-2001  nathanw Catch up to -current.
 1.4.4.1 09-Apr-2001  nathanw Catch up with -current.
 1.4.2.3 21-Apr-2001  bouyer Sync with HEAD
 1.4.2.2 11-Feb-2001  bouyer Sync with HEAD.
 1.4.2.1 27-Jan-2001  bouyer file linux_sysent.c was added on branch thorpej_scsipi on 2001-02-11 19:13:55 +0000
 1.9.4.1 01-Oct-2001  fvdl Catch up with -current.
 1.9.2.4 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.9.2.3 16-Mar-2002  jdolecek Catch up with -current.
 1.9.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.9.2.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.16.2.1 30-May-2002  gehenna Catch up with -current.
 1.17.2.3 14-Jun-2004  jmc Regen for changes in ticket #1708
 1.17.2.2 11-May-2004  tron Regen for ticket 1686.
 1.17.2.1 22-Oct-2003  jmc Regen files (requested by tv in ticket #1427)

Proper support for mmap2
 1.21.2.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.21.2.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.21.2.4 24-Sep-2004  skrll Sync with HEAD.
 1.21.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.21.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.21.2.1 03-Aug-2004  skrll Sync with HEAD
 1.26.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.26.4.1 29-Apr-2005  kent sync with -current
 1.30.2.5 21-Jan-2008  yamt sync with head
 1.30.2.4 07-Dec-2007  yamt sync with head
 1.30.2.3 26-Feb-2007  yamt sync with head.
 1.30.2.2 30-Dec-2006  yamt sync with head.
 1.30.2.1 21-Jun-2006  yamt sync with head.
 1.32.14.1 19-Jun-2006  chap Sync with head.
 1.32.8.2 03-Sep-2006  yamt sync with head.
 1.32.8.1 26-Jun-2006  yamt sync with head.
 1.32.4.1 09-Sep-2006  rpaulo sync with head
 1.35.2.1 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.36.26.2 27-Dec-2007  mjf Sync with HEAD.
 1.36.26.1 19-Nov-2007  mjf Sync with HEAD.
 1.36.24.1 18-Nov-2007  bouyer Sync with HEAD
 1.36.20.1 09-Jan-2008  matt sync with HEAD
 1.36.18.1 21-Nov-2007  joerg Sync with HEAD.
 1.37.6.1 02-Jan-2008  bouyer Sync with HEAD
 1.37.2.1 26-Dec-2007  ad Sync with head.
 1.40.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.40.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.41.2.1 18-May-2008  yamt sync with head.
 1.42.12.1 20-Nov-2008  snj Regen for ticket 81.
 1.42.10.1 19-Jan-2009  skrll Sync with HEAD.
 1.42.8.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.42.4.2 14-May-2008  wrstuden Per discussion with ad, remove most of the #include <sys/sa.h> lines
as they were including sa.h just for the type(s) needed for syscallargs.h.

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

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

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

I think this reduction is very good thing.
 1.42.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.42.2.4 11-Aug-2010  yamt sync with head.
 1.42.2.3 11-Mar-2010  yamt sync with head
 1.42.2.2 20-Jun-2009  yamt sync with head
 1.42.2.1 04-May-2009  yamt sync with head.
 1.47.2.1 23-Jul-2009  jym Sync with HEAD.
 1.50.4.4 12-Jun-2011  rmind sync with head
 1.50.4.3 31-May-2011  rmind sync with head
 1.50.4.2 21-Apr-2011  rmind sync with head
 1.50.4.1 05-Mar-2011  rmind sync with head
 1.50.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.51.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.55.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.55.4.2 30-Oct-2012  yamt sync with head
 1.55.4.1 17-Apr-2012  yamt sync with head
 1.56.10.4 03-Dec-2017  jdolecek update from HEAD
 1.56.10.3 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.56.10.2 23-Jun-2013  tls resync from head
 1.56.10.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.58.4.2 18-May-2014  rmind sync with head
 1.58.4.1 28-Aug-2013  rmind sync with head
 1.64.2.1 10-Aug-2014  tls Rebase.
 1.70.2.1 17-Apr-2017  snj regen for ticket 1354
 1.71.2.4 05-Feb-2017  skrll Sync with HEAD
 1.71.2.3 05-Oct-2016  skrll Sync with HEAD
 1.71.2.2 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.71.2.1 06-Apr-2015  skrll Sync with HEAD
 1.75.2.3 20-Mar-2017  pgoyette Sync with HEAD
 1.75.2.2 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.75.2.1 26-Jul-2016  pgoyette Sync with HEAD
 1.79.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.82.4.1 11-May-2017  pgoyette Sync with HEAD
 1.83.10.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.83.10.1 10-Jun-2019  christos Sync with HEAD
 1.83.8.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.86.2.2 17-Dec-2020  thorpej Regen for preadv(2) and pwritev(2).
 1.86.2.1 15-Dec-2020  thorpej Regen for eventfd, timerfd, POSIX timers.
 1.97.2.1 02-Aug-2025  perseant Sync with HEAD
 1.9 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.8 11-Dec-2005  christos branches: 1.8.70; 1.8.72; 1.8.74;
merge ktrace-lwp.
 1.7 26-Feb-2005  perry nuke trailing whitespace
 1.6 26-Aug-2001  manu branches: 1.6.20; 1.6.28; 1.6.30;
Fixed a lot of mistakes in #define's (hes values instead of octal)
 1.5 26-Aug-2001  manu Moved LINUX_NCCS from MI file to MD file, because the value is different
on MIPS and sparc machines.
 1.4 19-May-2001  manu branches: 1.4.2;
Fixed a typo in a comment
 1.3 20-Jan-2001  manu branches: 1.3.2; 1.3.4;
Fixed wrong ioctl definitions that caused Linux ioctl TCGETS and many other to
fail
 1.2 20-Jan-2001  manu Moved architecure dependent part of struct linux_termio to architecture
dependent header files.
 1.1 19-Jan-2001  manu Added various header files for initial Linux compatibility on powerpc ports
 1.3.4.2 21-Sep-2001  nathanw Catch up to -current.
 1.3.4.1 21-Jun-2001  nathanw Catch up to -current.
 1.3.2.2 11-Feb-2001  bouyer Sync with HEAD.
 1.3.2.1 20-Jan-2001  bouyer file linux_termios.h was added on branch thorpej_scsipi on 2001-02-11 19:13:56 +0000
 1.4.2.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.6.30.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.6.28.1 29-Apr-2005  kent sync with -current
 1.6.20.1 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.8.74.1 16-May-2008  yamt sync with head.
 1.8.72.1 18-May-2008  yamt sync with head.
 1.8.70.1 02-Jun-2008  mjf Sync with HEAD.
 1.8 11-Jan-2009  christos merge christos-time_t
 1.7 28-Apr-2008  martin branches: 1.7.8; 1.7.14;
Remove clause 3 and 4 from TNF licenses
 1.6 11-Dec-2005  christos branches: 1.6.70; 1.6.72; 1.6.74;
merge ktrace-lwp.
 1.5 26-Feb-2005  perry nuke trailing whitespace
 1.4 20-Sep-2004  jdolecek branches: 1.4.4; 1.4.6;
move definition of linux_fsid_t to common/linux_types.h - it's identical
across all Linux archs
 1.3 19-Sep-2004  jdolecek move definition of struct linux_stafs to common/linux_types.h, and use
explicit size types - the structure definition is actually identical
on currently support COMPAT_LINUX archs, so no point to have 6 copies of it
in the tree
 1.2 20-Jan-2001  manu branches: 1.2.2; 1.2.26;
Fixed a typo
 1.1 19-Jan-2001  manu Added various header files for initial Linux compatibility on powerpc ports
 1.2.26.2 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.2.26.1 24-Sep-2004  skrll Sync with HEAD.
 1.2.2.2 11-Feb-2001  bouyer Sync with HEAD.
 1.2.2.1 20-Jan-2001  bouyer file linux_types.h was added on branch thorpej_scsipi on 2001-02-11 19:13:56 +0000
 1.4.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.4.4.1 29-Apr-2005  kent sync with -current
 1.6.74.2 04-May-2009  yamt sync with head.
 1.6.74.1 16-May-2008  yamt sync with head.
 1.6.72.1 18-May-2008  yamt sync with head.
 1.6.70.2 17-Jan-2009  mjf Sync with HEAD.
 1.6.70.1 02-Jun-2008  mjf Sync with HEAD.
 1.7.14.2 11-Jan-2009  christos add linux_suseconds_t
 1.7.14.1 28-Apr-2008  christos file linux_types.h was added on branch christos-time_t on 2009-01-11 00:17:51 +0000
 1.7.8.1 19-Jan-2009  skrll Sync with HEAD.
 1.5 11-Dec-2005  christos merge ktrace-lwp.
 1.4 01-Aug-2004  jdolecek sync the syscall lists with Linux kernel 2.6.7
 1.3 01-Nov-2002  jdolecek branches: 1.3.6;
add appropriate nsysent
 1.2 30-Mar-2001  jdolecek Use linux_sys_nosys() instead sys_nosys() here too.
 1.1 30-Sep-1998  erh branches: 1.1.12; 1.1.24;
Stubs for future development of linux compat architechtures.
 1.1.24.2 11-Nov-2002  nathanw Catch up to -current
 1.1.24.1 09-Apr-2001  nathanw Catch up with -current.
 1.1.12.1 21-Apr-2001  bouyer Sync with HEAD
 1.3.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.3.6.1 03-Aug-2004  skrll Sync with HEAD
 1.88 01-Oct-2024  riastradh sys/compat/linux/arch/*/syscalls.master: Nix trailing whitespace.

No functional change intended.
 1.87 28-Sep-2024  christos Linux GSoC-2024: renameat2, clone3, sync_file_range, syncfs (Shivraj Jamgade)
 1.86 01-Jul-2024  christos Add linux POSIX message queue support (Ricardo Branco)
 1.85 29-Jun-2024  christos branches: 1.85.2;
From gsoc 2024: Implement faccessat2 and getcpu (Shivraz)
 1.84 19-Aug-2023  christos Add inotify* syscalls GSoC 2023 (Theodore Preduta)
 1.83 18-Aug-2023  christos Add linux waitid(2) from GSoC 2023 (Theodore Preduta)
 1.82 29-Jul-2023  christos Add/fix statx, readahead, close_range. From GSoC 2023 by Theodore Preduta
 1.81 28-Jul-2023  christos add epoll syscalls
 1.80 02-Dec-2021  ryo add prlimit64(2) syscall to COMPAT_LINUX and COMPAT_LINUX32
 1.79 24-Nov-2021  ryo add getrandom(2) syscall entry
 1.78 20-Sep-2021  thorpej Add preadv(2) and pwritev(2) system calls to COMPAT_LINUX and COMPAT_LINUX32.
 1.77 20-Sep-2021  thorpej Add the eventfd system calls to COMPAT_LINUX and COMPAT_LINUX32.
 1.76 19-Sep-2021  thorpej Add the timerfd syscalls to COMPAT_LINUX and COMPAT_LINUX32.
 1.75 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.74 26-Apr-2020  thorpej branches: 1.74.2;
Add a NetBSD native futex implementation, mostly written by riastradh@.
Map the COMPAT_LINUX futex calls to the native ones.
 1.73 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.72 03-Feb-2017  christos branches: 1.72.14;
add unimple sendmmsg secvmmsg
 1.71 03-Feb-2017  martin Add accept4
 1.70 02-Jan-2017  manu branches: 1.70.2;
Add pselect6 Linux system call.
This lets Matlab R2016A run on NetBSD/amd64
 1.69 24-Jul-2016  njoly Small cleanup. Adjust readlink/readlinkat signatures to reduce diffs with
native.
 1.68 27-Oct-2015  njoly branches: 1.68.2;
Fix wrong gid types from previous.
 1.67 25-Oct-2015  njoly Cleanup posix chown family syscalls to match native (alpha, mips and
powerpc).
 1.66 22-Nov-2014  njoly branches: 1.66.2;
Fix ppoll signature (int ->u_int)
 1.65 31-May-2014  njoly branches: 1.65.2;
Fix munmap(2) signature.
 1.64 29-May-2014  njoly For utimes(2), use compat_50_sys_utimes() instead of local version.
 1.63 20-May-2014  njoly Fix getgroups/setgroups signature.
 1.62 17-May-2014  njoly Fix fadvise64 syscalls to use 64bit offset types.
 1.61 06-May-2014  njoly Reduce diffs between archs; make mknod device argument unsigned.
 1.60 04-May-2014  njoly Fix pread/pwrite syscalls which need a 64bit offset argument.
 1.59 08-Apr-2014  njoly Adjust read/write/readv/writev signature to match native versions.
 1.58 10-Dec-2013  njoly branches: 1.58.2;
Add *at() syscalls like other arches.
 1.57 08-Dec-2013  njoly Sprinkle a few more linux_umode_t where appropriate.
Reduce diffs between archs.
 1.56 07-Nov-2013  njoly Fix dup/dup2/dup3 argument types (u_int -> int).
 1.55 24-Sep-2013  njoly Add utimensat(2) for compat linux.
 1.54 11-Aug-2013  pooka Linux treats the data parameter as a pointer/long too. The comments
in the sys/ptrace.h on Linux say it should be an int, but the code
glibc/musl/kernel disagrees.
 1.53 11-Aug-2013  pooka Use long instead of int for ptrace addr. This makes things compile
better on powerpc64 with a compiler which warns about int-to-pointer
casts.
XXX: sys/ptrace.h on Linux says that the addr parameter is a "void *".
 1.52 08-Apr-2013  pooka branches: 1.52.4;
support utimes on non-alpha linux platforms
 1.51 19-Sep-2012  pooka emulate ppoll which is essentially our pollts
 1.50 18-Nov-2011  christos branches: 1.50.10;
add sigtimedwait
 1.49 09-Jul-2011  christos branches: 1.49.2;
the first argument of {g,s}etitimer() is int not u_int.
 1.48 31-May-2011  njoly Small typo in fadvise64_64 args (advise -> advice).
 1.47 30-May-2011  alnsn Add fadvise64 and fadvise64_64 syscalls to compat_linux and compat_linux32.
 1.46 15-Apr-2011  he Add dup3() and pipe2() for these archs as well.
 1.45 07-Jul-2010  chs branches: 1.45.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.44 24-Nov-2009  njoly branches: 1.44.2; 1.44.4;
Update personality(2) to match Linux definition where the argument is an
unsigned long.
 1.43 08-Jun-2009  njoly Update rt_queueinfo(2) definition, and kill a corresponding comment.
 1.42 17-Jan-2009  njoly branches: 1.42.2;
Convert linux/linux32 wait(4) to use a compat50 rusage structure.
 1.41 15-Jan-2009  njoly Update some syscalls/arguments to use the new compat50 equivalents.
 1.40 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.39 19-Nov-2008  ad Make the emulations, exec formats, coredump, NFS, and the NFS server
into modules. By and large this commit:

- shuffles header files and ifdefs
- splits code out where necessary to be modular
- adds module glue for each of the components
- adds/replaces hooks for things that can be installed at runtime
 1.38 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.37 23-Apr-2008  ad branches: 1.37.2; 1.37.4; 1.37.8; 1.37.10; 1.37.12;
-SYCALL_MPSAFE
 1.36 04-Apr-2008  njoly branches: 1.36.2;
Cleanup. Kill linux_sys_msync and use sys___msync13 instead.
No functional changes expected.
 1.35 24-Dec-2007  njoly branches: 1.35.6;
Kill unneeded linux_sys_getpgid and use native sys_getpgid instead.
 1.34 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.33 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.32 16-Nov-2007  njoly branches: 1.32.2; 1.32.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.31 04-Mar-2007  christos branches: 1.31.14; 1.31.16; 1.31.20; 1.31.22;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.30 09-Feb-2007  ad branches: 1.30.2;
Merge newlock2 to head.
 1.29 01-Sep-2006  matt branches: 1.29.2;
Don't conditionalize *sys_ptrace. The lack of sys_ptrace will be dealt
with differently.
 1.28 30-Aug-2006  matt Update to deal with options PTRACE
 1.27 10-Jun-2006  christos linux getpriority is off-by-20 so use our own function.
From PR/33671: Nicolas Joly
 1.26 11-Dec-2005  christos branches: 1.26.4; 1.26.8; 1.26.14;
merge ktrace-lwp.
 1.25 18-Oct-2005  christos add the missing %% that confused joerg and the parser.
 1.24 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.23 16-May-2005  fvdl branches: 1.23.2;
Add clock_* POSIX functions.
 1.22 16-May-2005  fvdl Add *xattr functions (they all return EOPNOTSUPP).
 1.21 26-Feb-2005  perry nuke trailing whitespace
 1.20 20-Sep-2004  jdolecek branches: 1.20.4; 1.20.6;
implement support for Linux statfs64() syscall - 64bit variant of statfs()
 1.19 08-Sep-2004  jdolecek implement basic exit_group(2), which just terminates calling thread;
apparently not many apps use thread groups yet, at least not with default
SuSE 9.1 libraries, so this is enough for now
 1.18 01-Aug-2004  jdolecek sync the syscall lists with Linux kernel 2.6.7
 1.17 01-Aug-2004  jdolecek connect madvise(2) and mincore(2) - apparently the newer Linux libs
don't stub it anymore, so allow the application to take advantage
of them

the Linux calls appear to be compatible in the flag values and semantics,
so a wrapper is not necessary
 1.16 10-Aug-2003  jdolecek add Linux compat arg wrapper for ftruncate64(), and change linux compat
truncate64() wrapper to translate args structure
NetBSD truncate() and ftrucate() have hidden 'pad' argument, so we have
to do the argument translation

Problem found and patch supplied in PR kern/22360 by Ales Krenek

This is the last of syscalls with hidden 'pad' arg we didn't have
wrapper for; all the others (lseek, mmap, pwrite, pread) already had
wrapper before.
 1.15 23-Jun-2003  christos branches: 1.15.2;
PR/21937: Todd Vierling: Proper support for mmap2
 1.14 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.13 19-May-2002  jdolecek branches: 1.13.2;
hook in truncate64(2) and ftruncate64(2)
 1.12 12-May-2002  jdolecek branches: 1.12.2;
hook in remaining 64bit fs syscalls
make most of stuff in linux_file64.c available unconditionally,
with exception of fcntl64, which is not present on Linux m68k
 1.11 10-Apr-2002  christos add getdents64
 1.10 22-Mar-2002  christos nuke mmap2, add mprotect
 1.9 19-Feb-2002  nathanw Add linux_sys_{get,set}rlimit.
 1.8 15-Feb-2002  christos - add a real linux_sys___sysctl because the mib numbers are different.
implement only the kernel version getting entries.
- make the signal conversion functions consistent; dest is arg 1.
- make linux_fakedev deal with block and char devices differently.
- add linux_sys_ugetrlimit, and flesh out the regular get/setrlimit so
that they work properly.
- add linux_mmap2 [untested].
- bump kernel to 2.4.18, and make the date be valentine's day :-)
- linux_sys_*stat64 family was totally busted. Fix it.

tested only on i386.

Status:
gdb, telnet, work
jdk-1.4.0 extractor works, jdk still coredumps.

christos
 1.7 08-Sep-2001  manu Removed a hack to make PowerPC mmap work. This could have side effects on
alpha and i386. It has been tested and works on i386.
 1.6 30-May-2001  mrg branches: 1.6.2; 1.6.4;
use _KERNEL_OPT.
 1.5 13-May-2001  manu Improved the accuracy of gettimeofday/settimeofday: Linux stores a srtuct
timezone in the kernel. We now keep track of it for emulated processes.
Tested for powerpc and i386. Untested on m68k, but it should be ok
Alpha has a particular implementation (osf1_sys_gettimeofday), and it has
therefore not been touched.
 1.4 30-Mar-2001  jdolecek Add new syscalls from Linux 2.4.3 to the lists. Not implemented ATM.
 1.3 30-Mar-2001  jdolecek Implement linux_sys_nosys() and use it instead of sys_nosys() for
unimplemented syscalls. Difference is that linux_sys_nosys() doesn't
post SIGSYS to the process. Linux doesn't do that and thus glibc (and
probably other Linux code) doesn't deal with SIGSYS, even through it
generally contains fallback code for ENOSYS case.

This also addresses port-i386/12503, though the issue was already discussed
earlier.
 1.2 27-Jan-2001  thorpej branches: 1.2.2; 1.2.4;
getpid(2) is MP-safe.
 1.1 19-Jan-2001  manu Added various header files for initial Linux compatibility on powerpc ports
 1.2.4.8 20-Jun-2002  nathanw Catch up to -current.
 1.2.4.7 29-May-2002  nathanw #include <sys/sa.h> before <sys/syscallargs.h>, to provide sa_upcall_t
now that <sys/param.h> doesn't include <sys/sa.h>.

(Behold the Power of Ed)
 1.2.4.6 17-Apr-2002  nathanw Catch up to -current.
 1.2.4.5 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.2.4.4 28-Feb-2002  nathanw Catch up to -current.
 1.2.4.3 21-Sep-2001  nathanw Catch up to -current.
 1.2.4.2 21-Jun-2001  nathanw Catch up to -current.
 1.2.4.1 09-Apr-2001  nathanw Catch up with -current.
 1.2.2.3 21-Apr-2001  bouyer Sync with HEAD
 1.2.2.2 11-Feb-2001  bouyer Sync with HEAD.
 1.2.2.1 27-Jan-2001  bouyer file syscalls.master was added on branch thorpej_scsipi on 2001-02-11 19:13:56 +0000
 1.6.4.1 01-Oct-2001  fvdl Catch up with -current.
 1.6.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.6.2.2 16-Mar-2002  jdolecek Catch up with -current.
 1.6.2.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.12.2.1 30-May-2002  gehenna Catch up with -current.
 1.13.2.3 14-Jun-2004  jmc Pullup patch (requested by skrll in ticket #1708)

Bring netbsd-1-6 inline with -current sources after the mistakes in ticket #1686
 1.13.2.2 11-May-2004  tron Pull up revision 1.16 via patch (requested by wennmach in ticket #1686):
add Linux compat arg wrapper for ftruncate64(), and change linux compat
truncate64() wrapper to translate args structure
NetBSD truncate() and ftrucate() have hidden 'pad' argument, so we have
to do the argument translation
Problem found and patch supplied in PR kern/22360 by Ales Krenek
This is the last of syscalls with hidden 'pad' arg we didn't have
wrapper for; all the others (lseek, mmap, pwrite, pread) already had
wrapper before.
 1.13.2.1 22-Oct-2003  jmc Regen files (requested by tv in ticket #1427)

Proper support for mmap2
 1.15.2.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.15.2.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.15.2.4 24-Sep-2004  skrll Sync with HEAD.
 1.15.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.15.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.15.2.1 03-Aug-2004  skrll Sync with HEAD
 1.20.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.20.4.1 29-Apr-2005  kent sync with -current
 1.23.2.5 21-Jan-2008  yamt sync with head
 1.23.2.4 07-Dec-2007  yamt sync with head
 1.23.2.3 03-Sep-2007  yamt sync with head.
 1.23.2.2 26-Feb-2007  yamt sync with head.
 1.23.2.1 21-Jun-2006  yamt sync with head.
 1.26.14.1 19-Jun-2006  chap Sync with head.
 1.26.8.1 26-Jun-2006  yamt sync with head.
 1.26.4.1 09-Sep-2006  rpaulo sync with head
 1.29.2.1 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.30.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.31.22.2 27-Dec-2007  mjf Sync with HEAD.
 1.31.22.1 19-Nov-2007  mjf Sync with HEAD.
 1.31.20.1 18-Nov-2007  bouyer Sync with HEAD
 1.31.16.1 09-Jan-2008  matt sync with HEAD
 1.31.14.1 21-Nov-2007  joerg Sync with HEAD.
 1.32.6.1 02-Jan-2008  bouyer Sync with HEAD
 1.32.2.1 26-Dec-2007  ad Sync with head.
 1.35.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.35.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.36.2.1 18-May-2008  yamt sync with head.
 1.37.12.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.37.10.1 19-Jan-2009  skrll Sync with HEAD.
 1.37.8.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.37.4.2 14-May-2008  wrstuden Per discussion with ad, remove most of the #include <sys/sa.h> lines
as they were including sa.h just for the type(s) needed for syscallargs.h.

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

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

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

I think this reduction is very good thing.
 1.37.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.37.2.4 11-Aug-2010  yamt sync with head.
 1.37.2.3 11-Mar-2010  yamt sync with head
 1.37.2.2 20-Jun-2009  yamt sync with head
 1.37.2.1 04-May-2009  yamt sync with head.
 1.42.2.1 23-Jul-2009  jym Sync with HEAD.
 1.44.4.4 12-Jun-2011  rmind sync with head
 1.44.4.3 31-May-2011  rmind sync with head
 1.44.4.2 21-Apr-2011  rmind sync with head
 1.44.4.1 05-Mar-2011  rmind sync with head
 1.44.2.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.45.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.49.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.49.2.2 30-Oct-2012  yamt sync with head
 1.49.2.1 17-Apr-2012  yamt sync with head
 1.50.10.4 03-Dec-2017  jdolecek update from HEAD
 1.50.10.3 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.50.10.2 23-Jun-2013  tls resync from head
 1.50.10.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.52.4.2 18-May-2014  rmind sync with head
 1.52.4.1 28-Aug-2013  rmind sync with head
 1.58.2.1 10-Aug-2014  tls Rebase.
 1.65.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.66.2.3 05-Feb-2017  skrll Sync with HEAD
 1.66.2.2 05-Oct-2016  skrll Sync with HEAD
 1.66.2.1 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.68.2.3 20-Mar-2017  pgoyette Sync with HEAD
 1.68.2.2 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.68.2.1 26-Jul-2016  pgoyette Sync with HEAD
 1.70.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.72.14.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.74.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.74.2.1 15-Dec-2020  thorpej Add Linux eventfd, timerfd, and POSIX timer calls.
 1.85.2.1 02-Aug-2025  perseant Sync with HEAD
 1.4 29-May-2024  christos 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 03-Oct-1998  christos branches: 1.2.184; 1.2.194; 1.2.200; 1.2.210;
Attempt to fix the mess.
 1.1 30-Sep-1998  erh Stubs for future development of linux compat architechtures.
 1.2.210.1 10-Aug-2014  tls Rebase.
 1.2.200.1 18-May-2014  rmind sync with head
 1.2.194.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.184.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.5 14-Mar-2015  njoly Support Linux MAP_LOCKED mmap flag.
 1.4 28-Apr-2008  martin branches: 1.4.44; 1.4.64;
Remove clause 3 and 4 from TNF licenses
 1.3 11-Dec-2005  christos branches: 1.3.70; 1.3.72; 1.3.74;
merge ktrace-lwp.
 1.2 28-Aug-2004  jdolecek g/c LINUX_MAP_IGNMASK define - it's not used anywhere
 1.1 30-Sep-1998  erh branches: 1.1.46;
Stubs for future development of linux compat architechtures.
 1.1.46.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.46.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.46.1 03-Sep-2004  skrll Sync with HEAD
 1.3.74.1 16-May-2008  yamt sync with head.
 1.3.72.1 18-May-2008  yamt sync with head.
 1.3.70.1 02-Jun-2008  mjf Sync with HEAD.
 1.4.64.1 06-Apr-2015  skrll Sync with HEAD
 1.4.44.1 03-Dec-2017  jdolecek update from HEAD
 1.2 01-Nov-2002  jdolecek add appropriate sys_nosys and nsysent (not that it matters here too much)
 1.1 30-Sep-1998  erh branches: 1.1.24;
Stubs for future development of linux compat architechtures.
 1.1.24.1 11-Nov-2002  nathanw Catch up to -current
 1.4 29-May-2024  christos 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 03-Oct-1998  christos branches: 1.2.184; 1.2.194; 1.2.200; 1.2.210;
Attempt to fix the mess.
 1.1 30-Sep-1998  erh Stubs for future development of linux compat architechtures.
 1.2.210.1 10-Aug-2014  tls Rebase.
 1.2.200.1 18-May-2014  rmind sync with head
 1.2.194.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.184.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.2 01-Nov-2002  jdolecek add appropriate sys_nosys and nsysent (not that it matters here too much)
 1.1 30-Sep-1998  erh branches: 1.1.24;
Stubs for future development of linux compat architechtures.
 1.1.24.1 11-Nov-2002  nathanw Catch up to -current

RSS XML Feed