Commit graph

1420 commits

Author SHA1 Message Date
Justine Tunney
9fce2751c8
Remove problematic test 2023-02-05 16:50:04 -08:00
Justine Tunney
49c1dea03b
Add msync_test 2023-02-05 16:49:52 -08:00
Justine Tunney
4b8874ceb9
Make some simple fixes 2023-02-03 02:09:15 -08:00
Justine Tunney
cf19e3e46a
Fix SO_LINGER on Apple 2023-02-02 20:05:37 -08:00
Justine Tunney
1429a7b3ef
Fix bug in ASAN reporting 2023-02-02 02:28:58 -08:00
Justine Tunney
7486a2cd51
Perform minor cleanups 2023-02-02 02:28:58 -08:00
Gavin Hayes
fd0da9c0df
Implement zipos mmap (#725) 2023-02-02 02:28:50 -08:00
Paul Kulchenko
6d36584ff2
Redbean lsqlite config addition (#724)
* Fix mislabeled constant in redbean SQLite code
* Simplify callback handling in redbean SQLite
* Add config options to redbean SQLite
* Update redbean SQLite API to return current error callback
2023-01-29 19:37:19 -08:00
James Hulce
f422edaf15
FIx link in gensvg demo (#723)
Code link in the gensvg demo is broken, fix that
2023-01-28 09:12:13 -08:00
Justine Tunney
1473eafd1a
Fix the build and introduce some APIs
The tcgetwinsize() and tcsetwinsize() APIs are now available. The
printargs.com example also now displays the baud rate.
2023-01-20 09:25:45 -08:00
Justine Tunney
cac86197cb
Add fix for Blink detection 2023-01-19 09:12:49 -08:00
Justine Tunney
006c44ff5d
Update tests and CPU detection for Blink 2023-01-18 00:56:09 -08:00
Justine Tunney
be3e109309
Fix build break 2023-01-08 15:35:08 -08:00
Justine Tunney
2bad436abf
Return error on fopen(NULL)
https://sqlite.org/forum/forumpost/d1c96a9032e564f8
2023-01-08 15:17:44 -08:00
Justine Tunney
7ab4630cc9
Fix MODE=asan build regression 2023-01-08 05:47:18 -08:00
Justine Tunney
5dab97b6d4
Implement program for finding start of zip content 2023-01-06 19:55:00 -08:00
Justine Tunney
b38a442386
Add ppc64le support and improve platform detection 2023-01-06 09:14:27 -08:00
Justine Tunney
0708310041
Update the blink binaries 2023-01-05 22:50:20 -08:00
Justine Tunney
cd27a53345
Support aarch64, silicon, arm, i486, riscv64, mipsel, ppc and s390x
Your APE binaries will now run on eight hardware architectures. The
tradeoff is this change adds about 800kb of bloat to the executable
which to be fair is still more than half as small as Go hello world

Your APE shell script extracts an embedded build of Blink, based on
`$(uname -m)`. The Blink binaries are statically-linked (manylinux)
which means, they'll run on every distro's stock install, including
Apple M1's that haven't enabled Rosetta. Blink's emulation has been
designed to be nearly as fast as Rosetta, using a JIT technique for
faster startup time. Blink has also been tested more thoroughly, w/
emulating Cosmopolitan software, since we're the ones who wrote it.
2023-01-05 14:29:21 -08:00
Justine Tunney
416e173448
Improve the cosmocc toolchain
These changes were necessary to help Blink become buildable using
Cosmopolitan Libc.
2023-01-05 12:20:52 -08:00
Justine Tunney
d73523864a
Fix bugs with Redbean Fetch() uploading
This change makes Fetch() work correctly when large bodies are supplied,
or bodies containing NUL characters are supplied.

Fixes #573
2023-01-05 09:52:36 -08:00
Justine Tunney
eb69a42863
Fix --strace crashing on MacOS and Windows 2023-01-04 06:46:37 -08:00
Justine Tunney
651826b660
Update assimilate to work with modern APE format 2023-01-04 06:34:48 -08:00
Justine Tunney
6dcdf91458
Add a turfwar hilbert decoration 2023-01-03 18:28:35 -08:00
Justine Tunney
a6586cafb2
Retry SQLITE_BUSY when stepping in TurfWar 2023-01-03 06:10:39 -08:00
Justine Tunney
e496ee7a80
Be less pushy about redbean ddos protection 2023-01-03 05:14:34 -08:00
Justine Tunney
a4b6803556
Fix recursive locks when tid is huge
It turns out Linux may assign thread ids that are much larger than
previously thought. We now have fewer bits of depth so we can have
bigger tids.
2023-01-03 05:01:00 -08:00
Justine Tunney
9c72fef086
Remove affinity tuning from IPv4 Games 2023-01-03 04:48:01 -08:00
Justine Tunney
10d1c6da18
Support argv[0] munging on Windows 2023-01-03 03:22:40 -08:00
ahgamut
5ed84e04f8 remove libc/sock/if.h
libc/sock/if.h is removed because:

- it contained only IFNAMSIZ, which was also defined in
  libc/sock/struct/ifreq.h
- it was not included in any file EXCEPT libc/isystem/net/if.h, which
  also included the libc/sock/struct/ifreq.h

hence we remove this file, and move the IFNAMSIZ definition to
libc/sock/struct/ifreq.h which is included in isystem.
2023-01-01 16:51:00 -08:00
ahgamut
25fa6acc4d check existence of IFNAMSIZ
IFNAMSIZ is defined in:

- libc/sock/if.h
- libc/sock/struct/ifreq.h

we add a check in the latter to avoid a complaint when using the
amalgamated header.
2023-01-01 16:51:00 -08:00
Ronsor
9a46c5afc4 Add a new example showing how to use hiredis. 2023-01-01 16:30:10 -08:00
Ronsor
97ae5f7b1e Fix hiredis build 2023-01-01 16:30:10 -08:00
Ronsor
1c7c277432 Include a port of the hiredis library.
SSL support is not yet included; however, everything else works
perfectly fine.
2023-01-01 16:30:10 -08:00
Danny Robinson
70ca8c4016
Update redbean lsqlite definitions (#709) 2023-01-01 16:28:34 -08:00
tkchia
73507d5f4e
Add some definitions for Linux frame buffer/console ioctl APIs (#712)
Co-authored-by: tkchia <tkchia-cosmo@gmx.com>
2023-01-01 16:28:03 -08:00
Ronsor
d2f811eff3
Add support for the -i (include headers) and -d (POST data) options in curl.com (#708)
This commit also paves the way for initial IPv6 support in `curl.com` by specifying
`AF_UNSPEC` for the address family in the hints passed to `getaddrinfo()`.
2022-12-23 17:06:48 -08:00
Justine Tunney
2e5181666f
Fix the build 2022-12-21 23:06:55 -08:00
Gavin Hayes
5c0ce6b83e
Add note about APE loader and noexec mounts (#707) 2022-12-21 23:00:51 -08:00
Ronsor
f6b3019796
Make curl example into a complete tool (#706)
You can now handily use `curl` with popen()/system() by
placing `STATIC_YOINK("_curl")` in your main source file.
2022-12-21 16:12:02 -08:00
Justine Tunney
dd04aeba1c
Increase stack size to 128k and guard size to 16k
This improves our compatibility with Apple M1.
2022-12-18 22:58:29 -08:00
Justine Tunney
57c0dcdc29
Decrease TurfWar background query intervals
The database is much larger than it was when we started, so these
background reporting queries have become much more expensive than
before. We also had someone make 750k claims in one day, and even
hundreds of thousands per hour, which broke our assumptions about
hourly / daily reports being cheap.
2022-12-18 02:23:12 -08:00
Justine Tunney
6d39c6f646
Have redbean avoid gzip when emulated without jit 2022-12-18 02:22:58 -08:00
Justine Tunney
5a3c646307
Fix sysinfo() totalram on XNU
HW_MEMSIZE is the 64-bit version of HW_PHYSMEM, which is inaccurate on
systems having more than 4gb of RAM.
2022-12-18 02:22:46 -08:00
tkchia
0da47c51de
[metal] Allow programs larger than 440 KiB to run in bare metal mode (#685)
* [metal] Copy program pages to extended memory at startup
* [metal] Reclaim base memory pages for later app use
* [metal] Load program pages beyond 1st 440 KiB to extended memory

o//examples/hellolua.com now runs correctly under QEMU (in
legacy BIOS mode).

* [metal] Place GDT in read/write segment

The CPU absolutely needs to alter the GDT when loading the
task register (via ltr).  To account for this, I move the
GDT into a read/write data section.  There is still a "rump"
read-only GDT in the text section that is used by the real
mode bootloader.

We also delay the loading of the task register (ltr) until
after the IDT and TSS are finally set up.

* [metal] Get examples/vga2.c serial output working for UEFI boot
* [metal] Get examples/vga2.c VGA output working for UEFI boot
* [metal] Allow munmap() to reclaim dynamically allocated pages
* Place TLS sections right after .text, not after embedded zip file

Co-authored-by: tkchia <tkchia-cosmo@gmx.com>
2022-12-17 17:51:20 -08:00
Justine Tunney
120079b0a6
Remove evil constants from cosmopolitan.h
- `I` a.k.a. `_Complex_I` (fixes #705)
- `B0`, `B50`, etc. (fixes #403)
2022-12-17 00:42:45 -08:00
Justine Tunney
3da887c58f
Introduce CPUID detection for Blink 2022-12-17 00:38:07 -08:00
Justine Tunney
4922bc4890
Fix SQLite3 build for Landlock Make 2022-12-11 14:49:53 -08:00
Justine Tunney
ed161b240e
Clean up some code 2022-12-11 14:30:59 -08:00
Justine Tunney
531bfbd61f
Fix DNS resolution w/ commas in Windows Registry 2022-12-11 14:30:59 -08:00