Undiamond Python headers

This change gets the Python codebase into a state where it conforms to
the conventions of this codebase. It's now possible to include headers
from Python, without worrying about ordering. Python has traditionally
solved that problem by "diamonding" everything in Python.h, but that's
problematic since it means any change to any Python header invalidates
all the build artifacts. Lastly it makes tooling not work. Since it is
hard to explain to Emacs when I press C-c C-h to add an import line it
shouldn't add the header that actually defines the symbol, and instead
do follow the nonstandard Python convention.

Progress has been made on letting Python load source code from the zip
executable structure via the standard C library APIs. System calss now
recognizes zip!FILENAME alternative URIs as equivalent to zip:FILENAME
since Python uses colon as its delimiter.

Some progress has been made on embedding the notice license terms into
the Python object code. This is easier said than done since Python has
an extremely complicated ownership story.

- Some termios APIs have been added
- Implement rewinddir() dirstream API
- GetCpuCount() API added to Cosmopolitan Libc
- More bugs in Cosmopolitan Libc have been fixed
- zipobj.com now has flags for mangling the path
- Fixed bug a priori with sendfile() on certain BSDs
- Polyfill F_DUPFD and F_DUPFD_CLOEXEC across platforms
- FIOCLEX / FIONCLEX now polyfilled for fast O_CLOEXEC changes
- APE now supports a hybrid solution to no-self-modify for builds
- Many BSD-only magnums added, e.g. O_SEARCH, O_SHLOCK, SF_NODISKIO
This commit is contained in:
Justine Tunney 2021-08-12 00:42:14 -07:00
parent 20bb8db9f8
commit b420ed8248
762 changed files with 18410 additions and 53772 deletions

View file

@ -184,9 +184,12 @@ syscon open O_SYNC 0x00101000 0x00000080 0x00000080 0x00000080 0x0000008
syscon open O_NOCTTY 0x00000100 0x00020000 0x00008000 0x00008000 0x00008000 0 # used for remote viewing (default behavior on freebsd)
syscon open O_NOATIME 0x00040000 0 0 0 0 0 # optimize away access time update
syscon open O_EXEC 0 0 0x00040000 0 0x04000000 0 # it's specified by posix what does it mean
syscon open O_SEARCH 0 0 0x00040000 0 0x00800000 0 # it's specified by posix what does it mean
syscon open O_DSYNC 0x00001000 0x00400000 0 0x00000080 0x00010000 0
syscon open O_RSYNC 0x00101000 0 0 0x00000080 0x00020000 0
syscon open O_PATH 0x00200000 0 0 0 0 0
syscon open O_SHLOCK 0 0x00000010 0x00000010 0x00000010 0x00000010 0
syscon open O_EXLOCK 0 0x00000020 0x00000020 0x00000020 0x00000020 0
syscon open O_TTY_INIT 0 0 0x00080000 0 0 0
syscon compat O_LARGEFILE 0 0 0 0 0 0
@ -352,7 +355,7 @@ syscon fcntl2 F_DUPFD 0 0 0 0 0 0 # consensus
syscon fcntl2 F_GETFD 1 1 1 1 1 1 # unix consensus & faked nt
syscon fcntl2 F_SETFD 2 2 2 2 2 2 # unix consensus & faked nt
syscon fcntl3 FD_CLOEXEC 1 1 1 1 1 1 # unix consensus & faked nt
syscon fcntl F_DUPFD_CLOEXEC 0x0406 67 17 10 12 0
syscon fcntl F_DUPFD_CLOEXEC 0x0406 67 17 10 12 0x0406 # faked nt
syscon fcntl2 F_GETFL 3 3 3 3 3 3 # unix consensus & faked nt
syscon fcntl2 F_SETFL 4 4 4 4 4 4 # unix consensus & faked nt
@ -398,6 +401,8 @@ syscon fcntl F_ULOCK 0 0 0 0 0 0 # TODO: specified by posix but
syscon ioctl FIONBIO 0x5421 0x8004667e 0x8004667e 0x8004667e 0x8004667e 0x8004667e # BSD-The New Technology consensus; FIONBIO is traditional O_NONBLOCK; see F_SETFL for re-imagined api
syscon ioctl FIOASYNC 0x5452 0x8004667d 0x8004667d 0x8004667d 0x8004667d 0x8004667d # BSD-The New Technology consensus
syscon ioctl FIONREAD 0x541b 0x4004667f 0x4004667f 0x4004667f 0x4004667f 0x4004667f # BSD-The New Technology consensus; bytes waiting in FD's input buffer
syscon ioctl FIOCLEX 0x5451 0x20006601 0x20006601 0x20006601 0x20006601 0x5451 # sets "close on exec" on file descriptor the fast way; faked nt
syscon ioctl FIONCLEX 0x5450 0x20006602 0x20006602 0x20006602 0x20006602 0x5450 # clears "close on exec" on file descriptor the fast way; faked nt
#syscon ioctl FIONWRITE 0x0 0x0 0x40046677 0x0 0x0 -1 # [FreeBSD Generalization] bytes queued in FD's output buffer (same as TIOCOUTQ for TTY FDs; see also SO_SNDBUF)
#syscon ioctl FIONSPACE 0x0 0x0 0x40046676 0x0 0x0 -1 # [FreeBSD Generalization] capacity of FD's output buffer, e.g. equivalent to TIOCGSERIAL w/ UART
syscon ioctl TIOCINQ 0x541b 0x4004667f 0x4004667f 0x4004667f 0x4004667f 0x4004667f # [Linuxism] same as FIONREAD
@ -480,7 +485,11 @@ syscon rlimit RLIMIT_LOCKS 10 127 127 127 127 127 # max flock() /
syscon rlimit RLIMIT_SIGPENDING 11 127 127 127 127 127 # max sigqueue() can enqueue; bsd consensus
syscon rlimit RLIMIT_MSGQUEUE 12 127 127 127 127 127 # meh posix message queues; bsd consensus
syscon rlimit RLIMIT_NICE 13 127 127 127 127 127 # max scheduling priority; 𝑥 ∈ [1,40]; niceness is traditionally displayed as as 𝟸𝟶-𝑥, therefore 𝑥=1 (lowest priority) prints as 19 and 𝑥=40 (highest priority) prints as -20; bsd consensus
syscon rlimit RLIMIT_RTPRIO 14 127 127 127 127 127 # bsd consensus
syscon rlimit RLIMIT_RTPRIO 14 127 127 127 127 127 # woop
syscon rlimit RLIMIT_RTTIME 15 127 127 127 127 127 # woop
syscon rlimit RLIMIT_SWAP 127 127 12 127 127 127 # swap used
syscon rlimit RLIMIT_SBSIZE 127 127 9 127 127 127 # max size of all socket buffers
syscon rlimit RLIMIT_NPTS 127 127 11 127 127 127 # pseudoteletypewriters
syscon compat RLIMIT_VMEM 9 5 10 127 10 127 # same as RLIMIT_AS
# resource limit special values
@ -1208,14 +1217,21 @@ syscon statvfs ST_RDONLY 1 1 1 1 1 0 # unix consensus
syscon statvfs ST_APPEND 0x0100 0 0 0 0 0
syscon statvfs ST_IMMUTABLE 0x0200 0 0 0 0 0
syscon statvfs ST_MANDLOCK 0x40 0 0 0 0 0
syscon statvfs ST_NOATIME 0x0400 0 0 0 0 0
syscon statvfs ST_NODEV 4 0 0 0 0 0
syscon statvfs ST_NOATIME 0x0400 0 0 0x04000000 0 0
syscon statvfs ST_NODEV 4 0 0 0 0x00000010 0
syscon statvfs ST_NODIRATIME 0x0800 0 0 0 0 0
syscon statvfs ST_NOEXEC 8 0 0 0 0 0
syscon statvfs ST_RELATIME 0x1000 0 0 0 0 0
syscon statvfs ST_SYNCHRONOUS 0x10 0 0 0 0 0
syscon statvfs ST_NOEXEC 8 0 0 0 4 0
syscon statvfs ST_RELATIME 0x1000 0 0 0 0x00020000 0
syscon statvfs ST_SYNCHRONOUS 0x10 0 0 0 2 0
syscon statvfs ST_WRITE 0x80 0 0 0 0 0
# sendfile() flags
#
# group name GNU/Systemd XNU's Not UNIX! FreeBSD OpenBSD NetBSD The New Technology Commentary
syscon sf SF_NODISKIO 0 0 1 0 0 0
syscon sf SF_MNOWAIT 0 0 2 0 0 0
syscon sf SF_SYNC 0 0 4 0 0 0
# mount flags
#
# group name GNU/Systemd XNU's Not UNIX! FreeBSD OpenBSD NetBSD The New Technology Commentary
@ -1331,11 +1347,14 @@ syscon termios TIOCSIG 0x40045436 0x2000745f 0x2004745f 0x8004745f 0x800
syscon termios TIOCSPGRP 0x5410 0x80047476 0x80047476 0x80047476 0x80047476 0 # boop
syscon termios TIOCSTI 0x5412 0x80017472 0x80017472 0 0 0 # boop
syscon termios TIOCGPTN 0x80045430 0 0x4004740f 0 0 0 # boop
syscon termios TIOCGSID 0x5429 0 0x40047463 0x40047463 0x40047463 0 # boop
syscon termios TIOCGSID 0x5429 0x40047463 0x40047463 0x40047463 0x40047463 0 # boop
syscon termios TABLDISC 0 0x3 0 0x3 0x3 0 # boop
syscon termios SLIPDISC 0 0x4 0x4 0x4 0x4 0 # boop
syscon termios PPPDISC 0 0x5 0x5 0x5 0x5 0 # boop
syscon termios TIOCDRAIN 0 0x2000745e 0x2000745e 0x2000745e 0x2000745e 0 # boop
syscon termios TCFLSH 0x540B 0 0 0 0 0 # boop
syscon termios TCSBRK 0x5409 0x2000745e 0x2000745e 0x2000745e 0x2000745e 0 # TIOCDRAIN on BSD
syscon termios TCXONC 0x540A 0 0 0 0 0 # boop
syscon termios TIOCDRAIN 0x5409 0x2000745e 0x2000745e 0x2000745e 0x2000745e 0 # TCSBRK on Linux
syscon termios TIOCSTAT 0 0x20007465 0x20007465 0x20007465 0x20007465 0 # boop
syscon termios TIOCSTART 0 0x2000746e 0x2000746e 0x2000746e 0x2000746e 0 # boop
syscon termios TIOCCDTR 0 0x20007478 0x20007478 0x20007478 0x20007478 0 # boop
@ -1428,6 +1447,7 @@ syscon termios VT1 0b0100000000000000 0b010000000000000000 0b0100000000000
syscon termios FFDLY 0b1000000000000000 0b000100000000000000 0b000100000000000000 0 0 0b1000000000000000 # termios.c_oflag
syscon termios FF0 0b0000000000000000 0b000000000000000000 0b000000000000000000 0 0 0b0000000000000000 # termios.c_oflag
syscon termios FF1 0b1000000000000000 0b000100000000000000 0b000100000000000000 0 0 0b1000000000000000 # termios.c_oflag
syscon termios CS5 0 0 0 0 0 0 # consensus
syscon termios CS6 0b0000000000010000 0b0000000100000000 0b0000000100000000 0b0000000100000000 0b0000000100000000 0b0000000000010000 # termios.c_cflag flag for 6-bit characters
syscon termios CS7 0b0000000000100000 0b0000001000000000 0b0000001000000000 0b0000001000000000 0b0000001000000000 0b0000000000100000 # termios.c_cflag flag for 7-bit characters
syscon termios CS8 0b0000000000110000 0b0000001100000000 0b0000001100000000 0b0000001100000000 0b0000001100000000 0b0000000000110000 # termios.c_cflag flag for 8-bit characters
@ -1478,6 +1498,13 @@ syscon termios TCION 3 4 4 4 4 0 # bsd consensus
syscon termios TCOFLUSH 1 2 2 2 2 0 # bsd consensus
syscon termios TCOOFF 0 1 1 1 1 0 # bsd consensus
syscon termios TCOON 1 2 2 2 2 0 # bsd consensus
syscon termios CREAD 0x80 0x0800 0x0800 0x0800 0x0800 0 # bsd consensus
syscon termios CSTOPB 0x40 0x0400 0x0400 0x0400 0x0400 0 # bsd consensus
syscon termios HUPCL 0x0400 0x4000 0x4000 0x4000 0x4000 0 # bsd consensus
syscon termios CSTART 17 17 17 17 17 0 # unix consensus
syscon termios CSTOP 19 19 19 19 19 0 # unix consensus
syscon termios CSUSP 26 26 26 26 26 0 # unix consensus
syscon termios CWERASE 23 23 23 23 23 0 # unix consensus
# Pseudoteletypewriter Control
#
@ -1721,6 +1748,7 @@ syscon misc NL_SETD 1 1 0 1 1 0
syscon rusage RUSAGE_SELF 0 0 0 0 0 0 # unix consensus & faked nt
syscon rusage RUSAGE_CHILDREN -1 -1 -1 -1 -1 99 # unix consensus & unavailable on nt
syscon rusage RUSAGE_BOTH -2 99 99 99 99 99 # woop
syscon rusage RUSAGE_THREAD 1 99 1 1 1 1 # faked nt & unavailable on xnu
syscon misc FSETLOCKING_QUERY 0 0 0 0 0 0 # consensus
@ -1807,8 +1835,6 @@ syscon misc MCAST_EXCLUDE 0 2 2 0 0 0
syscon misc MCAST_MSFILTER 48 0 0 0 0 0
syscon misc AREGTYPE 0 0 0 0 0 0 # consensus
syscon misc B0 0 0 0 0 0 0 # consensus
syscon misc CS5 0 0 0 0 0 0 # consensus
syscon misc CTIME 0 0 0 0 0 0 # consensus
syscon misc EFD_CLOEXEC 0x080000 0 0 0 0 0
syscon misc EFD_NONBLOCK 0x0800 0 0 0 0 0
@ -1897,10 +1923,6 @@ syscon misc COPY_VERIFY 58 0 0 0 0 0
syscon misc CQUIT 28 28 28 28 28 0 # unix consensus
syscon misc CREPRINT 18 18 18 18 18 0 # unix consensus
syscon misc CRPRNT 18 18 18 18 18 0 # unix consensus
syscon misc CSTART 17 17 17 17 17 0 # unix consensus
syscon misc CSTOP 19 19 19 19 19 0 # unix consensus
syscon misc CSUSP 26 26 26 26 26 0 # unix consensus
syscon misc CWERASE 23 23 23 23 23 0 # unix consensus
syscon misc DATA 3 3 3 3 3 0 # unix consensus
syscon misc DEV_BSIZE 0x0200 0x0200 0x0200 0x0200 0x0200 0 # unix consensus
syscon misc DIRTYPE 53 53 53 53 53 0 # unix consensus
@ -2980,46 +3002,46 @@ syscon misc AIO_ALLDONE 2 1 3 0 0 0
syscon misc AIO_NOTCANCELED 1 4 2 0 0 0
syscon misc AIO_CANCELED 0 2 1 0 0 0
syscon baud B0 0 0 0 0 0 0 # consensus
syscon baud B50 1 50 50 50 50 0 # bsd consensus
syscon baud B75 2 75 75 75 75 0 # bsd consensus
syscon baud B110 3 110 110 110 110 0 # bsd consensus
syscon baud B134 4 134 134 134 134 0 # bsd consensus
syscon baud B150 5 150 150 150 150 0 # bsd consensus
syscon baud B200 6 200 200 200 200 0 # bsd consensus
syscon baud B300 7 300 300 300 300 0 # bsd consensus
syscon baud B600 8 600 600 600 600 0 # bsd consensus
syscon baud B1200 9 0x04b0 0x04b0 0x04b0 0x04b0 0 # bsd consensus
syscon baud B1800 10 0x0708 0x0708 0x0708 0x0708 0 # bsd consensus
syscon baud B2400 11 0x0960 0x0960 0x0960 0x0960 0 # bsd consensus
syscon baud B4800 12 0x12c0 0x12c0 0x12c0 0x12c0 0 # bsd consensus
syscon baud B9600 13 0x2580 0x2580 0x2580 0x2580 0 # bsd consensus
syscon baud B19200 14 0x4b00 0x4b00 0x4b00 0x4b00 0 # bsd consensus
syscon baud B38400 15 0x9600 0x9600 0x9600 0x9600 0 # bsd consensus
syscon baud B57600 0x1001 0xe100 0xe100 0xe100 0xe100 0 # bsd consensus
syscon baud B115200 0x1002 0x01c200 0x01c200 0x01c200 0x01c200 0 # bsd consensus
syscon baud B230400 0x1003 0x038400 0x038400 0x038400 0x038400 0 # bsd consensus
syscon baud B500000 0x1005 0 0 0 0 0
syscon baud B576000 0x1006 0 0 0 0 0
syscon baud B1000000 0x1008 0 0 0 0 0
syscon baud B1152000 0x1009 0 0 0 0 0
syscon baud B1500000 0x100a 0 0 0 0 0
syscon baud B2000000 0x100b 0 0 0 0 0
syscon baud B2500000 0x100c 0 0 0 0 0
syscon baud B3000000 0x100d 0 0 0 0 0
syscon baud B3500000 0x100e 0 0 0 0 0
syscon baud B4000000 0x100f 0 0 0 0 0
syscon misc ALLOW_MEDIUM_REMOVAL 30 0 0 0 0 0
syscon misc ASU 0 2 2 2 2 0 # bsd consensus
syscon misc ATF_NETMASK 0x20 0 0 0 0 0
syscon misc AXSIG 0 0x10 0x10 0x10 0x10 0 # bsd consensus
syscon misc B1000000 0x1008 0 0 0 0 0
syscon misc B110 3 110 110 110 110 0 # bsd consensus
syscon misc B115200 0x1002 0x01c200 0x01c200 0x01c200 0x01c200 0 # bsd consensus
syscon misc B1152000 0x1009 0 0 0 0 0
syscon misc B1200 9 0x04b0 0x04b0 0x04b0 0x04b0 0 # bsd consensus
syscon misc B134 4 134 134 134 134 0 # bsd consensus
syscon misc B150 5 150 150 150 150 0 # bsd consensus
syscon misc B1500000 0x100a 0 0 0 0 0
syscon misc B1800 10 0x0708 0x0708 0x0708 0x0708 0 # bsd consensus
syscon misc B19200 14 0x4b00 0x4b00 0x4b00 0x4b00 0 # bsd consensus
syscon misc B200 6 200 200 200 200 0 # bsd consensus
syscon misc B2000000 0x100b 0 0 0 0 0
syscon misc B230400 0x1003 0x038400 0x038400 0x038400 0x038400 0 # bsd consensus
syscon misc B2400 11 0x0960 0x0960 0x0960 0x0960 0 # bsd consensus
syscon misc B2500000 0x100c 0 0 0 0 0
syscon misc B300 7 300 300 300 300 0 # bsd consensus
syscon misc B3000000 0x100d 0 0 0 0 0
syscon misc B3500000 0x100e 0 0 0 0 0
syscon misc B38400 15 0x9600 0x9600 0x9600 0x9600 0 # bsd consensus
syscon misc B4000000 0x100f 0 0 0 0 0
syscon misc B4800 12 0x12c0 0x12c0 0x12c0 0x12c0 0 # bsd consensus
syscon misc B50 1 50 50 50 50 0 # bsd consensus
syscon misc B500000 0x1005 0 0 0 0 0
syscon misc B57600 0x1001 0xe100 0xe100 0xe100 0xe100 0 # bsd consensus
syscon misc B576000 0x1006 0 0 0 0 0
syscon misc B600 8 600 600 600 600 0 # bsd consensus
syscon misc B75 2 75 75 75 75 0 # bsd consensus
syscon misc B9600 13 0x2580 0x2580 0x2580 0x2580 0 # bsd consensus
syscon misc BITSPERBYTE 8 0 0 0 0 0
syscon misc BLANK_CHECK 8 0 0 0 0 0
syscon misc CHANGE_DEFINITION 0x40 0 0 0 0 0
syscon misc CHARBITS 8 0 0 0 0 0
syscon misc CHECK_CONDITION 1 0 0 0 0 0
syscon misc CONDITION_GOOD 2 0 0 0 0 0
syscon misc CREAD 0x80 0x0800 0x0800 0x0800 0x0800 0 # bsd consensus
syscon misc CSTOPB 0x40 0x0400 0x0400 0x0400 0x0400 0 # bsd consensus
syscon misc DATA_PROTECT 7 0 0 0 0 0
syscon misc DELAYTIMER_MAX 0x7fffffff 0 0 0 0 0
syscon misc DMAXEXP 0x0400 0 0 0 0 0
@ -3044,7 +3066,6 @@ syscon misc FOPEN_MAX 0x10 20 20 20 20 0 # bsd consensus
syscon misc FORMAT_UNIT 4 0 0 0 0 0
syscon misc HARDWARE_ERROR 4 0 0 0 0 0
syscon misc HEAD_OF_QUEUE_TAG 33 0 0 0 0 0
syscon misc HUPCL 0x0400 0x4000 0x4000 0x4000 0x4000 0 # bsd consensus
syscon misc IGMP_MEMBERSHIP_QUERY 17 0 0 0 0 0
syscon misc ILLEGAL_REQUEST 5 0 0 0 0 0
syscon misc INITIATE_RECOVERY 15 0 0 0 0 0

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon misc,B0,0,0,0,0,0,0
.syscon baud,B0,0,0,0,0,0,0

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon misc,B1000000,0x1008,0,0,0,0,0
.syscon baud,B1000000,0x1008,0,0,0,0,0

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon misc,B110,3,110,110,110,110,0
.syscon baud,B110,3,110,110,110,110,0

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon misc,B115200,0x1002,0x01c200,0x01c200,0x01c200,0x01c200,0
.syscon baud,B115200,0x1002,0x01c200,0x01c200,0x01c200,0x01c200,0

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon misc,B1152000,0x1009,0,0,0,0,0
.syscon baud,B1152000,0x1009,0,0,0,0,0

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon misc,B1200,9,0x04b0,0x04b0,0x04b0,0x04b0,0
.syscon baud,B1200,9,0x04b0,0x04b0,0x04b0,0x04b0,0

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon misc,B134,4,134,134,134,134,0
.syscon baud,B134,4,134,134,134,134,0

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon misc,B150,5,150,150,150,150,0
.syscon baud,B150,5,150,150,150,150,0

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon misc,B1500000,0x100a,0,0,0,0,0
.syscon baud,B1500000,0x100a,0,0,0,0,0

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon misc,B1800,10,0x0708,0x0708,0x0708,0x0708,0
.syscon baud,B1800,10,0x0708,0x0708,0x0708,0x0708,0

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon misc,B19200,14,0x4b00,0x4b00,0x4b00,0x4b00,0
.syscon baud,B19200,14,0x4b00,0x4b00,0x4b00,0x4b00,0

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon misc,B200,6,200,200,200,200,0
.syscon baud,B200,6,200,200,200,200,0

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon misc,B2000000,0x100b,0,0,0,0,0
.syscon baud,B2000000,0x100b,0,0,0,0,0

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon misc,B230400,0x1003,0x038400,0x038400,0x038400,0x038400,0
.syscon baud,B230400,0x1003,0x038400,0x038400,0x038400,0x038400,0

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon misc,B2400,11,0x0960,0x0960,0x0960,0x0960,0
.syscon baud,B2400,11,0x0960,0x0960,0x0960,0x0960,0

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon misc,B2500000,0x100c,0,0,0,0,0
.syscon baud,B2500000,0x100c,0,0,0,0,0

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon misc,B300,7,300,300,300,300,0
.syscon baud,B300,7,300,300,300,300,0

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon misc,B3000000,0x100d,0,0,0,0,0
.syscon baud,B3000000,0x100d,0,0,0,0,0

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon misc,B3500000,0x100e,0,0,0,0,0
.syscon baud,B3500000,0x100e,0,0,0,0,0

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon misc,B38400,15,0x9600,0x9600,0x9600,0x9600,0
.syscon baud,B38400,15,0x9600,0x9600,0x9600,0x9600,0

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon misc,B4000000,0x100f,0,0,0,0,0
.syscon baud,B4000000,0x100f,0,0,0,0,0

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon misc,B4800,12,0x12c0,0x12c0,0x12c0,0x12c0,0
.syscon baud,B4800,12,0x12c0,0x12c0,0x12c0,0x12c0,0

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon misc,B50,1,50,50,50,50,0
.syscon baud,B50,1,50,50,50,50,0

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon misc,B500000,0x1005,0,0,0,0,0
.syscon baud,B500000,0x1005,0,0,0,0,0

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon misc,B57600,0x1001,0xe100,0xe100,0xe100,0xe100,0
.syscon baud,B57600,0x1001,0xe100,0xe100,0xe100,0xe100,0

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon misc,B576000,0x1006,0,0,0,0,0
.syscon baud,B576000,0x1006,0,0,0,0,0

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon misc,B600,8,600,600,600,600,0
.syscon baud,B600,8,600,600,600,600,0

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon misc,B75,2,75,75,75,75,0
.syscon baud,B75,2,75,75,75,75,0

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon misc,B9600,13,0x2580,0x2580,0x2580,0x2580,0
.syscon baud,B9600,13,0x2580,0x2580,0x2580,0x2580,0

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon misc,CREAD,0x80,0x0800,0x0800,0x0800,0x0800,0
.syscon termios,CREAD,0x80,0x0800,0x0800,0x0800,0x0800,0

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon misc,CS5,0,0,0,0,0,0
.syscon termios,CS5,0,0,0,0,0,0

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon misc,CSTART,17,17,17,17,17,0
.syscon termios,CSTART,17,17,17,17,17,0

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon misc,CSTOP,19,19,19,19,19,0
.syscon termios,CSTOP,19,19,19,19,19,0

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon misc,CSTOPB,0x40,0x0400,0x0400,0x0400,0x0400,0
.syscon termios,CSTOPB,0x40,0x0400,0x0400,0x0400,0x0400,0

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon misc,CSUSP,26,26,26,26,26,0
.syscon termios,CSUSP,26,26,26,26,26,0

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon misc,CWERASE,23,23,23,23,23,0
.syscon termios,CWERASE,23,23,23,23,23,0

View file

@ -0,0 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon ioctl,FIOCLEX,0x5451,0x20006601,0x20006601,0x20006601,0x20006601,0x5451

View file

@ -0,0 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon ioctl,FIONCLEX,0x5450,0x20006602,0x20006602,0x20006602,0x20006602,0x5450

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon fcntl,F_DUPFD_CLOEXEC,0x0406,67,17,10,12,0
.syscon fcntl,F_DUPFD_CLOEXEC,0x0406,67,17,10,12,0x0406

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon misc,HUPCL,0x0400,0x4000,0x4000,0x4000,0x4000,0
.syscon termios,HUPCL,0x0400,0x4000,0x4000,0x4000,0x4000,0

View file

@ -0,0 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon open,O_EXLOCK,0,0x00000020,0x00000020,0x00000020,0x00000020,0

View file

@ -0,0 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon open,O_SEARCH,0,0,0x00040000,0,0x00800000,0

View file

@ -0,0 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon open,O_SHLOCK,0,0x00000010,0x00000010,0x00000010,0x00000010,0

View file

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

View file

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

View file

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

View file

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

View file

@ -0,0 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon rusage,RUSAGE_BOTH,-2,99,99,99,99,99

View file

@ -0,0 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon sf,SF_MNOWAIT,0,0,2,0,0,0

View file

@ -0,0 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon sf,SF_NODISKIO,0,0,1,0,0,0

View file

@ -0,0 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon sf,SF_SYNC,0,0,4,0,0,0

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon statvfs,ST_NOATIME,0x0400,0,0,0,0,0
.syscon statvfs,ST_NOATIME,0x0400,0,0,0x04000000,0,0

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon statvfs,ST_NODEV,4,0,0,0,0,0
.syscon statvfs,ST_NODEV,4,0,0,0,0x00000010,0

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon statvfs,ST_NOEXEC,8,0,0,0,0,0
.syscon statvfs,ST_NOEXEC,8,0,0,0,4,0

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon statvfs,ST_RELATIME,0x1000,0,0,0,0,0
.syscon statvfs,ST_RELATIME,0x1000,0,0,0,0x00020000,0

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon statvfs,ST_SYNCHRONOUS,0x10,0,0,0,0,0
.syscon statvfs,ST_SYNCHRONOUS,0x10,0,0,0,2,0

View file

@ -0,0 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon termios,TCSBRK,0x5409,0x2000745e,0x2000745e,0x2000745e,0x2000745e,0

View file

@ -0,0 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon termios,TCXONC,0x540A,0,0,0,0,0

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon termios,TIOCDRAIN,0,0x2000745e,0x2000745e,0x2000745e,0x2000745e,0
.syscon termios,TIOCDRAIN,0x5409,0x2000745e,0x2000745e,0x2000745e,0x2000745e,0

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon termios,TIOCGSID,0x5429,0,0x40047463,0x40047463,0x40047463,0
.syscon termios,TIOCGSID,0x5429,0x40047463,0x40047463,0x40047463,0x40047463,0

70
libc/sysv/consts/baud.h Normal file
View file

@ -0,0 +1,70 @@
#ifndef COSMOPOLITAN_LIBC_SYSV_CONSTS_BAUD_H_
#define COSMOPOLITAN_LIBC_SYSV_CONSTS_BAUD_H_
#include "libc/runtime/symbolic.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
extern const long B0;
extern const long B50;
extern const long B75;
extern const long B110;
extern const long B134;
extern const long B150;
extern const long B200;
extern const long B300;
extern const long B600;
extern const long B1200;
extern const long B1800;
extern const long B2400;
extern const long B4800;
extern const long B9600;
extern const long B19200;
extern const long B38400;
extern const long B57600;
extern const long B115200;
extern const long B230400;
extern const long B500000;
extern const long B576000;
extern const long B1000000;
extern const long B1152000;
extern const long B1500000;
extern const long B2000000;
extern const long B2500000;
extern const long B3000000;
extern const long B3500000;
extern const long B4000000;
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#define B0 LITERALLY(0)
#define B50 SYMBOLIC(B50)
#define B75 SYMBOLIC(B75)
#define B110 SYMBOLIC(B110)
#define B134 SYMBOLIC(B134)
#define B150 SYMBOLIC(B150)
#define B200 SYMBOLIC(B200)
#define B300 SYMBOLIC(B300)
#define B600 SYMBOLIC(B600)
#define B1200 SYMBOLIC(B1200)
#define B1800 SYMBOLIC(B1800)
#define B2400 SYMBOLIC(B2400)
#define B4800 SYMBOLIC(B4800)
#define B9600 SYMBOLIC(B9600)
#define B19200 SYMBOLIC(B19200)
#define B38400 SYMBOLIC(B38400)
#define B57600 SYMBOLIC(B57600)
#define B115200 SYMBOLIC(B115200)
#define B230400 SYMBOLIC(B230400)
#define B500000 SYMBOLIC(B500000)
#define B576000 SYMBOLIC(B576000)
#define B1000000 SYMBOLIC(B1000000)
#define B1152000 SYMBOLIC(B1152000)
#define B1500000 SYMBOLIC(B1500000)
#define B2000000 SYMBOLIC(B2000000)
#define B2500000 SYMBOLIC(B2500000)
#define B3000000 SYMBOLIC(B3000000)
#define B3500000 SYMBOLIC(B3500000)
#define B4000000 SYMBOLIC(B4000000)
#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_BAUD_H_ */

View file

@ -4,15 +4,19 @@
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
extern const long FIONBIO;
extern const long FIONREAD;
extern const long FIOASYNC;
extern const long FIOCLEX;
extern const long FIONBIO;
extern const long FIONCLEX;
extern const long FIONREAD;
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#define FIONBIO SYMBOLIC(FIONBIO)
#define FIONREAD SYMBOLIC(FIONREAD)
#define FIOASYNC SYMBOLIC(FIOASYNC)
#define FIOCLEX SYMBOLIC(FIOCLEX)
#define FIONBIO SYMBOLIC(FIONBIO)
#define FIONCLEX SYMBOLIC(FIONCLEX)
#define FIONREAD SYMBOLIC(FIONREAD)
#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_FIO_H_ */

View file

@ -14,6 +14,7 @@ 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;
@ -24,6 +25,8 @@ extern const long O_PATH;
extern const long O_RDONLY;
extern const long O_RDWR;
extern const long O_RSYNC;
extern const long O_SEARCH;
extern const long O_SHLOCK;
extern const long O_SPARSE;
extern const long O_SYNC;
extern const long O_TMPFILE;
@ -34,31 +37,34 @@ extern const long O_WRONLY;
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#define O_ACCMODE SYMBOLIC(O_ACCMODE)
#define O_APPEND SYMBOLIC(O_APPEND)
#define O_ASYNC SYMBOLIC(O_ASYNC)
#define O_CLOEXEC SYMBOLIC(O_CLOEXEC)
#define O_CREAT SYMBOLIC(O_CREAT)
#define O_DIRECT SYMBOLIC(O_DIRECT)
#define O_ACCMODE SYMBOLIC(O_ACCMODE)
#define O_APPEND SYMBOLIC(O_APPEND)
#define O_ASYNC SYMBOLIC(O_ASYNC)
#define O_CLOEXEC SYMBOLIC(O_CLOEXEC)
#define O_CREAT SYMBOLIC(O_CREAT)
#define O_DIRECT SYMBOLIC(O_DIRECT)
#define O_DIRECTORY SYMBOLIC(O_DIRECTORY)
#define O_DSYNC SYMBOLIC(O_DSYNC)
#define O_EXCL SYMBOLIC(O_EXCL)
#define O_EXEC SYMBOLIC(O_EXEC)
#define O_DSYNC SYMBOLIC(O_DSYNC)
#define O_EXCL SYMBOLIC(O_EXCL)
#define O_EXEC SYMBOLIC(O_EXEC)
#define O_EXLOCK SYMBOLIC(O_EXLOCK)
#define O_LARGEFILE SYMBOLIC(O_LARGEFILE)
#define O_NDELAY SYMBOLIC(O_NDELAY)
#define O_NOATIME SYMBOLIC(O_NOATIME)
#define O_NOCTTY SYMBOLIC(O_NOCTTY)
#define O_NOFOLLOW SYMBOLIC(O_NOFOLLOW)
#define O_NONBLOCK SYMBOLIC(O_NONBLOCK)
#define O_PATH SYMBOLIC(O_PATH)
#define O_RDONLY SYMBOLIC(O_RDONLY)
#define O_RDWR SYMBOLIC(O_RDWR)
#define O_RSYNC SYMBOLIC(O_RSYNC)
#define O_SPARSE SYMBOLIC(O_SPARSE)
#define O_SYNC SYMBOLIC(O_SYNC)
#define O_TMPFILE SYMBOLIC(O_TMPFILE)
#define O_TRUNC SYMBOLIC(O_TRUNC)
#define O_TTY_INIT SYMBOLIC(O_TTY_INIT)
#define O_WRONLY SYMBOLIC(O_WRONLY)
#define O_NDELAY SYMBOLIC(O_NDELAY)
#define O_NOATIME SYMBOLIC(O_NOATIME)
#define O_NOCTTY SYMBOLIC(O_NOCTTY)
#define O_NOFOLLOW SYMBOLIC(O_NOFOLLOW)
#define O_NONBLOCK SYMBOLIC(O_NONBLOCK)
#define O_PATH SYMBOLIC(O_PATH)
#define O_RDONLY SYMBOLIC(O_RDONLY)
#define O_RDWR SYMBOLIC(O_RDWR)
#define O_RSYNC SYMBOLIC(O_RSYNC)
#define O_SEARCH SYMBOLIC(O_SEARCH)
#define O_SHLOCK SYMBOLIC(O_SHLOCK)
#define O_SPARSE SYMBOLIC(O_SPARSE)
#define O_SYNC SYMBOLIC(O_SYNC)
#define O_TMPFILE SYMBOLIC(O_TMPFILE)
#define O_TRUNC SYMBOLIC(O_TRUNC)
#define O_TTY_INIT SYMBOLIC(O_TTY_INIT)
#define O_WRONLY SYMBOLIC(O_WRONLY)
#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_O_H_ */

View file

@ -13,10 +13,14 @@
#define RLIMIT_NICE SYMBOLIC(RLIMIT_NICE)
#define RLIMIT_NOFILE SYMBOLIC(RLIMIT_NOFILE)
#define RLIMIT_NPROC SYMBOLIC(RLIMIT_NPROC)
#define RLIMIT_NPTS SYMBOLIC(RLIMIT_NPTS)
#define RLIMIT_RSS SYMBOLIC(RLIMIT_RSS)
#define RLIMIT_RTPRIO SYMBOLIC(RLIMIT_RTPRIO)
#define RLIMIT_RTTIME SYMBOLIC(RLIMIT_RTTIME)
#define RLIMIT_SBSIZE SYMBOLIC(RLIMIT_SBSIZE)
#define RLIMIT_SIGPENDING SYMBOLIC(RLIMIT_SIGPENDING)
#define RLIMIT_STACK SYMBOLIC(RLIMIT_STACK)
#define RLIMIT_SWAP SYMBOLIC(RLIMIT_SWAP)
#define RLIMIT_VMEM SYMBOLIC(RLIMIT_VMEM)
#if !(__ASSEMBLER__ + __LINKER__ + 0)
@ -33,10 +37,14 @@ extern const long RLIMIT_MSGQUEUE;
extern const long RLIMIT_NICE;
extern const long RLIMIT_NOFILE;
extern const long RLIMIT_NPROC;
extern const long RLIMIT_NPTS;
extern const long RLIMIT_RSS;
extern const long RLIMIT_RTPRIO;
extern const long RLIMIT_RTTIME;
extern const long RLIMIT_SBSIZE;
extern const long RLIMIT_SIGPENDING;
extern const long RLIMIT_STACK;
extern const long RLIMIT_SWAP;
extern const long RLIMIT_VMEM;
COSMOPOLITAN_C_END_

View file

@ -4,6 +4,7 @@
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
extern const long RUSAGE_BOTH;
extern const long RUSAGE_CHILDREN;
extern const long RUSAGE_SELF;
extern const long RUSAGE_THREAD;
@ -11,8 +12,9 @@ extern const long RUSAGE_THREAD;
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#define RUSAGE_SELF LITERALLY(0)
#define RUSAGE_BOTH SYMBOLIC(RUSAGE_BOTH)
#define RUSAGE_CHILDREN SYMBOLIC(RUSAGE_CHILDREN)
#define RUSAGE_THREAD SYMBOLIC(RUSAGE_THREAD)
#define RUSAGE_SELF LITERALLY(0)
#define RUSAGE_THREAD SYMBOLIC(RUSAGE_THREAD)
#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_RUSAGE_H_ */

25
libc/sysv/consts/sf.h Normal file
View file

@ -0,0 +1,25 @@
#ifndef COSMOPOLITAN_LIBC_SYSV_CONSTS_SF_H_
#define COSMOPOLITAN_LIBC_SYSV_CONSTS_SF_H_
#include "libc/runtime/symbolic.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
struct sf_hdtr {
struct iovec *headers;
int hdr_cnt;
struct iovec *trailers;
int trl_cnt;
};
extern const long SF_MNOWAIT;
extern const long SF_NODISKIO;
extern const long SF_SYNC;
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#define SF_MNOWAIT SYMBOLIC(SF_MNOWAIT)
#define SF_NODISKIO SYMBOLIC(SF_NODISKIO)
#define SF_SYNC SYMBOLIC(SF_SYNC)
#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_SF_H_ */

View file

@ -5,6 +5,8 @@
COSMOPOLITAN_C_START_
extern const long BRKINT;
extern const long BS1;
extern const long BS2;
extern const long BSDLY;
extern const long BUSY;
extern const long CANBSIZ;
@ -15,11 +17,19 @@ extern const long CEOL;
extern const long CIBAUD;
extern const long CLOCAL;
extern const long CMSPAR;
extern const long CR1;
extern const long CR2;
extern const long CR3;
extern const long CRDLY;
extern const long CREAD;
extern const long CS5;
extern const long CS6;
extern const long CS7;
extern const long CS8;
extern const long CSIZE;
extern const long CSTOPB;
extern const long CSUSP;
extern const long CWERASE;
extern const long ECHO;
extern const long ECHOCTL;
extern const long ECHOE;
@ -29,9 +39,12 @@ extern const long ECHONL;
extern const long ECHOPRT;
extern const long ENDRUNDISC;
extern const long EXTPROC;
extern const long FF1;
extern const long FF2;
extern const long FFDLY;
extern const long FLUSHO;
extern const long H4DISC;
extern const long HUPCL;
extern const long ICANON;
extern const long ICRNL;
extern const long IEXTEN;
@ -50,6 +63,9 @@ extern const long IXOFF;
extern const long IXON;
extern const long NCCS;
extern const long NETGRAPHDISC;
extern const long NL1;
extern const long NL2;
extern const long NL3;
extern const long NLDLY;
extern const long NMEADISC;
extern const long NOFLSH;
@ -68,15 +84,28 @@ extern const long PENDIN;
extern const long PPPDISC;
extern const long SLIPDISC;
extern const long STRIPDISC;
extern const long TAB1;
extern const long TAB2;
extern const long TAB3;
extern const long TABDLY;
extern const long TABLDISC;
extern const long TCFLSH;
extern const long TCGETS;
extern const long TCIFLUSH;
extern const long TCIOFF;
extern const long TCIOFLUSH;
extern const long TCION;
extern const long TCOFLUSH;
extern const long TCOOFF;
extern const long TCOON;
extern const long TCSADRAIN;
extern const long TCSAFLUSH;
extern const long TCSANOW;
extern const long TCSBRK;
extern const long TCSETS;
extern const long TCSETSF;
extern const long TCSETSW;
extern const long TCXONC;
extern const long TIOCCBRK;
extern const long TIOCCDTR;
extern const long TIOCCHKVERAUTH;
@ -125,8 +154,8 @@ extern const long TOSTOP;
extern const long TTYDISC;
extern const long VDISCARD;
extern const long VEOF;
extern const long VEOL;
extern const long VEOL2;
extern const long VEOL;
extern const long VERASE;
extern const long VERIFY;
extern const long VINTR;
@ -139,10 +168,13 @@ extern const long VSTART;
extern const long VSTOP;
extern const long VSUSP;
extern const long VSWTC;
extern const long VT1;
extern const long VT2;
extern const long VTDLY;
extern const long VTIME;
extern const long VWERASE;
extern const long XCASE;
extern const long XTABS;
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
@ -198,10 +230,15 @@ COSMOPOLITAN_C_END_
#define CIBAUD SYMBOLIC(CIBAUD)
#define CLOCAL SYMBOLIC(CLOCAL)
#define CMSPAR SYMBOLIC(CMSPAR)
#define CREAD SYMBOLIC(CREAD)
#define CS5 SYMBOLIC(CS5)
#define CS6 SYMBOLIC(CS6)
#define CS7 SYMBOLIC(CS7)
#define CS8 SYMBOLIC(CS8)
#define CSIZE SYMBOLIC(CSIZE)
#define CSTOPB SYMBOLIC(CSTOPB)
#define CSUSP SYMBOLIC(CSUSP)
#define CWERASE SYMBOLIC(CWERASE)
#define ECHO LITERALLY(8)
#define ECHOCTL SYMBOLIC(ECHOCTL)
#define ECHOE SYMBOLIC(ECHOE)
@ -213,6 +250,7 @@ COSMOPOLITAN_C_END_
#define EXTPROC SYMBOLIC(EXTPROC)
#define FLUSHO SYMBOLIC(FLUSHO)
#define H4DISC SYMBOLIC(H4DISC)
#define HUPCL SYMBOLIC(HUPCL)
#define ICANON SYMBOLIC(ICANON)
#define IEXTEN SYMBOLIC(IEXTEN)
#define ISIG SYMBOLIC(ISIG)
@ -238,13 +276,24 @@ COSMOPOLITAN_C_END_
#define SLIPDISC SYMBOLIC(SLIPDISC)
#define STRIPDISC SYMBOLIC(STRIPDISC)
#define TABLDISC SYMBOLIC(TABLDISC)
#define TCFLSH SYMBOLIC(TCFLSH)
#define TCFLSH SYMBOLIC(TCFLSH)
#define TCGETS SYMBOLIC(TCGETS)
#define TCSANOW LITERALLY(0)
#define TCIFLUSH SYMBOLIC(TCIFLUSH)
#define TCIOFF SYMBOLIC(TCIOFF)
#define TCIOFLUSH SYMBOLIC(TCIOFLUSH)
#define TCION SYMBOLIC(TCION)
#define TCOFLUSH SYMBOLIC(TCOFLUSH)
#define TCOOFF SYMBOLIC(TCOOFF)
#define TCOON SYMBOLIC(TCOON)
#define TCSADRAIN LITERALLY(1)
#define TCSAFLUSH LITERALLY(2)
#define TCSANOW LITERALLY(0)
#define TCSBRK SYMBOLIC(TCSBRK)
#define TCSETS SYMBOLIC(TCSETS)
#define TCSETSF SYMBOLIC(TCSETSF)
#define TCSETSW SYMBOLIC(TCSETSW)
#define TCXONC SYMBOLIC(TCXONC)
#define TIOCCBRK SYMBOLIC(TIOCCBRK)
#define TIOCCDTR SYMBOLIC(TIOCCDTR)
#define TIOCCHKVERAUTH SYMBOLIC(TIOCCHKVERAUTH)

18
libc/sysv/consts/waitid.h Normal file
View file

@ -0,0 +1,18 @@
#ifndef COSMOPOLITAN_LIBC_SYSV_CONSTS_WAITID_H_
#define COSMOPOLITAN_LIBC_SYSV_CONSTS_WAITID_H_
#include "libc/runtime/symbolic.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
extern const long WEXITED;
extern const long WSTOPPED;
extern const long WNOWAIT;
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#define WEXITED SYMBOLIC(WEXITED)
#define WSTOPPED SYMBOLIC(WSTOPPED)
#define WNOWAIT SYMBOLIC(WNOWAIT)
#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_WAITID_H_ */

View file

@ -233,7 +233,7 @@ scall lgetxattr 0x17bffffffffff0c0 globl
scall llistxattr 0x17effffffffff0c3 globl
scall lremovexattr 0x181ffffffffff0c6 globl
scall sys_sched_setaffinity 0xfffffffffffff0cb globl hidden
scall sched_getaffinity 0xfffffffffffff0cc globl
scall sched_getaffinity 0xfffffffffffff0cc globl # returns bytes written on success. we polyfill bad posix designs like nice() returning 0, but we won't polyfill a bad unilateral redesign that's just glibc
scall cpuset_getaffinity 0xffffff1e7fffffff globl
scall cpuset_setaffinity 0xffffff1e8fffffff globl
scall io_setup 0xfffffffffffff0ce globl