Make some foss compatibility improvements

This commit is contained in:
Justine Tunney 2022-10-14 09:52:35 -07:00
parent 8111462789
commit 5af19b7eed
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
34 changed files with 319 additions and 48 deletions

View file

@ -1228,6 +1228,9 @@ syscon mount MNT_SNAPSHOT 0 0x40000000 0x01000000 0 0 0 # confusing
# group name GNU/Systemd XNU's Not UNIX! FreeBSD OpenBSD NetBSD The New Technology Commentary
syscon limits PIPE_BUF 4096 512 512 512 512 4096 # bsd consensus
syscon limits NGROUPS_MAX 65536 16 1023 16 16 0 #
syscon limits LINK_MAX 127 32767 32767 32767 32767 64 # freebsd/windows are educated guesses
syscon limits MAX_CANON 255 1024 255 255 255 255 # windows is guessed
syscon limits MAX_INPUT 255 1024 255 255 255 255 # windows is guessed
syscon limits SOMAXCONN 4096 128 128 128 128 2147483647 # maximum backlog for listen()
syscon limits _ARG_MAX 128*1024 1024*1024 512*1024 512*1024 256*1024 32767*2 # bsd consensus
syscon limits _NAME_MAX 255 255 255 255 511 255 # probably higher on windows?

View file

@ -11,6 +11,9 @@ extern const int _ARG_MAX;
extern const int _NAME_MAX;
extern const int _NSIG;
extern const int _PATH_MAX;
extern const int LINK_MAX;
extern const int MAX_CANON;
extern const int MAX_INPUT;
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
@ -22,5 +25,8 @@ COSMOPOLITAN_C_END_
#define _NAME_MAX SYMBOLIC(_NAME_MAX)
#define _NSIG SYMBOLIC(_NSIG)
#define _PATH_MAX SYMBOLIC(_PATH_MAX)
#define LINK_MAX SYMBOLIC(LINK_MAX)
#define MAX_CANON SYMBOLIC(MAX_CANON)
#define MAX_INPUT SYMBOLIC(MAX_INPUT)
#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_LIMITS_H_ */