From bfb85fe6d02ffbf6ab732c88d33e1a524376de5e Mon Sep 17 00:00:00 2001 From: Justine Tunney Date: Tue, 20 Sep 2022 02:57:46 -0700 Subject: [PATCH] Remove a bunch of stuff that shouldn't be in docs --- libc/calls/dup-nt.c | 4 +--- libc/calls/fstat-sysv.c | 2 +- libc/calls/fstatat-sysv.c | 2 +- libc/calls/poll-nt.c | 2 +- libc/calls/sync-nt.c | 4 +--- libc/sock/recv-nt.c | 11 ++--------- libc/sock/recvfrom-nt.c | 6 ------ libc/sock/send-nt.c | 6 ------ libc/sock/sendto-nt.c | 6 ------ libc/thread/xnu.internal.h | 4 ++-- third_party/chibicc/dox1.c | 10 +++++++++- 11 files changed, 18 insertions(+), 39 deletions(-) diff --git a/libc/calls/dup-nt.c b/libc/calls/dup-nt.c index d6add874f..40b094385 100644 --- a/libc/calls/dup-nt.c +++ b/libc/calls/dup-nt.c @@ -28,9 +28,7 @@ #include "libc/sysv/consts/o.h" #include "libc/sysv/errfuns.h" -/** - * Implements dup(), dup2(), dup3(), and F_DUPFD for Windows. - */ +// Implements dup(), dup2(), dup3(), and F_DUPFD for Windows. textwindows int sys_dup_nt(int oldfd, int newfd, int flags, int start) { int64_t rc, proc, handle; _unassert(oldfd >= 0); diff --git a/libc/calls/fstat-sysv.c b/libc/calls/fstat-sysv.c index 4e24e943b..abc96e20d 100644 --- a/libc/calls/fstat-sysv.c +++ b/libc/calls/fstat-sysv.c @@ -24,7 +24,7 @@ #include "libc/sysv/errfuns.h" /** - * Supports fstat(), etc. implementations. + * Forms fstat() on System Five. * @asyncsignalsafe */ int32_t sys_fstat(int32_t fd, struct stat *st) { diff --git a/libc/calls/fstatat-sysv.c b/libc/calls/fstatat-sysv.c index fcf2c825f..5c96f3ac5 100644 --- a/libc/calls/fstatat-sysv.c +++ b/libc/calls/fstatat-sysv.c @@ -23,7 +23,7 @@ #include "libc/sysv/errfuns.h" /** - * Supports stat(), lstat(), fstatat(), etc. implementations. + * Performs fstatat() on System Five. * @asyncsignalsafe */ int32_t sys_fstatat(int32_t dirfd, const char *path, struct stat *st, diff --git a/libc/calls/poll-nt.c b/libc/calls/poll-nt.c index 121f0c7c6..726558c7e 100644 --- a/libc/calls/poll-nt.c +++ b/libc/calls/poll-nt.c @@ -42,7 +42,7 @@ #include "libc/sysv/consts/sig.h" #include "libc/sysv/errfuns.h" -/** +/* * Polls on the New Technology. * * This function is used to implement poll() and select(). You may poll diff --git a/libc/calls/sync-nt.c b/libc/calls/sync-nt.c index 4657e92d4..b025dcb51 100644 --- a/libc/calls/sync-nt.c +++ b/libc/calls/sync-nt.c @@ -28,9 +28,7 @@ #include "libc/nt/runtime.h" #include "libc/sysv/consts/ok.h" -/** - * Flushes all open file handles and, if possible, all disk drives. - */ +// Flushes all open file handles and, if possible, all disk drives. textwindows int sys_sync_nt(void) { unsigned i; int64_t volume; diff --git a/libc/sock/recv-nt.c b/libc/sock/recv-nt.c index f46f3feb3..2239bbb6b 100644 --- a/libc/sock/recv-nt.c +++ b/libc/sock/recv-nt.c @@ -17,22 +17,15 @@ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/calls/internal.h" -#include "libc/intrin/strace.internal.h" -#include "libc/calls/struct/iovec.h" +#include "libc/calls/struct/fd.internal.h" #include "libc/errno.h" -#include "libc/intrin/likely.h" +#include "libc/nt/struct/iovec.h" #include "libc/nt/struct/overlapped.h" #include "libc/nt/winsock.h" #include "libc/sock/internal.h" #include "libc/sock/syscall_fd.internal.h" #include "libc/sysv/errfuns.h" -/** - * Performs stream socket receive on New Technology. - * - * @param fd must be a socket - * @return number of bytes received, or -1 w/ errno - */ textwindows ssize_t sys_recv_nt(struct Fd *fd, const struct iovec *iov, size_t iovlen, uint32_t flags) { int err; diff --git a/libc/sock/recvfrom-nt.c b/libc/sock/recvfrom-nt.c index f13b0153e..39d8c6c84 100644 --- a/libc/sock/recvfrom-nt.c +++ b/libc/sock/recvfrom-nt.c @@ -25,12 +25,6 @@ #include "libc/sock/syscall_fd.internal.h" #include "libc/sysv/errfuns.h" -/** - * Performs datagram receive on New Technology. - * - * @param fd must be a socket - * @return number of bytes received, or -1 w/ errno - */ textwindows ssize_t sys_recvfrom_nt(struct Fd *fd, const struct iovec *iov, size_t iovlen, uint32_t flags, void *opt_out_srcaddr, diff --git a/libc/sock/send-nt.c b/libc/sock/send-nt.c index 3cf7f7287..b69df9fdb 100644 --- a/libc/sock/send-nt.c +++ b/libc/sock/send-nt.c @@ -23,12 +23,6 @@ #include "libc/sock/internal.h" #include "libc/sysv/errfuns.h" -/** - * Performs stream socket send on the New Technology. - * - * @param fd must be a socket - * @return number of bytes handed off, or -1 w/ errno - */ textwindows ssize_t sys_send_nt(int fd, const struct iovec *iov, size_t iovlen, uint32_t flags) { ssize_t rc; diff --git a/libc/sock/sendto-nt.c b/libc/sock/sendto-nt.c index d7ec71558..1fdbc3fba 100644 --- a/libc/sock/sendto-nt.c +++ b/libc/sock/sendto-nt.c @@ -23,12 +23,6 @@ #include "libc/sock/internal.h" #include "libc/sysv/errfuns.h" -/** - * Performs datagram socket send on the New Technology. - * - * @param fd must be a socket - * @return number of bytes handed off, or -1 w/ errno - */ textwindows ssize_t sys_sendto_nt(int fd, const struct iovec *iov, size_t iovlen, uint32_t flags, void *opt_in_addr, uint32_t in_addrsize) { diff --git a/libc/thread/xnu.internal.h b/libc/thread/xnu.internal.h index 856a106ee..6462f8cf4 100644 --- a/libc/thread/xnu.internal.h +++ b/libc/thread/xnu.internal.h @@ -3,9 +3,9 @@ #if !(__ASSEMBLER__ + __LINKER__ + 0) COSMOPOLITAN_C_START_ -/** +/* * XNU thread system calls. - * @see darwin-libpthread/kern/kern_support.c + * See darwin-libpthread/kern/kern_support.c */ int sys_bsdthread_create(void *func, void *func_arg, void *stack, void *pthread, diff --git a/third_party/chibicc/dox1.c b/third_party/chibicc/dox1.c index f6fcf54f0..98c67572a 100644 --- a/third_party/chibicc/dox1.c +++ b/third_party/chibicc/dox1.c @@ -284,13 +284,21 @@ static void LoadPublicDefinitions(struct DoxWriter *dox, Obj *prog) { if (!obj->javadown) { if (*obj->name == '_') continue; if (strchr(obj->name, '$')) continue; - if (_startswith(obj->name, "__gdtoa_")) continue; if (obj->visibility && !strcmp(obj->visibility, "hidden")) continue; + if (_startswith(obj->name, "nsync_") && _endswith(obj->name, "_")) + continue; if (!obj->is_definition && (!obj->is_function || !obj->params || !obj->params->name || !*obj->params->name)) { continue; } } + if (_startswith(obj->name, "__gdtoa_")) continue; + if (_startswith(obj->name, "sys_")) continue; + if (_startswith(obj->name, "ioctl_")) continue; + if (_startswith(obj->name, "nsync_mu_semaphore_")) continue; + if (_startswith(obj->name, "Describe")) continue; + if (_startswith(obj->name, "__sig")) continue; + if (_startswith(obj->name, "__zipos")) continue; if (obj->is_static) continue; if (obj->is_string_literal) continue; if (obj->section && _startswith(obj->section, ".init_array")) continue;