Improve Libc by making Python work even better

Actually Portable Python is now outperforming the Python binaries
that come bundled with Linux distros, at things like HTTP serving.
You can now have a fully featured Python install in just one .com
file that runs on six operating systems and is about 10mb in size.
With tuning, the tiniest is ~1mb. We've got most of the libraries
working, including pysqlite, and the repl now feels very pleasant.
The things you can't do quite yet are: threads and shared objects
but that can happen in the future, if the community falls in love
with this project and wants to see it developed further. Changes:

- Add siginterrupt()
- Add sqlite3 to Python
- Add issymlink() helper
- Make GetZipCdir() faster
- Add tgamma() and finite()
- Add legacy function lutimes()
- Add readlink() and realpath()
- Use heap allocations when appropriate
- Reorganize Python into two-stage build
- Save Lua / Python shell history to dotfile
- Integrate Python Lib embedding into linkage
- Make isregularfile() and isdirectory() go faster
- Make Python shell auto-completion work perfectly
- Make crash reports work better if changed directory
- Fix Python+NT open() / access() flag overflow error
- Disable Python tests relating to \N{LONG NAME} syntax
- Have Python REPL copyright() show all notice embeddings

The biggest technical challenge at the moment is working around
when Python tries to be too clever about filenames.
This commit is contained in:
Justine Tunney 2021-08-18 14:21:30 -07:00
parent 98ccbf44b1
commit 8af197560e
179 changed files with 6728 additions and 10430 deletions

View file

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

View file

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

View file

@ -0,0 +1,2 @@
.include "o/libc/sysv/macros.internal.inc"
.scall sys_lutimes,0x1a8fff114fffffff,globl,hidden

View file

@ -0,0 +1,2 @@
.include "o/libc/sysv/macros.internal.inc"
.scall sys_readlink,0x03a03a03a203a059,globl,hidden

View file

@ -173,6 +173,8 @@ syscon open O_CREAT 0x00000040 0x00000200 0x00000200 0x00000200 0x000002
syscon open O_EXCL 0x00000080 0x00000800 0x00000800 0x00000800 0x00000800 0x00000080 # bsd consensus & NT faked as Linux
syscon open O_TRUNC 0x00000200 0x00000400 0x00000400 0x00000400 0x00000400 0x00000200 # bsd consensus & NT faked as Linux
syscon open O_DIRECTORY 0x00010000 0x00100000 0x00020000 0x00020000 0x00200000 0x02000000 # useful hint on UNIX, but required on NT (see kNtFileFlagBackupSemantics)
syscon open O_RANDOM 0 0 0 0 0 0x10000000 # kNtFileFlagRandomAccess
syscon open O_SEQUENTIAL 0 0 0 0 0 0x08000000 # kNtFileFlagSequentialScan
syscon open O_DIRECT 0x00004000 0 0x00010000 0 0x00080000 0x00200000 # kNtFileFlagNoBuffering>>8
syscon open O_CLOEXEC 0x00080000 0x01000000 0x00100000 0x00010000 0x00400000 0x00080000 # NT faked as Linux
syscon open O_TMPFILE 0x00410000 0 0 0 0 0x04000100 # Linux 3.11+ (c. 2013) & kNtFileAttributeTemporary|kNtFileFlagDeleteOnClose
@ -306,9 +308,9 @@ syscon lock LOCK_UN 8 8 8 8 8 8 # unlock [unix consensus & faked
# waitpid() / wait4() options
#
# group name GNU/Systemd XNU's Not UNIX! FreeBSD OpenBSD NetBSD The New Technology Commentary
syscon waitpid WNOHANG 1 1 1 1 1 0 # helps you reap zombies; unix consensus
syscon waitpid WNOHANG 1 1 1 1 1 1 # helps you reap zombies; unix consensus; fake nt
syscon waitpid WUNTRACED 2 2 2 2 2 0 # unix consensus
syscon waitpid WCONTINUED 8 0x10 4 8 16 0
syscon waitpid WCONTINUED 8 0x10 4 8 16 0 #
# waitid() options
# no dice on openbsd >:\
@ -362,6 +364,7 @@ syscon fcntl2 F_FULLFSYNC 0 51 0 0 0 0 #
syscon fcntl2 F_NOCACHE 0 48 0 0 0 0 #
syscon fcntl3 FD_CLOEXEC 1 1 1 1 1 1 # unix consensus & faked nt
syscon fcntl F_DUPFD_CLOEXEC 0x0406 67 17 10 12 0x0406 # faked nt
syscon fcntl F_MAXFD 0 0 0 0 11 0 #
# fcntl3 O_NONBLOCK
# fcntl3 O_APPEND
@ -382,6 +385,7 @@ syscon fcntl F_RDLCK 0 1 1 1 1 0 # polyfilled nt; bsd consensus
syscon fcntl F_WRLCK 1 3 3 3 3 1 # polyfilled nt; bsd consensus
syscon fcntl F_UNLCK 2 2 2 2 2 2 # polyfilled nt; unix consensus
syscon fcntl F_ULOCK 0 0 0 0 0 0 # TODO: specified by posix but not kernels?
syscon fcntl F_LOCK 1 1 1 1 1 0 # unix consensus
syscon fcntl F_TLOCK 2 2 2 2 2 0 # unix consensus
syscon fcntl F_TEST 3 3 3 3 3 0 # unix consensus
@ -397,7 +401,6 @@ syscon fcntl F_GETLEASE 0x0401 0 0 0 0 0
syscon fcntl F_NOTIFY 0x0402 0 0 0 0 0
syscon fcntl F_SETPIPE_SZ 0x0407 0 0 0 0 0
syscon fcntl F_GETPIPE_SZ 0x0408 0 0 0 0 0
syscon fcntl F_ULOCK 0 0 0 0 0 0 # TODO: specified by posix but not kernels?
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
@ -577,12 +580,13 @@ syscon ss SIGSTKSZ 0x2000 0x020000 0x8800 0x7000 0x7000 0x2000
# group name GNU/Systemd XNU's Not UNIX! FreeBSD OpenBSD NetBSD The New Technology Commentary
syscon clock CLOCK_REALTIME 0 0 0 0 0 0 # consensus
syscon clock CLOCK_MONOTONIC 1 1 4 3 3 1 # XNU/NT faked; could move backwards if NTP introduces negative leap second
syscon clock CLOCK_PROCESS_CPUTIME_ID 2 -1 15 2 0x40000000 -1
syscon clock CLOCK_THREAD_CPUTIME_ID 3 -1 14 4 0x20000000 -1
syscon clock CLOCK_PROCESS_CPUTIME_ID 2 -1 15 2 0x40000000 -1 #
syscon clock CLOCK_THREAD_CPUTIME_ID 3 -1 14 4 0x20000000 -1 #
syscon clock CLOCK_MONOTONIC_RAW 4 4 0x4000 0x4000 0x4000 4 # actually monotonic; not subject to NTP adjustments; Linux 2.6.28+; XNU/NT/FreeBSD/OpenBSD faked; not available on RHEL5
syscon clock CLOCK_REALTIME_COARSE 5 -1 -1 -1 -1 -1 # Linux 2.6.32+; bsd consensus; not available on RHEL5
syscon clock CLOCK_MONOTONIC_COARSE 6 -1 -1 -1 -1 -1 # Linux 2.6.32+; bsd consensus; not available on RHEL5
syscon clock CLOCK_BOOTTIME 7 -1 -1 6 6 -1
syscon clock CLOCK_PROF -1 -1 2 -1 2 -1 #
syscon clock CLOCK_BOOTTIME 7 -1 -1 6 6 -1 #
syscon clock CLOCK_REALTIME_ALARM 8 -1 -1 -1 -1 -1 # bsd consensus
syscon clock CLOCK_BOOTTIME_ALARM 9 -1 -1 -1 -1 -1 # bsd consensus
syscon clock CLOCK_TAI 11 -1 -1 -1 -1 -1 # bsd consensus
@ -1495,22 +1499,22 @@ syscon termios CS8 0b0000000000110000 0b0000001100000000 0b0000001100000000
syscon termios CSIZE 0b0000000000110000 0b0000001100000000 0b0000001100000000 0b0000001100000000 0b0000001100000000 0b0000000000110000 # mask for CS𝑥 flags
syscon termios NCCS 32 32 32 32 20 32 # ARRAYLEN(termios.c_cc); faked xnu/freebsd/openbsd (originally 20) and faked nt
syscon termios VINTR 0 8 8 8 8 0 # termios.c_cc[VINTR]=𝑥
syscon termios VQUIT 1 9 9 9 9 0 # termios.c_cc[VQUIT]=𝑥
syscon termios VERASE 2 3 3 3 3 0 # termios.c_cc[VERASE]=𝑥
syscon termios VKILL 3 5 5 5 5 0 # termios.c_cc[VKILL]=𝑥
syscon termios VEOF 4 0 0 0 0 0 # termios.c_cc[VEOF]=𝑥
syscon termios VTIME 5 17 17 17 17 0 # termios.c_cc[VTIME]=𝑥 sets non-canonical read timeout to 𝑥×𝟷𝟶𝟶ms which is needed when entering escape sequences manually with the escape key
syscon termios VMIN 6 16 16 16 16 0 # termios.c_cc[VMIN]=𝑥 in non-canonical mode can be set to 0 for non-blocking reads, 1 for single character raw mode reads, or higher to buffer
syscon termios VSWTC 7 0 0 0 0 0 # termios.c_cc[VSWTC]=𝑥
syscon termios VSTART 8 12 12 12 12 0 # termios.c_cc[VSTART]=𝑥
syscon termios VSTOP 9 13 13 13 13 0 # termios.c_cc[VSTOP]=𝑥
syscon termios VSUSP 10 10 10 10 10 0 # termios.c_cc[VSUSP]=𝑥 defines suspend, i.e. Ctrl-Z (a.k.a. →, ^Z, SUB, 26, 032, 0x1A, ord('Z')^0b01000000); unix consensus
syscon termios VEOL 11 1 1 1 1 0 # termios.c_cc[VEOL]=𝑥
syscon termios VEOL2 16 2 2 2 2 0 # termios.c_cc[VEOL2]=𝑥
syscon termios VREPRINT 12 6 6 6 6 0 # termios.c_cc[VREPRINT]=𝑥
syscon termios VDISCARD 13 15 15 15 15 0 # termios.c_cc[VDISCARD]=𝑥
syscon termios VWERASE 14 4 4 4 4 0 # termios.c_cc[VWERASE]=𝑥
syscon termios VLNEXT 15 14 14 14 14 0 # termios.c_cc[VLNEXT]=𝑥
syscon termios VQUIT 1 9 9 9 9 1 # termios.c_cc[VQUIT]=𝑥
syscon termios VERASE 2 3 3 3 3 2 # termios.c_cc[VERASE]=𝑥
syscon termios VKILL 3 5 5 5 5 3 # termios.c_cc[VKILL]=𝑥
syscon termios VEOF 4 0 0 0 0 4 # termios.c_cc[VEOF]=𝑥
syscon termios VTIME 5 17 17 17 17 5 # termios.c_cc[VTIME]=𝑥 sets non-canonical read timeout to 𝑥×𝟷𝟶𝟶ms which is needed when entering escape sequences manually with the escape key
syscon termios VMIN 6 16 16 16 16 6 # termios.c_cc[VMIN]=𝑥 in non-canonical mode can be set to 0 for non-blocking reads, 1 for single character raw mode reads, or higher to buffer
syscon termios VSWTC 7 0 0 0 0 7 # termios.c_cc[VSWTC]=𝑥
syscon termios VSTART 8 12 12 12 12 8 # termios.c_cc[VSTART]=𝑥
syscon termios VSTOP 9 13 13 13 13 9 # termios.c_cc[VSTOP]=𝑥
syscon termios VSUSP 10 10 10 10 10 10 # termios.c_cc[VSUSP]=𝑥 defines suspend, i.e. Ctrl-Z (a.k.a. →, ^Z, SUB, 26, 032, 0x1A, ord('Z')^0b01000000); unix consensus
syscon termios VEOL 11 1 1 1 1 11 # termios.c_cc[VEOL]=𝑥
syscon termios VEOL2 16 2 2 2 2 16 # termios.c_cc[VEOL2]=𝑥
syscon termios VREPRINT 12 6 6 6 6 12 # termios.c_cc[VREPRINT]=𝑥
syscon termios VDISCARD 13 15 15 15 15 13 # termios.c_cc[VDISCARD]=𝑥
syscon termios VWERASE 14 4 4 4 4 14 # termios.c_cc[VWERASE]=𝑥
syscon termios VLNEXT 15 14 14 14 14 15 # termios.c_cc[VLNEXT]=𝑥
syscon termios TIOCSERGETLSR 0x5459 0 0 0 0 0 #
syscon termios TIOCSERGETMULTI 0x545a 0 0 0 0 0 #
syscon termios TIOCSERSETMULTI 0x545b 0 0 0 0 0 #
@ -1525,7 +1529,6 @@ syscon termios BUSY 4 0 0 0 0 0
syscon termios CANBSIZ 255 0 0 0 0 0
syscon termios CBAUD 0x100f 0 0 0 0 0
syscon termios CBAUDEX 0x1000 0 0 0 0 0
syscon termios CEOL 0 255 255 255 255 0 #
syscon termios EXTA 14 0x4b00 0x4b00 0x4b00 0x4b00 0 # bsd consensus
syscon termios EXTB 15 0x9600 0x9600 0x9600 0x9600 0 # bsd consensus
syscon termios ERA 0x02002c 45 45 0 0 0
@ -1921,13 +1924,9 @@ syscon misc UDP_NO_CHECK6_TX 101 0 0 0 0 0
syscon misc ACK 4 4 4 4 4 0 # unix consensus
syscon misc CDISCARD 15 15 15 15 15 0 # unix consensus
syscon misc CDSUSP 25 25 25 25 25 0 # unix consensus
syscon misc CEOF 4 4 4 4 4 0 # unix consensus
syscon misc CEOT 4 4 4 4 4 0 # unix consensus
syscon misc CERASE 127 127 127 127 127 0 # unix consensus
syscon misc CFLUSH 15 15 15 15 15 0 # unix consensus
syscon misc CHRTYPE 51 51 51 51 51 0 # unix consensus
syscon misc CINTR 3 3 3 3 3 0 # unix consensus
syscon misc CKILL 21 21 21 21 21 0 # unix consensus
syscon misc CLNEXT 22 22 22 22 22 0 # unix consensus
syscon misc CMIN 1 1 1 1 1 0 # unix consensus

View file

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

View file

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

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon termios,CEOL,0,255,255,255,255,0
.syscon clock,CLOCK_PROF,-1,-1,2,-1,2,-1

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon misc,CINTR,3,3,3,3,3,0
.syscon fcntl,F_MAXFD,0,0,0,0,11,0

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon misc,CFLUSH,15,15,15,15,15,0
.syscon open,O_RANDOM,0,0,0,0,0,0x10000000

View file

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

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon termios,VDISCARD,13,15,15,15,15,0
.syscon termios,VDISCARD,13,15,15,15,15,13

View file

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

View file

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

View file

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

View file

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

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon termios,VKILL,3,5,5,5,5,0
.syscon termios,VKILL,3,5,5,5,5,3

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon termios,VLNEXT,15,14,14,14,14,0
.syscon termios,VLNEXT,15,14,14,14,14,15

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon termios,VMIN,6,16,16,16,16,0
.syscon termios,VMIN,6,16,16,16,16,6

View file

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

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon termios,VREPRINT,12,6,6,6,6,0
.syscon termios,VREPRINT,12,6,6,6,6,12

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon termios,VSTART,8,12,12,12,12,0
.syscon termios,VSTART,8,12,12,12,12,8

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon termios,VSTOP,9,13,13,13,13,0
.syscon termios,VSTOP,9,13,13,13,13,9

View file

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

View file

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

View file

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

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon termios,VWERASE,14,4,4,4,4,0
.syscon termios,VWERASE,14,4,4,4,4,14

View file

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

View file

@ -1,19 +1,6 @@
#ifndef COSMOPOLITAN_LIBC_SYSV_CONSTS_CLOCK_H_
#define COSMOPOLITAN_LIBC_SYSV_CONSTS_CLOCK_H_
#include "libc/runtime/symbolic.h"
#define CLOCK_BOOTTIME SYMBOLIC(CLOCK_BOOTTIME)
#define CLOCK_BOOTTIME_ALARM SYMBOLIC(CLOCK_BOOTTIME_ALARM)
#define CLOCK_MONOTONIC SYMBOLIC(CLOCK_MONOTONIC)
#define CLOCK_MONOTONIC_COARSE SYMBOLIC(CLOCK_MONOTONIC_COARSE)
#define CLOCK_MONOTONIC_RAW SYMBOLIC(CLOCK_MONOTONIC_RAW)
#define CLOCK_PROCESS_CPUTIME_ID SYMBOLIC(CLOCK_PROCESS_CPUTIME_ID)
#define CLOCK_REALTIME SYMBOLIC(CLOCK_REALTIME)
#define CLOCK_REALTIME_ALARM SYMBOLIC(CLOCK_REALTIME_ALARM)
#define CLOCK_REALTIME_COARSE SYMBOLIC(CLOCK_REALTIME_COARSE)
#define CLOCK_TAI SYMBOLIC(CLOCK_TAI)
#define CLOCK_THREAD_CPUTIME_ID SYMBOLIC(CLOCK_THREAD_CPUTIME_ID)
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
@ -23,6 +10,7 @@ extern const long CLOCK_MONOTONIC;
extern const long CLOCK_MONOTONIC_COARSE;
extern const long CLOCK_MONOTONIC_RAW;
extern const long CLOCK_PROCESS_CPUTIME_ID;
extern const long CLOCK_PROF;
extern const long CLOCK_REALTIME;
extern const long CLOCK_REALTIME_ALARM;
extern const long CLOCK_REALTIME_COARSE;
@ -31,4 +19,18 @@ extern const long CLOCK_THREAD_CPUTIME_ID;
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#define CLOCK_BOOTTIME SYMBOLIC(CLOCK_BOOTTIME)
#define CLOCK_BOOTTIME_ALARM SYMBOLIC(CLOCK_BOOTTIME_ALARM)
#define CLOCK_MONOTONIC SYMBOLIC(CLOCK_MONOTONIC)
#define CLOCK_MONOTONIC_COARSE SYMBOLIC(CLOCK_MONOTONIC_COARSE)
#define CLOCK_MONOTONIC_RAW SYMBOLIC(CLOCK_MONOTONIC_RAW)
#define CLOCK_PROCESS_CPUTIME_ID SYMBOLIC(CLOCK_PROCESS_CPUTIME_ID)
#define CLOCK_PROF SYMBOLIC(CLOCK_PROF)
#define CLOCK_REALTIME SYMBOLIC(CLOCK_REALTIME)
#define CLOCK_REALTIME_ALARM SYMBOLIC(CLOCK_REALTIME_ALARM)
#define CLOCK_REALTIME_COARSE SYMBOLIC(CLOCK_REALTIME_COARSE)
#define CLOCK_TAI SYMBOLIC(CLOCK_TAI)
#define CLOCK_THREAD_CPUTIME_ID SYMBOLIC(CLOCK_THREAD_CPUTIME_ID)
#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_CLOCK_H_ */

View file

@ -22,10 +22,12 @@ extern const long O_NOCTTY;
extern const long O_NOFOLLOW;
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;
@ -37,34 +39,36 @@ 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_DIRECTORY SYMBOLIC(O_DIRECTORY)
#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_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)
#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_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_RANDOM SYMBOLIC(O_RANDOM)
#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_SEQUENTIAL SYMBOLIC(O_SEQUENTIAL)
#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

@ -12,7 +12,6 @@ extern const long BUSY;
extern const long CANBSIZ;
extern const long CBAUD;
extern const long CBAUDEX;
extern const long CEOL;
extern const long CIBAUD;
extern const long CLOCAL;
extern const long CMSPAR;
@ -35,6 +34,8 @@ extern const long ECHOKE;
extern const long ECHONL;
extern const long ECHOPRT;
extern const long ENDRUNDISC;
extern const long EXTA;
extern const long EXTB;
extern const long EXTPROC;
extern const long FF1;
extern const long FF2;
@ -222,7 +223,6 @@ COSMOPOLITAN_C_END_
#define CANBSIZ SYMBOLIC(CANBSIZ)
#define CBAUD SYMBOLIC(CBAUD)
#define CBAUDEX SYMBOLIC(CBAUDEX)
#define CEOL SYMBOLIC(CEOL)
#define CIBAUD SYMBOLIC(CIBAUD)
#define CLOCAL SYMBOLIC(CLOCAL)
#define CMSPAR SYMBOLIC(CMSPAR)
@ -241,6 +241,8 @@ COSMOPOLITAN_C_END_
#define ECHONL SYMBOLIC(ECHONL)
#define ECHOPRT SYMBOLIC(ECHOPRT)
#define ENDRUNDISC SYMBOLIC(ENDRUNDISC)
#define EXTA SYMBOLIC(EXTA)
#define EXTB SYMBOLIC(EXTB)
#define EXTPROC SYMBOLIC(EXTPROC)
#define FLUSHO SYMBOLIC(FLUSHO)
#define H4DISC SYMBOLIC(H4DISC)

View file

@ -1,11 +1,6 @@
#ifndef COSMOPOLITAN_LIBC_SYSV_CONSTS_W_H_
#define COSMOPOLITAN_LIBC_SYSV_CONSTS_W_H_
#include "libc/runtime/symbolic.h"
#define WNOHANG SYMBOLIC(WNOHANG)
#define WUNTRACED SYMBOLIC(WUNTRACED)
#define WCONTINUED SYMBOLIC(WCONTINUED)
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
@ -15,4 +10,9 @@ extern const long WCONTINUED;
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#define WNOHANG LITERALLY(1)
#define WUNTRACED SYMBOLIC(WUNTRACED)
#define WCONTINUED SYMBOLIC(WCONTINUED)
#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_W_H_ */

View file

@ -128,7 +128,7 @@ scall sys_creat 0xffffff008ffff055 globl hidden
scall sys_link 0x0090090092009056 globl hidden
scall sys_unlink 0x00a00a00a200a057 globl hidden
scall sys_symlink 0x0390390392039058 globl hidden
scall readlink 0x03a03a03a203a059 globl # usually an anti-pattern
scall sys_readlink 0x03a03a03a203a059 globl hidden # usually an anti-pattern
scall sys_chmod 0x00f00f00f200f05a globl hidden
scall sys_fchmod 0x07c07c07c207c05b globl hidden
scall sys_chown 0x010010010201005c globl hidden # impl. w/ fchownat() @asyncsignalsafe
@ -162,7 +162,7 @@ scall sys_setresuid 0xfff11a137ffff075 globl hidden # polyfilled for xnu
scall sys_setresgid 0xfff11c138ffff077 globl hidden # polyfilled for xnu
scall getresuid 0xfff119168ffff076 globl # semantics aren't well-defined
scall getresgid 0xfff11b169ffff078 globl # semantics aren't well-defined
scall sigpending 0x124034034203407f globl
scall sigpending 0x124034034203407f globl # rt_sigpending on linux
scall sys_sigsuspend 0x12606f155206f082 globl hidden # openbsd:byvalue
scall sigaltstack 0x1191200352035083 globl
scall sys_mknod 0x1c200e00e200e085 globl hidden
@ -700,7 +700,7 @@ scall lchflags 0x130fff187fffffff globl
scall lchmod 0x112fff112fffffff globl
scall lgetfh 0xffffff0a0fffffff globl
scall lpathconf 0x1f3fff201fffffff globl
scall lutimes 0x1a8fff114fffffff globl
scall sys_lutimes 0x1a8fff114fffffff globl hidden
scall mac_syscall 0xffffff18afffffff globl
scall modfind 0xffffff12ffffffff globl
scall modfnext 0xffffff12efffffff globl