mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-14 23:09:16 +00:00
Make major improvements to redbean and libraries
The most exciting improvement is dynamic pages will soon be able to use the executable itself as an object store. it required a heroic technique for overcoming ETXTBSY restrictions which lets us open the executable in read/write mode, which means (1) wa can restore the APE header, and (2) we can potentially containerize redbean extension code so that modules you download for your redbean online will only impact your redbean. Here's a list of breaking changes to redbean: - Remove /tool/net/ prefix from magic ZIP paths - GetHeader() now returns NIL if header is absent Here's a list of fixes and enhancements to redbean: - Support 64-bit ZIP archives - Record User-Agent header in logs - Add twelve error handlers to accept() - Display octal st_mode on listing page - Show ZIP file comments on listing page - Restore APE MZ header on redbean startup - Track request count on redbean index page - Report server uptime on redbean index page - Don't bind server socket using SO_REUSEPORT - Fix #151 where Lua LoadAsset() could free twice - Report rusage accounting when workers exit w/ -vv - Use ZIP iattr field as text/plain vs. binary hint - Add ParseUrl() API for parsing things like a.href - Add ParseParams() API for parsing HTTP POST bodies - Add IsAcceptablePath() API for checking dots, etc. - Add IsValidHttpToken() API for validating sane ASCII - Add IsAcceptableHostPort() for validating HOST[:PORT] - Send 400 response to HTTP/1.1 requests without a Host - Send 403 response if ZIP or file isn't other readable - Add virtual hosting that tries prepending Host to path - Route requests based on Host in Request-URI if present - Host routing will attempt to remove or add the www. prefix - Sign-extend UNIX timestamps and don't adjust FileTime zone Here's some of the improvements made to Cosmopolitan Libc: - Fix ape.S indentation - Improve consts.sh magnums - Write pretty good URL parser - Improve rusage accounting apis - Bring mremap() closer to working - Added ZIP APIs which will change - Check for overflow in reallocarray() - Remove overly fancy linkage in strerror() - Fix GDB attach on crash w/ OpenBSD msyscall() - Make sigqueue() portable to most UNIX distros - Make integer serialization macros more elegant - Bring back 34x tprecode8to16() performance boost - Make malloc() more resilient to absurdly large sizes
This commit is contained in:
parent
69c508729e
commit
bf03b2e64c
307 changed files with 4557 additions and 2581 deletions
|
@ -1,64 +1,32 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_SYSV_CONSTS_S_H_
|
||||
#define COSMOPOLITAN_LIBC_SYSV_CONSTS_S_H_
|
||||
#include "libc/runtime/symbolic.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
extern const long S_IEXEC;
|
||||
extern const long S_IFBLK;
|
||||
extern const long S_IFCHR;
|
||||
extern const long S_IFDIR;
|
||||
extern const long S_IFIFO;
|
||||
extern const long S_IFLNK;
|
||||
extern const long S_IFMT;
|
||||
extern const long S_IFREG;
|
||||
extern const long S_IFSOCK;
|
||||
extern const long S_IREAD;
|
||||
extern const long S_IRGRP;
|
||||
extern const long S_IROTH;
|
||||
extern const long S_IRUSR;
|
||||
extern const long S_IRWXG;
|
||||
extern const long S_IRWXO;
|
||||
extern const long S_IRWXU;
|
||||
extern const long S_ISGID;
|
||||
extern const long S_ISUID;
|
||||
extern const long S_ISVTX;
|
||||
extern const long S_IWGRP;
|
||||
extern const long S_IWOTH;
|
||||
extern const long S_IWRITE;
|
||||
extern const long S_IWUSR;
|
||||
extern const long S_IXGRP;
|
||||
extern const long S_IXOTH;
|
||||
extern const long S_IXUSR;
|
||||
#define S_ISVTX 01000 /* THE STICKY BIT */
|
||||
#define S_ISGID 02000 /* the setgid bit */
|
||||
#define S_ISUID 04000 /* the setuid bit */
|
||||
#define S_IXUSR 00100 /* user --x; just use octal */
|
||||
#define S_IWUSR 00200 /* user -w-; just use octal */
|
||||
#define S_IRUSR 00400 /* user r--; just use octal */
|
||||
#define S_IRWXU 00700 /* user rwx; just use octal */
|
||||
#define S_IXGRP 00010 /* group --x; just use octal */
|
||||
#define S_IWGRP 00020 /* group -w-; just use octal */
|
||||
#define S_IRGRP 00040 /* group r--; just use octal */
|
||||
#define S_IRWXG 00070 /* group rwx; just use octal */
|
||||
#define S_IXOTH 00001 /* other --x; just use octal */
|
||||
#define S_IWOTH 00002 /* other -w-; just use octal */
|
||||
#define S_IROTH 00004 /* other r--; just use octal */
|
||||
#define S_IRWXO 00007 /* other rwx; just use octal */
|
||||
#define S_IREAD 00400 /* just use octal */
|
||||
#define S_IEXEC 00100 /* just use octal */
|
||||
#define S_IWRITE 00200 /* just use octal */
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
|
||||
#define S_IFREG LITERALLY(0100000)
|
||||
#define S_IFBLK LITERALLY(0060000)
|
||||
#define S_IFCHR LITERALLY(0020000)
|
||||
#define S_IFDIR LITERALLY(0040000)
|
||||
#define S_IFIFO LITERALLY(0010000)
|
||||
#define S_IFMT LITERALLY(0170000)
|
||||
#define S_IFLNK LITERALLY(0120000)
|
||||
#define S_IFSOCK LITERALLY(0140000)
|
||||
#define S_ISVTX LITERALLY(01000)
|
||||
#define S_ISGID LITERALLY(02000)
|
||||
#define S_ISUID LITERALLY(04000)
|
||||
#define S_IEXEC LITERALLY(00100)
|
||||
#define S_IWRITE LITERALLY(00200)
|
||||
#define S_IREAD LITERALLY(00400)
|
||||
#define S_IXUSR LITERALLY(00100)
|
||||
#define S_IWUSR LITERALLY(00200)
|
||||
#define S_IRUSR LITERALLY(00400)
|
||||
#define S_IRWXU LITERALLY(00700)
|
||||
#define S_IXGRP LITERALLY(00010)
|
||||
#define S_IWGRP LITERALLY(00020)
|
||||
#define S_IRGRP LITERALLY(00040)
|
||||
#define S_IRWXG LITERALLY(00070)
|
||||
#define S_IXOTH LITERALLY(00001)
|
||||
#define S_IWOTH LITERALLY(00002)
|
||||
#define S_IROTH LITERALLY(00004)
|
||||
#define S_IRWXO LITERALLY(00007)
|
||||
#define S_IFIFO (1 << 12) /* pipe */
|
||||
#define S_IFCHR (2 << 12) /* character device */
|
||||
#define S_IFDIR (4 << 12) /* directory */
|
||||
#define S_IFBLK (6 << 12) /* block device */
|
||||
#define S_IFREG (8 << 12) /* regular file */
|
||||
#define S_IFLNK (10 << 12) /* symbolic link */
|
||||
#define S_IFSOCK (12 << 12) /* socket */
|
||||
#define S_IFMT (15 << 12) /* mask of file types above */
|
||||
|
||||
#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_S_H_ */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue