Make improvements

- Add rusage to redbean Lua API
- Add more redbean documentation
- Add pledge() to redbean Lua API
- Polyfill OpenBSD pledge() for Linux
- Increase PATH_MAX limit to 1024 characters
- Untrack sibling processes after fork() on Windows
This commit is contained in:
Justine Tunney 2022-04-28 09:42:36 -07:00
parent 9a6bd304a5
commit 47b3274665
212 changed files with 2251 additions and 834 deletions

View file

@ -18,6 +18,7 @@
*/
#include "libc/bits/safemacros.internal.h"
#include "libc/fmt/fmt.h"
#include "libc/macros.internal.h"
#include "libc/runtime/runtime.h"
#include "net/https/sslcache.h"
@ -26,10 +27,10 @@
* @return pointer to static memory
*/
char *GetSslCacheFile(void) {
static char sslcachefile[PATH_MAX + 1];
static char sslcachefile[PATH_MAX];
if (snprintf(sslcachefile, sizeof(sslcachefile), "%s/%s.sslcache",
firstnonnull(getenv("TMPDIR"), "/tmp"),
getenv("USER")) <= PATH_MAX) {
getenv("USER")) < ARRAYLEN(sslcachefile)) {
return sslcachefile;
} else {
return 0;