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

@ -23,10 +23,12 @@
#include "libc/str/utf16.h"
#include "libc/sysv/errfuns.h"
#define APPEND(c) \
do { \
cmdline[k++] = c; \
if (k == ARG_MAX) return e2big(); \
#define APPEND(c) \
do { \
cmdline[k++] = c; \
if (k == ARG_MAX / 2) { \
return e2big(); \
} \
} while (0)
static noasan bool NeedsQuotes(const char *s) {
@ -52,8 +54,8 @@ static noasan bool NeedsQuotes(const char *s) {
* @return freshly allocated lpCommandLine or NULL w/ errno
* @see libc/runtime/dosargv.c
*/
textwindows noasan int mkntcmdline(char16_t cmdline[ARG_MAX], const char *prog,
char *const argv[]) {
textwindows noasan int mkntcmdline(char16_t cmdline[ARG_MAX / 2],
const char *prog, char *const argv[]) {
char *arg;
uint64_t w;
wint_t x, y;