Make improvements

- Fix build flakes
- Polyfill SIGWINCH on Windows
- Fix an execve issue on Windows
- Make strerror show more information
- Improve cmd.exe setup/teardown on Windows
- Support bracketed paste mode in Blinkenlights
- Show keyboard shortcuts in Blinkenlights status bar
- Fixed copy_file_range() and copyfile() w/ zip filesystem
- Size optimize GetDosArgv() to keep life.com 12kb in size
- Improve Blinkenlights ability to load weird ELF executables
- Fix program_executable_name and add GetInterpreterExecutableName
- Make Python in tiny mode fail better if docstrings are requested
- Update Python test exclusions in tiny* modes such as tinylinux
- Add bulletproof unbreakable kprintf() troubleshooting function
- Remove "oldskool" keyword from ape.S for virus scanners
- Fix issue that caused backtraces to not print sometimes
- Improve Blinkenlights serial uart character i/o
- Make clock_gettime() not clobber errno on xnu
- Improve sha256 cpuid check for old computers
- Integrate some bestline linenoise fixes
- Show runit process names better in htop
- Remove SIGPIPE from ShowCrashReports()
- Make realpath() not clobber errno
- Avoid attaching GDB on non-Linux
- Improve img.com example
This commit is contained in:
Justine Tunney 2022-03-16 13:33:13 -07:00
parent 2a938b3eaa
commit b45d50b690
194 changed files with 4881 additions and 2966 deletions

View file

@ -1,2 +0,0 @@
.include "o/libc/sysv/macros.internal.inc"
.scall __syscall,0xfff0c6ffffffffff,globl

View file

@ -224,11 +224,11 @@ syscon compat MAP_FILE 0 0 0 0 0 0 # consensus
syscon mmap MAP_SHARED 1 1 1 1 1 1 # forced consensus & faked nt
syscon mmap MAP_PRIVATE 2 2 2 2 2 2 # forced consensus & faked nt
syscon mmap MAP_TYPE 15 15 15 15 15 15 # mask for type of mapping
syscon mmap MAP_FIXED 0x10 0x10 0x10 0x10 0x10 0x10 # unix consensus; openbsd appears to forbid; faked nt
syscon mmap MAP_FIXED 0x0000010 0x0000010 0x0000010 0x0000010 0x0000010 0x0000010 # unix consensus; openbsd appears to forbid; faked nt
syscon mmap MAP_FIXED_NOREPLACE 0x8000000 0x8000000 0x8000000 0x8000000 0x8000000 0x8000000 # handled and defined by cosmo runtime; 0x100000 on linux 4.7+
syscon mmap MAP_ANONYMOUS 0x20 0x1000 0x1000 0x1000 0x1000 0x20 # bsd consensus; faked nt
syscon mmap MAP_GROWSDOWN 0x0100 0 0x0400 0x4000 0x4000 0x100000 # mandatory for OpenBSD stacks; MAP_STACK on Free/OpenBSD; MEM_TOP_DOWN on NT
syscon mmap MAP_CONCEAL 0 0 0x20000 0x8000 0x8000 0 # omit from core dumps; MAP_NOCORE on FreeBSD
syscon mmap MAP_ANONYMOUS 0x20 0x1000 0x0001000 0x1000 0x1000 0x20 # bsd consensus; faked nt
syscon mmap MAP_GROWSDOWN 0x0100 0 0x0000400 0x4000 0x4000 0x100000 # mandatory for OpenBSD stacks; MAP_STACK on Free/OpenBSD; MEM_TOP_DOWN on NT
syscon mmap MAP_CONCEAL 0 0 0x0020000 0x8000 0x8000 0 # omit from core dumps; MAP_NOCORE on FreeBSD
syscon mmap MAP_NORESERVE 0x4000 0x40 0 0 64 0 # Linux calls it "reserve"; NT calls it "commit"? which is default?
syscon mmap MAP_HUGETLB 0x040000 0 0 0 0 0x80000000 # kNtSecLargePages
syscon mmap MAP_HUGE_MASK 63 0 0 0 0 0
@ -237,44 +237,43 @@ syscon mmap MAP_LOCKED 0x2000 0 0 0 0 0
syscon mmap MAP_NONBLOCK 0x10000 0 0 0 0 0
syscon mmap MAP_POPULATE 0x8000 0 0 0 0 0 # can avoid madvise(MADV_WILLNEED) on private file mapping
syscon mmap MAP_CONCEAL 0 0 0 0x8000 0 0 # omit from dumps
syscon compat MAP_STACK 0x0100 0 0x0400 0x4000 0x2000 0x100000 # use MAP_GROWSDOWN
syscon compat MAP_NOCORE 0 0 0x20000 0x8000 0x8000 0 # use MAP_CONCEAL
syscon compat MAP_ANON 0x20 0x1000 0x1000 0x1000 0x1000 0x20 # bsd consensus; faked nt
syscon mmap MAP_STACK 0x0100 0 0x0000400 0x4000 0x2000 0x100000 # use MAP_GROWSDOWN
syscon compat MAP_NOCORE 0 0 0x0020000 0x8000 0x8000 0 # use MAP_CONCEAL
syscon compat MAP_ANON 0x20 0x1000 0x0001000 0x1000 0x1000 0x20 # bsd consensus; faked nt
syscon compat MAP_EXECUTABLE 0x1000 0 0 0 0 0 # ignored
syscon compat MAP_DENYWRITE 0x0800 0 0 0 0 0
syscon compat MAP_32BIT 0x40 0 0x080000 0 0 0 # iffy
# madvise() flags
# beneath the iceberg memory management
#
# group name GNU/Systemd XNU's Not UNIX! FreeBSD OpenBSD NetBSD The New Technology Commentary
syscon madv MADV_NORMAL 0 0 0 0 0 0x00000080 # consensus & kNtFileAttributeNormal
syscon compat POSIX_FADV_NORMAL 0 0 0 0 0 0x00000080 # consensus & kNtFileAttributeNormal
syscon compat POSIX_MADV_NORMAL 0 0 0 0 0 0x00000080 # consensus & kNtFileAttributeNormal
syscon madv MADV_DONTNEED 4 4 4 4 4 0 # TODO(jart): weird nt decommit thing?
syscon compat POSIX_MADV_DONTNEED 4 4 4 4 4 0 # unix consensus
syscon compat POSIX_FADV_DONTNEED 4 0 4 4 4 0 # unix consensus
syscon madv MADV_DONTNEED 4 4 4 4 4 127 # TODO(jart): weird nt decommit thing?
syscon compat POSIX_MADV_DONTNEED 4 4 4 4 4 127 # unix consensus
syscon compat POSIX_FADV_DONTNEED 4 127 4 4 4 127 # unix consensus
syscon madv MADV_RANDOM 1 1 1 1 1 0x10000000 # unix consensus & kNtFileFlagRandomAccess
syscon compat POSIX_MADV_RANDOM 1 1 1 1 1 0x10000000 # unix consensus & kNtFileFlagRandomAccess
syscon compat POSIX_FADV_RANDOM 1 0 1 1 1 0x10000000 # unix consensus & kNtFileFlagRandomAccess
syscon compat POSIX_FADV_RANDOM 1 127 1 1 1 0x10000000 # unix consensus & kNtFileFlagRandomAccess
syscon madv MADV_SEQUENTIAL 2 2 2 2 2 0x8000000 # unix consensus & kNtFileFlagSequentialScan
syscon compat POSIX_MADV_SEQUENTIAL 2 2 2 2 2 0x8000000 # unix consensus
syscon compat POSIX_FADV_SEQUENTIAL 2 0 2 2 2 0x8000000 # TODO(jart): double check xnu
syscon compat POSIX_FADV_SEQUENTIAL 2 127 2 2 2 0x8000000 # TODO(jart): double check xnu
syscon madv MADV_WILLNEED 3 3 3 3 3 3 # unix consensus (faked on NT)
syscon compat POSIX_MADV_WILLNEED 3 3 3 3 3 3 # unix consensus
syscon compat POSIX_FADV_WILLNEED 3 0 3 3 3 3 # TODO(jart): double check xnu
syscon madv MADV_MERGEABLE 12 0 0 0 0 0 # turns on (private anon range) page scanning and merging service (linux only)
syscon madv MADV_UNMERGEABLE 13 0 0 0 0 0 # turns off mergeable (linux only)
syscon compat POSIX_FADV_WILLNEED 3 127 3 3 3 3 # TODO(jart): double check xnu
syscon madv MADV_MERGEABLE 12 127 127 127 127 127 # turns on (private anon range) page scanning and merging service (linux only)
syscon madv MADV_UNMERGEABLE 13 127 127 127 127 127 # turns off mergeable (linux only)
syscon madv MADV_FREE 8 5 5 6 6 8 # Linux 4.5+ (c. 2016) / NT Faked → VMOfferPriorityNormal (Win8+)
syscon madv MADV_HUGEPAGE 14 0 0 0 0 0 # TODO(jart): why would we need it?
syscon madv MADV_NOHUGEPAGE 15 0 0 0 0 0 # TODO(jart): why would we need it?
syscon madv MADV_DODUMP 17 0 0 0 0 0 # TODO(jart): what is it?
syscon madv MADV_DOFORK 11 0 0 0 0 0 # TODO(jart): what is it?
syscon madv MADV_DONTDUMP 16 0 0 0 0 0 # see MAP_CONCEAL in OpenBSD; TODO(jart): what is it?
syscon madv MADV_DONTFORK 10 0 0 0 0 0 # TODO(jart): what is it?
syscon madv MADV_HWPOISON 100 0 0 0 0 0 # TODO(jart): what is it?
syscon madv MADV_REMOVE 9 0 0 0 0 0 # TODO(jart): what is it?
syscon fadv POSIX_FADV_NOREUSE 5 0 5 0 5 0 # wut
syscon madv MADV_HUGEPAGE 14 127 127 127 127 127 # TODO(jart): why would we need it?
syscon madv MADV_NOHUGEPAGE 15 127 127 127 127 127 # TODO(jart): why would we need it?
syscon madv MADV_DODUMP 17 127 127 127 127 127 # TODO(jart): what is it?
syscon madv MADV_DOFORK 11 127 127 127 127 127 # TODO(jart): what is it?
syscon madv MADV_DONTDUMP 16 127 127 127 127 127 # see MAP_CONCEAL in OpenBSD; TODO(jart): what is it?
syscon madv MADV_DONTFORK 10 127 127 127 127 127 # TODO(jart): what is it?
syscon madv MADV_HWPOISON 100 127 127 127 127 127 # TODO(jart): what is it?
syscon madv MADV_REMOVE 9 127 127 127 127 127 # TODO(jart): what is it?
syscon fadv POSIX_FADV_NOREUSE 5 127 5 127 5 127 # wut
# mmap(), mprotect(), etc.
# digital restrictions management for the people
@ -471,7 +470,7 @@ syscon auxv AT_PHENT 4 0 4 0 4 0
syscon auxv AT_PHNUM 5 0 5 0 5 0
syscon auxv AT_PAGESZ 6 0 6 0 6 0
syscon auxv AT_BASE 7 0 7 0 7 0 # address of program interpreter
syscon auxv AT_FLAGS 8 0 0 0 0 0
syscon auxv AT_FLAGS 8 0 8 0 8 0
syscon auxv AT_ENTRY 9 0 9 0 9 0 # entry address of executable
syscon auxv AT_NOTELF 10 0 10 0 0 0
syscon auxv AT_OSRELDATE 0 0 18 0 0 0
@ -487,10 +486,20 @@ syscon auxv AT_ICACHEBSIZE 20 0 0 0 0 0
syscon auxv AT_UCACHEBSIZE 21 0 0 0 0 0
syscon auxv AT_SECURE 23 0 0 0 0 0
syscon auxv AT_BASE_PLATFORM 24 0 0 0 0 0
syscon auxv AT_RANDOM 25 0 0 0 0 0 # address of sixteen bytes of random data
syscon auxv AT_RANDOM 25 0 16 0 0 0 # address of sixteen bytes of random data; AT_CANARY on FreeBSD whose AT_CANARYLEN should be 64
syscon auxv AT_HWCAP2 26 0 0 0 0 0
syscon auxv AT_EXECFN 31 31 999 999 2014 31 # address of string containing first argument passed to execve() used when running program [faked on non-linux]
syscon auxv AT_EXECFN 31 31 15 999 2014 31 # address of string containing first argument passed to execve() used when running program; AT_EXECPATH on FreeBSD
syscon auxv AT_SYSINFO_EHDR 33 0 0 0 0 0
syscon auxv AT_STACKBASE 0 0 0 0 13 0
syscon auxv AT_EXECPATH 31 31 15 999 2014 31 # FreeBSD name for AT_EXECFN
syscon auxv AT_CANARY 0 0 16 0 0 0
syscon auxv AT_CANARYLEN 0 0 17 0 0 0
syscon auxv AT_NCPUS 0 0 19 0 0 0
syscon auxv AT_PAGESIZES 0 0 20 0 0 0
syscon auxv AT_PAGESIZESLEN 0 0 21 0 0 0
syscon auxv AT_TIMEKEEP 0 0 22 0 0 0
syscon auxv AT_STACKPROT 0 0 23 0 0 0
syscon auxv AT_EHDRFLAGS 0 0 24 0 0 0
syscon auxv AT_NO_AUTOMOUNT 0x0800 0 0 0 0 0
# getrlimit() / setrlimit() resource parameter
@ -1477,13 +1486,13 @@ syscon termios IGNCR 0b0000000010000000 0b0000000010000000 0b000000001000000
syscon termios ICRNL 0b0000000100000000 0b0000000100000000 0b0000000100000000 0b0000000100000000 0b0000000100000000 0b0000000100000000 # termios.c_iflag|=ICRNL maps \r → \n input UNIXCONSENSUS
syscon termios IUCLC 0b0000001000000000 0 0 0b0001000000000000 0 0b0000001000000000 # termios.c_iflag|=IUCLC maps A-Z → a-z input
syscon termios IXON 0b0000010000000000 0b0000001000000000 0b0000001000000000 0b0000001000000000 0b0000001000000000 0b0000010000000000 # termios.c_iflag|=IXON enables flow rida
syscon termios IXANY 0b0000100000000000 0b0000100000000000 0b0000100000000000 0b0000100000000000 0b0000100000000000 0b0000100000000000 # termios.c_iflag|=IXANY tying will un-stuck teletype UNIXCONSENSUS
syscon termios IXANY 0b0000100000000000 0b0000100000000000 0b0000100000000000 0b0000100000000000 0b0000100000000000 0b0000100000000000 # termios.c_iflag|=IXANY typing will un-stuck teletype UNIXCONSENSUS
syscon termios IXOFF 0b0001000000000000 0b0000010000000000 0b0000010000000000 0b0000010000000000 0b0000010000000000 0b0001000000000000 # termios.c_iflag|=IXOFF disables annoying display freeze keys
syscon termios IMAXBEL 0b0010000000000000 0b0010000000000000 0b0010000000000000 0b0010000000000000 0b0010000000000000 0b0010000000000000 # termios.c_iflag|=IMAXBEL rings when queue full UNIXCONSENSUS
syscon termios IUTF8 0b0100000000000000 0b0100000000000000 0 0 0 0b0100000000000000 # termios.c_iflag|=IUTF8 helps w/ rubout on UTF-8 input
syscon termios OPOST 0b0000000000000001 0b000000000000000001 0b000000000000000001 0b0000000000000001 0b0000000000000001 0b0000000000000001 # termios.c_oflag&=~OPOST disables output processing magic
syscon termios OPOST 0b0000000000000001 0b000000000000000001 0b000000000000000001 0b0000000000000001 0b0000000000000001 0b0000000000000001 # termios.c_oflag&=~OPOST disables output processing magic, e.g. MULTICS newlines
syscon termios OLCUC 0b0000000000000010 0 0 0b0000000000100000 0 0b0000000000000010 # termios.c_oflag|=OLCUC maps a-z → A-Z output
syscon termios ONLCR 0b0000000000000100 0b000000000000000010 0b000000000000000010 0b0000000000000010 0b0000000000000010 0b0000000000000100 # termios.c_oflag|=ONLCR maps \n → \r\n output
syscon termios ONLCR 0b0000000000000100 0b000000000000000010 0b000000000000000010 0b0000000000000010 0b0000000000000010 0b0000000000000100 # termios.c_oflag|=ONLCR claims to map \n → \r\n output
syscon termios OCRNL 0b0000000000001000 0b000000000000010000 0b000000000000010000 0b0000000000010000 0b0000000000010000 0b0000000000001000 # termios.c_oflag|=OCRNL maps \r → \n output
syscon termios ONOCR 0b0000000000010000 0b000000000000100000 0b000000000000100000 0b0000000001000000 0b0000000001000000 0b0000000000010000 # termios.c_oflag|=ONOCR maps \r → ∅ output iff column 0
syscon termios ONLRET 0b0000000000100000 0b000000000001000000 0b000000000001000000 0b0000000010000000 0b0000000010000000 0b0000000000100000 # termios.c_oflag|=ONLRET maps \r → ∅ output

View file

@ -0,0 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon auxv,AT_CANARY,0,0,16,0,0,0

View file

@ -0,0 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon auxv,AT_CANARYLEN,0,0,17,0,0,0

View file

@ -0,0 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon auxv,AT_EHDRFLAGS,0,0,24,0,0,0

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon auxv,AT_EXECFN,31,31,999,999,2014,31
.syscon auxv,AT_EXECFN,31,31,15,999,2014,31

View file

@ -0,0 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon auxv,AT_EXECPATH,31,31,15,999,2014,31

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon auxv,AT_FLAGS,8,0,0,0,0,0
.syscon auxv,AT_FLAGS,8,0,8,0,8,0

View file

@ -0,0 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon auxv,AT_NCPUS,0,0,19,0,0,0

View file

@ -0,0 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon auxv,AT_PAGESIZES,0,0,20,0,0,0

View file

@ -0,0 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon auxv,AT_PAGESIZESLEN,0,0,21,0,0,0

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon auxv,AT_RANDOM,25,0,0,0,0,0
.syscon auxv,AT_RANDOM,25,0,16,0,0,0

View file

@ -0,0 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon auxv,AT_STACKBASE,0,0,0,0,13,0

View file

@ -0,0 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon auxv,AT_STACKPROT,0,0,23,0,0,0

View file

@ -0,0 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon auxv,AT_TIMEKEEP,0,0,22,0,0,0

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon madv,MADV_DODUMP,17,0,0,0,0,0
.syscon madv,MADV_DODUMP,17,127,127,127,127,127

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon madv,MADV_DOFORK,11,0,0,0,0,0
.syscon madv,MADV_DOFORK,11,127,127,127,127,127

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon madv,MADV_DONTDUMP,16,0,0,0,0,0
.syscon madv,MADV_DONTDUMP,16,127,127,127,127,127

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon madv,MADV_DONTFORK,10,0,0,0,0,0
.syscon madv,MADV_DONTFORK,10,127,127,127,127,127

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon madv,MADV_DONTNEED,4,4,4,4,4,0
.syscon madv,MADV_DONTNEED,4,4,4,4,4,127

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon madv,MADV_HUGEPAGE,14,0,0,0,0,0
.syscon madv,MADV_HUGEPAGE,14,127,127,127,127,127

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon madv,MADV_HWPOISON,100,0,0,0,0,0
.syscon madv,MADV_HWPOISON,100,127,127,127,127,127

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon madv,MADV_MERGEABLE,12,0,0,0,0,0
.syscon madv,MADV_MERGEABLE,12,127,127,127,127,127

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon madv,MADV_NOHUGEPAGE,15,0,0,0,0,0
.syscon madv,MADV_NOHUGEPAGE,15,127,127,127,127,127

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon madv,MADV_REMOVE,9,0,0,0,0,0
.syscon madv,MADV_REMOVE,9,127,127,127,127,127

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon madv,MADV_UNMERGEABLE,13,0,0,0,0,0
.syscon madv,MADV_UNMERGEABLE,13,127,127,127,127,127

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon compat,MAP_ANON,0x20,0x1000,0x1000,0x1000,0x1000,0x20
.syscon compat,MAP_ANON,0x20,0x1000,0x0001000,0x1000,0x1000,0x20

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon mmap,MAP_ANONYMOUS,0x20,0x1000,0x1000,0x1000,0x1000,0x20
.syscon mmap,MAP_ANONYMOUS,0x20,0x1000,0x0001000,0x1000,0x1000,0x20

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon mmap,MAP_FIXED,0x10,0x10,0x10,0x10,0x10,0x10
.syscon mmap,MAP_FIXED,0x0000010,0x0000010,0x0000010,0x0000010,0x0000010,0x0000010

View file

@ -0,0 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon mmap,MAP_FIXED_NOREPLACE,0x8000000,0x8000000,0x8000000,0x8000000,0x8000000,0x8000000

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon mmap,MAP_GROWSDOWN,0x0100,0,0x0400,0x4000,0x4000,0x100000
.syscon mmap,MAP_GROWSDOWN,0x0100,0,0x0000400,0x4000,0x4000,0x100000

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon compat,MAP_NOCORE,0,0,0x20000,0x8000,0x8000,0
.syscon compat,MAP_NOCORE,0,0,0x0020000,0x8000,0x8000,0

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon compat,MAP_STACK,0x0100,0,0x0400,0x4000,0x2000,0x100000
.syscon mmap,MAP_STACK,0x0100,0,0x0000400,0x4000,0x2000,0x100000

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon compat,POSIX_FADV_DONTNEED,4,0,4,4,4,0
.syscon compat,POSIX_FADV_DONTNEED,4,127,4,4,4,127

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon fadv,POSIX_FADV_NOREUSE,5,0,5,0,5,0
.syscon fadv,POSIX_FADV_NOREUSE,5,127,5,127,5,127

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon compat,POSIX_FADV_RANDOM,1,0,1,1,1,0x10000000
.syscon compat,POSIX_FADV_RANDOM,1,127,1,1,1,0x10000000

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon compat,POSIX_FADV_SEQUENTIAL,2,0,2,2,2,0x8000000
.syscon compat,POSIX_FADV_SEQUENTIAL,2,127,2,2,2,0x8000000

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon compat,POSIX_FADV_WILLNEED,3,0,3,3,3,3
.syscon compat,POSIX_FADV_WILLNEED,3,127,3,3,3,3

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon compat,POSIX_MADV_DONTNEED,4,4,4,4,4,0
.syscon compat,POSIX_MADV_DONTNEED,4,4,4,4,4,127

View file

@ -31,6 +31,16 @@ extern const long AT_SECURE;
extern const long AT_SYSINFO_EHDR;
extern const long AT_UCACHEBSIZE;
extern const long AT_UID;
extern const long AT_STACKBASE;
extern const long AT_EXECPATH;
extern const long AT_CANARY;
extern const long AT_CANARYLEN;
extern const long AT_NCPUS;
extern const long AT_PAGESIZES;
extern const long AT_PAGESIZESLEN;
extern const long AT_TIMEKEEP;
extern const long AT_STACKPROT;
extern const long AT_EHDRFLAGS;
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
@ -62,5 +72,15 @@ COSMOPOLITAN_C_END_
#define AT_SYSINFO_EHDR SYMBOLIC(AT_SYSINFO_EHDR)
#define AT_UCACHEBSIZE SYMBOLIC(AT_UCACHEBSIZE)
#define AT_UID SYMBOLIC(AT_UID)
#define AT_STACKBASE SYMBOLIC(AT_STACKBASE)
#define AT_EXECPATH SYMBOLIC(AT_EXECPATH)
#define AT_CANARY SYMBOLIC(AT_CANARY)
#define AT_CANARYLEN SYMBOLIC(AT_CANARYLEN)
#define AT_NCPUS SYMBOLIC(AT_NCPUS)
#define AT_PAGESIZES SYMBOLIC(AT_PAGESIZES)
#define AT_PAGESIZESLEN SYMBOLIC(AT_PAGESIZESLEN)
#define AT_TIMEKEEP SYMBOLIC(AT_TIMEKEEP)
#define AT_STACKPROT SYMBOLIC(AT_STACKPROT)
#define AT_EHDRFLAGS SYMBOLIC(AT_EHDRFLAGS)
#endif /* COSMOPOLITAN_LIBC_CALLS_AUXV_H_ */

View file

@ -2,42 +2,42 @@
#define COSMOPOLITAN_LIBC_SYSV_CONSTS_MADV_H_
#include "libc/runtime/symbolic.h"
#define MADV_DODUMP SYMBOLIC(MADV_DODUMP)
#define MADV_DOFORK SYMBOLIC(MADV_DOFORK)
#define MADV_DONTDUMP SYMBOLIC(MADV_DONTDUMP)
#define MADV_DONTFORK SYMBOLIC(MADV_DONTFORK)
#define MADV_DONTNEED SYMBOLIC(MADV_DONTNEED)
#define MADV_FREE SYMBOLIC(MADV_FREE)
#define MADV_HUGEPAGE SYMBOLIC(MADV_HUGEPAGE)
#define MADV_HWPOISON SYMBOLIC(MADV_HWPOISON)
#define MADV_MERGEABLE SYMBOLIC(MADV_MERGEABLE)
#define MADV_NOHUGEPAGE SYMBOLIC(MADV_NOHUGEPAGE)
#define MADV_NORMAL SYMBOLIC(MADV_NORMAL)
#define MADV_RANDOM SYMBOLIC(MADV_RANDOM)
#define MADV_REMOVE SYMBOLIC(MADV_REMOVE)
#define MADV_SEQUENTIAL SYMBOLIC(MADV_SEQUENTIAL)
#define MADV_DODUMP SYMBOLIC(MADV_DODUMP)
#define MADV_DOFORK SYMBOLIC(MADV_DOFORK)
#define MADV_DONTDUMP SYMBOLIC(MADV_DONTDUMP)
#define MADV_DONTFORK SYMBOLIC(MADV_DONTFORK)
#define MADV_DONTNEED SYMBOLIC(MADV_DONTNEED)
#define MADV_FREE SYMBOLIC(MADV_FREE)
#define MADV_HUGEPAGE SYMBOLIC(MADV_HUGEPAGE)
#define MADV_HWPOISON SYMBOLIC(MADV_HWPOISON)
#define MADV_MERGEABLE SYMBOLIC(MADV_MERGEABLE)
#define MADV_NOHUGEPAGE SYMBOLIC(MADV_NOHUGEPAGE)
#define MADV_NORMAL SYMBOLIC(MADV_NORMAL)
#define MADV_RANDOM SYMBOLIC(MADV_RANDOM)
#define MADV_REMOVE SYMBOLIC(MADV_REMOVE)
#define MADV_SEQUENTIAL SYMBOLIC(MADV_SEQUENTIAL)
#define MADV_UNMERGEABLE SYMBOLIC(MADV_UNMERGEABLE)
#define MADV_WILLNEED SYMBOLIC(MADV_WILLNEED)
#define MADV_WILLNEED SYMBOLIC(MADV_WILLNEED)
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
extern const long MADV_DODUMP;
extern const long MADV_DOFORK;
extern const long MADV_DONTDUMP;
extern const long MADV_DONTFORK;
extern const long MADV_DONTNEED;
extern const long MADV_FREE;
extern const long MADV_HUGEPAGE;
extern const long MADV_HWPOISON;
extern const long MADV_MERGEABLE;
extern const long MADV_NOHUGEPAGE;
extern const long MADV_NORMAL;
extern const long MADV_RANDOM;
extern const long MADV_REMOVE;
extern const long MADV_SEQUENTIAL;
extern const long MADV_UNMERGEABLE;
extern const long MADV_WILLNEED;
extern const unsigned MADV_DODUMP;
extern const unsigned MADV_DOFORK;
extern const unsigned MADV_DONTDUMP;
extern const unsigned MADV_DONTFORK;
extern const unsigned MADV_DONTNEED;
extern const unsigned MADV_FREE;
extern const unsigned MADV_HUGEPAGE;
extern const unsigned MADV_HWPOISON;
extern const unsigned MADV_MERGEABLE;
extern const unsigned MADV_NOHUGEPAGE;
extern const unsigned MADV_NORMAL;
extern const unsigned MADV_RANDOM;
extern const unsigned MADV_REMOVE;
extern const unsigned MADV_SEQUENTIAL;
extern const unsigned MADV_UNMERGEABLE;
extern const unsigned MADV_WILLNEED;
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */

File diff suppressed because it is too large Load diff

View file

@ -4,39 +4,39 @@
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
extern const long O_ACCMODE;
extern const long O_APPEND;
extern const long O_ASYNC;
extern const long O_CLOEXEC;
extern const long O_CREAT;
extern const long O_DIRECT;
extern const long O_DIRECTORY;
extern const long O_DSYNC;
extern const long O_EXCL;
extern const long O_EXEC;
extern const long O_EXLOCK;
extern const long O_LARGEFILE;
extern const long O_NDELAY;
extern const long O_NOATIME;
extern const long O_NOCTTY;
extern const long O_NOFOLLOW;
extern const long O_NOFOLLOW_ANY;
extern const long O_NONBLOCK;
extern const long O_PATH;
extern const long O_RANDOM;
extern const long O_RDONLY;
extern const long O_RDWR;
extern const long O_RSYNC;
extern const long O_SEARCH;
extern const long O_SEQUENTIAL;
extern const long O_SHLOCK;
extern const long O_SPARSE;
extern const long O_SYNC;
extern const long O_TMPFILE;
extern const long O_TRUNC;
extern const long O_TTY_INIT;
extern const long O_VERIFY;
extern const long O_WRONLY;
extern const unsigned O_ACCMODE;
extern const unsigned O_APPEND;
extern const unsigned O_ASYNC;
extern const unsigned O_CLOEXEC;
extern const unsigned O_CREAT;
extern const unsigned O_DIRECT;
extern const unsigned O_DIRECTORY;
extern const unsigned O_DSYNC;
extern const unsigned O_EXCL;
extern const unsigned O_EXEC;
extern const unsigned O_EXLOCK;
extern const unsigned O_LARGEFILE;
extern const unsigned O_NDELAY;
extern const unsigned O_NOATIME;
extern const unsigned O_NOCTTY;
extern const unsigned O_NOFOLLOW;
extern const unsigned O_NOFOLLOW_ANY;
extern const unsigned O_NONBLOCK;
extern const unsigned O_PATH;
extern const unsigned O_RANDOM;
extern const unsigned O_RDONLY;
extern const unsigned O_RDWR;
extern const unsigned O_RSYNC;
extern const unsigned O_SEARCH;
extern const unsigned O_SEQUENTIAL;
extern const unsigned O_SHLOCK;
extern const unsigned O_SPARSE;
extern const unsigned O_SYNC;
extern const unsigned O_TMPFILE;
extern const unsigned O_TRUNC;
extern const unsigned O_TTY_INIT;
extern const unsigned O_VERIFY;
extern const unsigned O_WRONLY;
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */

View file

@ -817,7 +817,6 @@ scall __acl_aclcheck_link 0xffffff1acfffffff globl
scall __mac_syscall 0xfffffffff217dfff globl
scall __acl_set_file 0xffffff15cfffffff globl
scall __acl_delete_file 0xffffff15ffffffff globl
scall __syscall 0xfff0c6ffffffffff globl
scall _umtx_op 0xffffff1c6fffffff globl
scall __semwait_signal_nocancel 0xfffffffff21a7fff globl
scall __old_semwait_signal_nocancel 0xfffffffff2173fff globl

View file

@ -102,6 +102,8 @@ __hostos:
__systemfive:
.quad 0
.endobj __systemfive,globl,hidden
__pid: .quad 0
.endobj __pid,globl,hidden
.previous
.privileged
@ -310,6 +312,18 @@ _init_systemfive_magnums:
pop %rbx
// 𝑠𝑙𝑖𝑑𝑒
.endfn _init_systemfive_magnums
#if SupportsSystemv()
_init_systemfive_pid:
ezlea __hostos,cx
mov (%rcx),%al
mov (%rdi),%eax
testb $WINDOWS|METAL,(%rcx)
jnz 1f
mov __NR_getpid,%eax
syscall
1: stosq
.endfn _init_systemfive_pid
#endif
#if SupportsSystemv() && !defined(TINY)
_init_systemfive_stack: # determinism ftw!
#if SupportsWindows() || SupportsMetal()