From dbf12c30b05e8bffaa73356c229391538fd0b322 Mon Sep 17 00:00:00 2001 From: Justine Tunney Date: Tue, 6 Sep 2022 11:22:08 -0700 Subject: [PATCH] Make more compatibility improvements --- libc/fmt/strerror.c | 3 +- libc/intrin/describefutexresult.c | 2 +- libc/intrin/pthread.h | 4 +- libc/intrin/strerrno.greg.c | 2 +- libc/intrin/strerror_wr.greg.c | 1 + libc/isystem/limits.h | 4 ++ libc/isystem/unistd.h | 1 + libc/limits.h | 18 ++++++++ libc/runtime/fpathconf.c | 53 ++++++++++++++++++++++++ libc/runtime/pathconf.h | 34 +++++++++++++++ libc/runtime/runtime.h | 2 - libc/str/errfun.h | 11 +++++ libc/str/str.h | 2 - libc/sysv/consts.sh | 1 + libc/sysv/consts/NGROUPS_MAX.s | 2 + libc/sysv/consts/limits.h | 14 ++++--- third_party/lua/lunix.c | 1 + third_party/python/Modules/posixmodule.c | 1 + tool/build/chmod.c | 1 + tool/build/cocmd.c | 1 + tool/build/cp.c | 1 + tool/build/dd.c | 3 +- tool/build/fixupobj.c | 1 + tool/build/gzip.c | 1 + tool/build/mkdir.c | 1 + tool/build/mv.c | 1 + tool/build/ocat.c | 1 + tool/build/rm.c | 1 + tool/build/strace.c | 3 +- tool/build/touch.c | 1 + tool/build/unbundle.c | 1 + tool/viz/printdos2errno.c | 1 + 32 files changed, 158 insertions(+), 16 deletions(-) create mode 100644 libc/runtime/fpathconf.c create mode 100644 libc/runtime/pathconf.h create mode 100644 libc/str/errfun.h create mode 100644 libc/sysv/consts/NGROUPS_MAX.s diff --git a/libc/fmt/strerror.c b/libc/fmt/strerror.c index 96e56d776..0f5eb22e8 100644 --- a/libc/fmt/strerror.c +++ b/libc/fmt/strerror.c @@ -16,9 +16,10 @@ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/intrin/safemacros.internal.h" #include "libc/dce.h" #include "libc/fmt/fmt.h" +#include "libc/intrin/safemacros.internal.h" +#include "libc/str/errfun.h" #include "libc/str/str.h" /** diff --git a/libc/intrin/describefutexresult.c b/libc/intrin/describefutexresult.c index 77d89c340..22c3811b4 100644 --- a/libc/intrin/describefutexresult.c +++ b/libc/intrin/describefutexresult.c @@ -18,7 +18,7 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/fmt/itoa.h" #include "libc/intrin/describeflags.internal.h" -#include "libc/str/str.h" +#include "libc/str/errfun.h" const char *(DescribeFutexResult)(char buf[12], int ax) { const char *s; diff --git a/libc/intrin/pthread.h b/libc/intrin/pthread.h index 249d49553..fa05174ea 100644 --- a/libc/intrin/pthread.h +++ b/libc/intrin/pthread.h @@ -3,7 +3,9 @@ #define PTHREAD_ONCE_INIT 0 -#define PTHREAD_KEYS_MAX 64 +#define PTHREAD_KEYS_MAX 64 +#define PTHREAD_STACK_MIN 2048 +#define PTHREAD_DESTRUCTOR_ITERATIONS 4 #define PTHREAD_BARRIER_SERIAL_THREAD 31337 diff --git a/libc/intrin/strerrno.greg.c b/libc/intrin/strerrno.greg.c index 3c9e1a037..076803a9c 100644 --- a/libc/intrin/strerrno.greg.c +++ b/libc/intrin/strerrno.greg.c @@ -17,7 +17,7 @@ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/fmt/magnumstrs.internal.h" -#include "libc/str/str.h" +#include "libc/str/errfun.h" /** * Converts errno value to symbolic name. diff --git a/libc/intrin/strerror_wr.greg.c b/libc/intrin/strerror_wr.greg.c index 1c7543c6f..fa2baf8a7 100644 --- a/libc/intrin/strerror_wr.greg.c +++ b/libc/intrin/strerror_wr.greg.c @@ -24,6 +24,7 @@ #include "libc/nt/enum/formatmessageflags.h" #include "libc/nt/enum/lang.h" #include "libc/nt/process.h" +#include "libc/str/errfun.h" #include "libc/str/str.h" /** diff --git a/libc/isystem/limits.h b/libc/isystem/limits.h index e349a7597..a6abd1c8b 100644 --- a/libc/isystem/limits.h +++ b/libc/isystem/limits.h @@ -1,5 +1,9 @@ #ifndef LIBC_ISYSTEM_LIMITS_H_ #define LIBC_ISYSTEM_LIMITS_H_ +#include "libc/intrin/pthread.h" #include "libc/limits.h" #include "libc/sysv/consts/_posix.h" +#include "libc/sysv/consts/iov.h" +#include "libc/sysv/consts/limits.h" +#include "libc/sysv/consts/xopen.h" #endif diff --git a/libc/isystem/unistd.h b/libc/isystem/unistd.h index efa39c87c..ef6635601 100644 --- a/libc/isystem/unistd.h +++ b/libc/isystem/unistd.h @@ -2,6 +2,7 @@ #define LIBC_ISYSTEM_UNISTD_H_ #include "libc/calls/calls.h" #include "libc/calls/weirdtypes.h" +#include "libc/runtime/pathconf.h" #include "libc/runtime/sysconf.h" #include "libc/sysv/consts/fileno.h" #include "libc/sysv/consts/o.h" diff --git a/libc/limits.h b/libc/limits.h index 20293aaaf..732da64b2 100644 --- a/libc/limits.h +++ b/libc/limits.h @@ -36,6 +36,7 @@ #define INTMAX_MAX __INTMAX_MAX__ #define UINTMAX_MAX __UINTMAX_MAX__ +extern int __got_long_min; #define SCHAR_MIN (-SCHAR_MAX - 1) #define SHRT_MIN (-SHRT_MAX - 1) #define INT_MIN (-INT_MAX - 1) @@ -90,4 +91,21 @@ #define SIG_ATOMIC_MIN INT32_MIN #define SIG_ATOMIC_MAX INT32_MAX +#define FILESIZEBITS 64 +#define SYMLOOP_MAX 40 +#define TTY_NAME_MAX 32 +#define HOST_NAME_MAX 255 +#define TZNAME_MAX 6 +#define WORD_BIT 32 +#define SEM_VALUE_MAX 0x7fffffff +#define SEM_NSEMS_MAX 256 +#define DELAYTIMER_MAX 0x7fffffff +#define MQ_PRIO_MAX 32768 +#define LOGIN_NAME_MAX 256 + +#define NL_ARGMAX 9 +#define NL_MSGMAX 32767 +#define NL_SETMAX 255 +#define NL_TEXTMAX 2048 + #endif /* COSMOPOLITAN_LIBC_LIMITS_H_ */ diff --git a/libc/runtime/fpathconf.c b/libc/runtime/fpathconf.c new file mode 100644 index 000000000..5d63f4992 --- /dev/null +++ b/libc/runtime/fpathconf.c @@ -0,0 +1,53 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:2;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Copyright 2022 Justine Alexandra Roberts Tunney │ +│ │ +│ Permission to use, copy, modify, and/or distribute this software for │ +│ any purpose with or without fee is hereby granted, provided that the │ +│ above copyright notice and this permission notice appear in all copies. │ +│ │ +│ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL │ +│ WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED │ +│ WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE │ +│ AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL │ +│ DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR │ +│ PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER │ +│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ +│ PERFORMANCE OF THIS SOFTWARE. │ +╚─────────────────────────────────────────────────────────────────────────────*/ +#include "libc/errno.h" +#include "libc/limits.h" +#include "libc/runtime/pathconf.h" +#include "libc/sysv/consts/_posix.h" +#include "libc/sysv/consts/limits.h" +#include "libc/sysv/errfuns.h" + +long fpathconf(int fd, int name) { + if (name == _PC_LINK_MAX) return _POSIX_LINK_MAX; + if (name == _PC_MAX_CANON) return _POSIX_MAX_CANON; + if (name == _PC_MAX_INPUT) return _POSIX_MAX_INPUT; + if (name == _PC_NAME_MAX) return NAME_MAX; + if (name == _PC_PATH_MAX) return PATH_MAX; + if (name == _PC_PIPE_BUF) return PIPE_BUF; + if (name == _PC_CHOWN_RESTRICTED) return 1; + if (name == _PC_NO_TRUNC) return 1; + if (name == _PC_VDISABLE) return 0; + if (name == _PC_SYNC_IO) return 1; + if (name == _PC_ASYNC_IO) return -1; + if (name == _PC_PRIO_IO) return -1; + if (name == _PC_SOCK_MAXBUF) return -1; + if (name == _PC_FILESIZEBITS) return FILESIZEBITS; + if (name == _PC_REC_INCR_XFER_SIZE) return 4096; + if (name == _PC_REC_MAX_XFER_SIZE) return 4096; + if (name == _PC_REC_MIN_XFER_SIZE) return 4096; + if (name == _PC_REC_XFER_ALIGN) return 4096; + if (name == _PC_ALLOC_SIZE_MIN) return 4096; + if (name == _PC_SYMLINK_MAX) return -1; + if (name == _PC_2_SYMLINKS) return 1; + return einval(); +} + +long pathconf(const char *path, int name) { + return fpathconf(-1, name); +} diff --git a/libc/runtime/pathconf.h b/libc/runtime/pathconf.h new file mode 100644 index 000000000..4d86fc668 --- /dev/null +++ b/libc/runtime/pathconf.h @@ -0,0 +1,34 @@ +#ifndef COSMOPOLITAN_LIBC_RUNTIME_PATHCONF_H_ +#define COSMOPOLITAN_LIBC_RUNTIME_PATHCONF_H_ + +#define _PC_LINK_MAX 0 +#define _PC_MAX_CANON 1 +#define _PC_MAX_INPUT 2 +#define _PC_NAME_MAX 3 +#define _PC_PATH_MAX 4 +#define _PC_PIPE_BUF 5 +#define _PC_CHOWN_RESTRICTED 6 +#define _PC_NO_TRUNC 7 +#define _PC_VDISABLE 8 +#define _PC_SYNC_IO 9 +#define _PC_ASYNC_IO 10 +#define _PC_PRIO_IO 11 +#define _PC_SOCK_MAXBUF 12 +#define _PC_FILESIZEBITS 13 +#define _PC_REC_INCR_XFER_SIZE 14 +#define _PC_REC_MAX_XFER_SIZE 15 +#define _PC_REC_MIN_XFER_SIZE 16 +#define _PC_REC_XFER_ALIGN 17 +#define _PC_ALLOC_SIZE_MIN 18 +#define _PC_SYMLINK_MAX 19 +#define _PC_2_SYMLINKS 20 + +#if !(__ASSEMBLER__ + __LINKER__ + 0) +COSMOPOLITAN_C_START_ + +long fpathconf(int, int); +long pathconf(const char *, int); + +COSMOPOLITAN_C_END_ +#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */ +#endif /* COSMOPOLITAN_LIBC_RUNTIME_PATHCONF_H_ */ diff --git a/libc/runtime/runtime.h b/libc/runtime/runtime.h index 5cb64241e..117ed1c25 100644 --- a/libc/runtime/runtime.h +++ b/libc/runtime/runtime.h @@ -82,8 +82,6 @@ int mprotect(void *, uint64_t, int) privileged; int msync(void *, size_t, int); void *sbrk(intptr_t); int brk(void *); -long fpathconf(int, int); -long pathconf(const char *, int); int getgroups(int, uint32_t[]); long gethostid(void); int sethostid(long); diff --git a/libc/str/errfun.h b/libc/str/errfun.h new file mode 100644 index 000000000..3c1e62439 --- /dev/null +++ b/libc/str/errfun.h @@ -0,0 +1,11 @@ +#ifndef COSMOPOLITAN_LIBC_STR_ERRFUN_H_ +#define COSMOPOLITAN_LIBC_STR_ERRFUN_H_ +#if !(__ASSEMBLER__ + __LINKER__ + 0) +COSMOPOLITAN_C_START_ + +char *strerrno(int) nosideeffect libcesque; +char *strerdoc(int) nosideeffect libcesque; + +COSMOPOLITAN_C_END_ +#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */ +#endif /* COSMOPOLITAN_LIBC_STR_ERRFUN_H_ */ diff --git a/libc/str/str.h b/libc/str/str.h index 0f995da3c..20d380c37 100644 --- a/libc/str/str.h +++ b/libc/str/str.h @@ -211,8 +211,6 @@ wint_t towctrans(wint_t, wctrans_t); char *strsignal(int) returnsnonnull libcesque; char *strerror(int) returnsnonnull dontthrow nocallback; -char *strerrno(int) nosideeffect libcesque; -char *strerdoc(int) nosideeffect libcesque; int strerror_r(int, char *, size_t) dontthrow nocallback; int strerror_wr(int, uint32_t, char *, size_t) dontthrow nocallback; int __xpg_strerror_r(int, char *, size_t) dontthrow nocallback; diff --git a/libc/sysv/consts.sh b/libc/sysv/consts.sh index 379f0b372..08a68bdfb 100755 --- a/libc/sysv/consts.sh +++ b/libc/sysv/consts.sh @@ -1229,6 +1229,7 @@ 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 _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? syscon limits _PATH_MAX 4096 1024 1024 1024 1024 512 # cosmopolitan libc imposes a lower 512 limit; nt theoretically goes up to 32767 diff --git a/libc/sysv/consts/NGROUPS_MAX.s b/libc/sysv/consts/NGROUPS_MAX.s new file mode 100644 index 000000000..17fa28e47 --- /dev/null +++ b/libc/sysv/consts/NGROUPS_MAX.s @@ -0,0 +1,2 @@ +.include "o/libc/sysv/consts/syscon.internal.inc" +.syscon limits,NGROUPS_MAX,65536,16,1023,16,16,0 diff --git a/libc/sysv/consts/limits.h b/libc/sysv/consts/limits.h index b01418b22..400bdbae9 100644 --- a/libc/sysv/consts/limits.h +++ b/libc/sysv/consts/limits.h @@ -4,19 +4,21 @@ #if !(__ASSEMBLER__ + __LINKER__ + 0) COSMOPOLITAN_C_START_ +extern const int NGROUPS_MAX; extern const int PIPE_BUF; extern const int _ARG_MAX; extern const int _NAME_MAX; -extern const int _PATH_MAX; extern const int _NSIG; +extern const int _PATH_MAX; COSMOPOLITAN_C_END_ #endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */ -#define PIPE_BUF SYMBOLIC(PIPE_BUF) -#define _ARG_MAX SYMBOLIC(_ARG_MAX) -#define _NAME_MAX SYMBOLIC(_NAME_MAX) -#define _PATH_MAX SYMBOLIC(_PATH_MAX) -#define _NSIG SYMBOLIC(_NSIG) +#define NGROUPS_MAX SYMBOLIC(NGROUPS_MAX) +#define PIPE_BUF SYMBOLIC(PIPE_BUF) +#define _ARG_MAX SYMBOLIC(_ARG_MAX) +#define _NAME_MAX SYMBOLIC(_NAME_MAX) +#define _NSIG SYMBOLIC(_NSIG) +#define _PATH_MAX SYMBOLIC(_PATH_MAX) #endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_LIMITS_H_ */ diff --git a/third_party/lua/lunix.c b/third_party/lua/lunix.c index d5ded4b6e..84586b0b4 100644 --- a/third_party/lua/lunix.c +++ b/third_party/lua/lunix.c @@ -58,6 +58,7 @@ #include "libc/sock/syslog.h" #include "libc/stdio/append.internal.h" #include "libc/stdio/stdio.h" +#include "libc/str/errfun.h" #include "libc/str/path.h" #include "libc/str/str.h" #include "libc/sysv/consts/af.h" diff --git a/third_party/python/Modules/posixmodule.c b/third_party/python/Modules/posixmodule.c index ea15baef8..2602f2e83 100644 --- a/third_party/python/Modules/posixmodule.c +++ b/third_party/python/Modules/posixmodule.c @@ -37,6 +37,7 @@ #include "libc/nt/runtime.h" #include "libc/runtime/dlfcn.h" #include "libc/runtime/gc.internal.h" +#include "libc/runtime/pathconf.h" #include "libc/runtime/sysconf.h" #include "libc/sock/sendfile.internal.h" #include "libc/sock/sock.h" diff --git a/tool/build/chmod.c b/tool/build/chmod.c index 04e09343a..6e62636aa 100644 --- a/tool/build/chmod.c +++ b/tool/build/chmod.c @@ -22,6 +22,7 @@ #include "libc/fmt/conv.h" #include "libc/runtime/runtime.h" #include "libc/stdio/stdio.h" +#include "libc/str/errfun.h" #include "libc/str/str.h" #include "libc/sysv/consts/ex.h" #include "libc/sysv/consts/exit.h" diff --git a/tool/build/cocmd.c b/tool/build/cocmd.c index 64da03cd1..bdbc5fcaa 100644 --- a/tool/build/cocmd.c +++ b/tool/build/cocmd.c @@ -23,6 +23,7 @@ #include "libc/mem/mem.h" #include "libc/runtime/runtime.h" #include "libc/stdio/stdio.h" +#include "libc/str/errfun.h" #include "libc/str/str.h" #include "libc/sysv/consts/o.h" diff --git a/tool/build/cp.c b/tool/build/cp.c index 789e254f6..89f1ec9ba 100644 --- a/tool/build/cp.c +++ b/tool/build/cp.c @@ -26,6 +26,7 @@ #include "libc/runtime/gc.h" #include "libc/runtime/runtime.h" #include "libc/stdio/stdio.h" +#include "libc/str/errfun.h" #include "libc/str/str.h" #include "libc/sysv/consts/at.h" #include "libc/sysv/consts/ex.h" diff --git a/tool/build/dd.c b/tool/build/dd.c index 61dc2556a..0fce0779c 100644 --- a/tool/build/dd.c +++ b/tool/build/dd.c @@ -16,13 +16,14 @@ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/intrin/safemacros.internal.h" #include "libc/calls/calls.h" #include "libc/errno.h" #include "libc/fmt/conv.h" +#include "libc/intrin/safemacros.internal.h" #include "libc/limits.h" #include "libc/runtime/runtime.h" #include "libc/stdio/stdio.h" +#include "libc/str/errfun.h" #include "libc/str/str.h" #include "libc/sysv/consts/o.h" diff --git a/tool/build/fixupobj.c b/tool/build/fixupobj.c index 0e9e9d777..dbfed4e1b 100644 --- a/tool/build/fixupobj.c +++ b/tool/build/fixupobj.c @@ -30,6 +30,7 @@ #include "libc/log/check.h" #include "libc/log/log.h" #include "libc/runtime/runtime.h" +#include "libc/str/errfun.h" #include "libc/str/str.h" #include "libc/sysv/consts/map.h" #include "libc/sysv/consts/msync.h" diff --git a/tool/build/gzip.c b/tool/build/gzip.c index ce86f8217..ec58970b0 100644 --- a/tool/build/gzip.c +++ b/tool/build/gzip.c @@ -21,6 +21,7 @@ #include "libc/mem/mem.h" #include "libc/runtime/runtime.h" #include "libc/stdio/stdio.h" +#include "libc/str/errfun.h" #include "libc/str/str.h" #include "libc/sysv/consts/ex.h" #include "libc/sysv/consts/exit.h" diff --git a/tool/build/mkdir.c b/tool/build/mkdir.c index 45b1d5bdc..58facc516 100644 --- a/tool/build/mkdir.c +++ b/tool/build/mkdir.c @@ -12,6 +12,7 @@ #include "libc/fmt/conv.h" #include "libc/runtime/runtime.h" #include "libc/stdio/stdio.h" +#include "libc/str/errfun.h" #include "libc/str/str.h" #include "libc/sysv/consts/ex.h" #include "libc/x/x.h" diff --git a/tool/build/mv.c b/tool/build/mv.c index 895ab0bad..9f518b45a 100644 --- a/tool/build/mv.c +++ b/tool/build/mv.c @@ -24,6 +24,7 @@ #include "libc/runtime/gc.h" #include "libc/runtime/runtime.h" #include "libc/stdio/stdio.h" +#include "libc/str/errfun.h" #include "libc/str/str.h" #include "libc/sysv/consts/at.h" #include "libc/sysv/consts/ex.h" diff --git a/tool/build/ocat.c b/tool/build/ocat.c index 068362c13..77d86355a 100644 --- a/tool/build/ocat.c +++ b/tool/build/ocat.c @@ -21,6 +21,7 @@ #include "libc/fmt/itoa.h" #include "libc/mem/io.h" #include "libc/runtime/runtime.h" +#include "libc/str/errfun.h" #include "libc/str/str.h" #include "libc/sysv/consts/ex.h" #include "libc/sysv/consts/o.h" diff --git a/tool/build/rm.c b/tool/build/rm.c index a3d808f19..124b9de90 100644 --- a/tool/build/rm.c +++ b/tool/build/rm.c @@ -20,6 +20,7 @@ #include "libc/errno.h" #include "libc/runtime/runtime.h" #include "libc/stdio/stdio.h" +#include "libc/str/errfun.h" #include "libc/str/str.h" #include "libc/sysv/consts/ex.h" #include "libc/sysv/consts/exit.h" diff --git a/tool/build/strace.c b/tool/build/strace.c index 52c285524..1b2852874 100644 --- a/tool/build/strace.c +++ b/tool/build/strace.c @@ -17,7 +17,6 @@ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/assert.h" -#include "libc/intrin/bits.h" #include "libc/calls/calls.h" #include "libc/calls/struct/iovec.h" #include "libc/calls/struct/sigaction.h" @@ -29,6 +28,7 @@ #include "libc/errno.h" #include "libc/fmt/fmt.h" #include "libc/fmt/itoa.h" +#include "libc/intrin/bits.h" #include "libc/intrin/kprintf.h" #include "libc/intrin/nomultics.internal.h" #include "libc/log/check.h" @@ -36,6 +36,7 @@ #include "libc/mem/mem.h" #include "libc/runtime/runtime.h" #include "libc/stdio/append.internal.h" +#include "libc/str/errfun.h" #include "libc/str/str.h" #include "libc/sysv/consts/nr.h" #include "libc/sysv/consts/ptrace.h" diff --git a/tool/build/touch.c b/tool/build/touch.c index f9be6e8b7..072a130c4 100644 --- a/tool/build/touch.c +++ b/tool/build/touch.c @@ -20,6 +20,7 @@ #include "libc/errno.h" #include "libc/runtime/runtime.h" #include "libc/stdio/stdio.h" +#include "libc/str/errfun.h" #include "libc/str/str.h" /** diff --git a/tool/build/unbundle.c b/tool/build/unbundle.c index b3b1bb874..5033cf546 100644 --- a/tool/build/unbundle.c +++ b/tool/build/unbundle.c @@ -23,6 +23,7 @@ #include "libc/fmt/itoa.h" #include "libc/runtime/runtime.h" #include "libc/stdio/stdio.h" +#include "libc/str/errfun.h" #include "libc/str/str.h" #include "libc/sysv/consts/s.h" #include "libc/x/x.h" diff --git a/tool/viz/printdos2errno.c b/tool/viz/printdos2errno.c index fba1ba278..cfb7ef31b 100644 --- a/tool/viz/printdos2errno.c +++ b/tool/viz/printdos2errno.c @@ -19,6 +19,7 @@ #include "libc/fmt/fmt.h" #include "libc/intrin/dos2errno.internal.h" #include "libc/intrin/kprintf.h" +#include "libc/str/errfun.h" #include "libc/str/str.h" // note: these are supplementary errno magnum mappings