aruu

[MIRROR] Actual replacement for Busybox | suckless
git clone https://git.daat.foo/aruu.git
Log | Files | Refs | README | LICENSE

commit 1586f632317c02ca233eeb1f2f106bf5809e393a
parent f47c515d5312956998a1b6808687642b8c25d097
Author: xplshn <anto@xplshn.com.ar>
Date:   Wed,  1 Jul 2026 00:19:26 -0300

more header order fixes

Signed-off-by: xplshn <anto@xplshn.com.ar>

Diffstat:
Mbuild.cfg | 37++++++++++++++++++-------------------
Mcmd/posix/awk/awk.h | 1+
Mcmd/posix/awk/proto.h | 2++
Mcmd/posix/sh/arith_yacc.h | 6++++--
Mcmd/posix/sh/error.h | 2++
Mcmd/posix/sh/exec.h | 2++
Mcmd/posix/sh/jobs.h | 3++-
Mcmd/posix/sh/memalloc.h | 4+++-
Mcmd/posix/sh/output.h | 2++
Acmd/posix/sh/sh_cdefs.h | 37+++++++++++++++++++++++++++++++++++++
Mcmd/posix/sh/shell.h | 11+++++++----
Mcmd/posix/sh/show.h | 2++
Mcmd/posix/sh/trap.h | 5++++-
13 files changed, 86 insertions(+), 28 deletions(-)

diff --git a/build.cfg b/build.cfg @@ -1,8 +1,8 @@ # posix: POSIX 2024 PRESET_FEATURES=all -# subset of: posix linux net xsi pseudo dev -PRESET_UTILS="posix linux net xsi pseudo" +# subset of: posix xsi net pseudo linux dev +PRESET_UTILS="posix xsi net pseudo linux" # installation paths VERSION=2026-06-08T05-53-UTC-03 @@ -40,11 +40,11 @@ posix) FEATURE_SH_SETVAR=0; FEATURE_SH_WORDEXP=0 FEATURE_CAL_EXT=0 FEATURE_LS_COLOR=0 - FEATURE_DIFF3_MERGE=0; FEATURE_DIFF3_EDSCRIPT=0 - FEATURE_DIFF_CONTEXT=0; FEATURE_DIFF_UNIFIED=0 - FEATURE_DIFF_ED=0; FEATURE_DIFF_BRIEF=0 + FEATURE_DIFF3_MERGE=0; FEATURE_DIFF3_EDSCRIPT=0 + FEATURE_DIFF_CONTEXT=0; FEATURE_DIFF_UNIFIED=0 + FEATURE_DIFF_ED=0; FEATURE_DIFF_BRIEF=0 FEATURE_DIFF_SIDEBYSIDE=0 - FEATURE_PATCH_BACKUP=0; FEATURE_PATCH_FUZZ=0 + FEATURE_PATCH_BACKUP=0; FEATURE_PATCH_FUZZ=0 FEATURE_PATCH_STRIP_CR=0 FEATURE_MODPROBE_SHOW_DEPENDS=0; FEATURE_MODPROBE_BLACKLIST=0 FEATURE_MODPROBE_SYSLOG=0; FEATURE_MODPROBE_DIR_OVERRIDE=0 @@ -75,11 +75,11 @@ common) FEATURE_SH_SETVAR=0; FEATURE_SH_WORDEXP=0 FEATURE_CAL_EXT=1 FEATURE_LS_COLOR=1 - FEATURE_DIFF3_MERGE=0; FEATURE_DIFF3_EDSCRIPT=1 - FEATURE_DIFF_CONTEXT=1; FEATURE_DIFF_UNIFIED=1 - FEATURE_DIFF_ED=1; FEATURE_DIFF_BRIEF=1 + FEATURE_DIFF3_MERGE=0; FEATURE_DIFF3_EDSCRIPT=1 + FEATURE_DIFF_CONTEXT=1; FEATURE_DIFF_UNIFIED=1 + FEATURE_DIFF_ED=1; FEATURE_DIFF_BRIEF=1 FEATURE_DIFF_SIDEBYSIDE=0 - FEATURE_PATCH_BACKUP=1; FEATURE_PATCH_FUZZ=1 + FEATURE_PATCH_BACKUP=1; FEATURE_PATCH_FUZZ=1 FEATURE_PATCH_STRIP_CR=1 FEATURE_MODPROBE_SHOW_DEPENDS=1; FEATURE_MODPROBE_BLACKLIST=1 FEATURE_MODPROBE_SYSLOG=1; FEATURE_MODPROBE_DIR_OVERRIDE=1 @@ -92,7 +92,6 @@ common) FEATURE_IP_LINK_SET=1; FEATURE_IP_ADDR_FLUSH=1 ;; all) - # histedit now included via redline FEATURE_FIND_DELETE=1; FEATURE_FIND_QUIT=1 FEATURE_FIND_EMPTY=1; FEATURE_FIND_INUM=1 FEATURE_FIND_SAMEFILE=1; FEATURE_FIND_MAXDEPTH=1 @@ -107,16 +106,16 @@ all) FEATURE_SORT_BIG=1; FEATURE_SORT_STABLE=1 FEATURE_OD_ENDIAN=1; FEATURE_SH_HISTEDIT=1 -FEATURE_INPROC_EXEC=0 # set to 1 for aruu-box in-process dispatch; FEATURE_SH_LOCAL=1 + FEATURE_INPROC_EXEC=0 FEATURE_SH_LOCAL=1 FEATURE_SH_LET=1; FEATURE_SH_ULIMIT=1 FEATURE_SH_SETVAR=1; FEATURE_SH_WORDEXP=1 FEATURE_CAL_EXT=1 FEATURE_LS_COLOR=1 - FEATURE_DIFF3_MERGE=1; FEATURE_DIFF3_EDSCRIPT=1 - FEATURE_DIFF_CONTEXT=1; FEATURE_DIFF_UNIFIED=1 - FEATURE_DIFF_ED=1; FEATURE_DIFF_BRIEF=1 + FEATURE_DIFF3_MERGE=1; FEATURE_DIFF3_EDSCRIPT=1 + FEATURE_DIFF_CONTEXT=1; FEATURE_DIFF_UNIFIED=1 + FEATURE_DIFF_ED=1; FEATURE_DIFF_BRIEF=1 FEATURE_DIFF_SIDEBYSIDE=1 - FEATURE_PATCH_BACKUP=1; FEATURE_PATCH_FUZZ=1 + FEATURE_PATCH_BACKUP=1; FEATURE_PATCH_FUZZ=1 FEATURE_PATCH_STRIP_CR=1 FEATURE_MODPROBE_SHOW_DEPENDS=1; FEATURE_MODPROBE_BLACKLIST=1 FEATURE_MODPROBE_SYSLOG=1; FEATURE_MODPROBE_DIR_OVERRIDE=1 @@ -134,8 +133,8 @@ FEATURE_INPROC_EXEC=0 # set to 1 for aruu-box in-process dispatch; F ;; esac -BUILD_POSIX=0; BUILD_LINUX=0; BUILD_NET=0; BUILD_XSI=0 -BUILD_PSEUDO=0; BUILD_DEV=0 + +BUILD_POSIX=0; BUILD_XSI=0; BUILD_PSEUDO=0; BUILD_NET=0; BUILD_LINUX=0; BUILD_DEV=0 for _p in $PRESET_UTILS; do case "$_p" in posix) BUILD_POSIX=1 ;; @@ -156,7 +155,7 @@ unset _p # BUILD_POSIX_SH=0 # disable a tool when its group is active # BUILD_DEV_AS=1 # enable a tool whose group isnt in PRESET_UTILS FEATURE_SH_HISTEDIT=1 -FEATURE_INPROC_EXEC=0 # set to 1 for aruu-box in-process dispatch +FEATURE_INPROC_EXEC=0 # tls backend: set exactly one to 1 to enable tls FEATURE_USE_BEARSSL=0 FEATURE_USE_LIBRESSL=0 diff --git a/cmd/posix/awk/awk.h b/cmd/posix/awk/awk.h @@ -23,6 +23,7 @@ THIS SOFTWARE. ****************************************************************/ #include <assert.h> +#include <stddef.h> #include <stdint.h> #ifndef bool diff --git a/cmd/posix/awk/proto.h b/cmd/posix/awk/proto.h @@ -22,6 +22,8 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ****************************************************************/ +#include <stddef.h> +#include <stdio.h> extern int yywrap(void); extern void setfname(Cell *); extern int constnode(Node *); diff --git a/cmd/posix/sh/arith_yacc.h b/cmd/posix/sh/arith_yacc.h @@ -2,9 +2,9 @@ * SPDX-License-Identifier: BSD-3-Clause * * Copyright (c) 1993 - * The Regents of the University of California. All rights reserved. + * The Regents of the University of California. All rights reserved. * Copyright (c) 2007 - * Herbert Xu <herbert@gondor.apana.org.au>. All rights reserved. + * Herbert Xu <herbert@gondor.apana.org.au>. All rights reserved. * * This code is derived from software contributed to Berkeley by * Kenneth Almquist. @@ -34,6 +34,8 @@ * SUCH DAMAGE. */ +#include "shell.h" + #define ARITH_ASS 1 #define ARITH_OR 2 diff --git a/cmd/posix/sh/error.h b/cmd/posix/sh/error.h @@ -32,6 +32,8 @@ * SUCH DAMAGE. */ +#include "sh_cdefs.h" + /* * We enclose jmp_buf in a structure so that we can declare pointers to * jump locations. The global variable handler contains the location to diff --git a/cmd/posix/sh/exec.h b/cmd/posix/sh/exec.h @@ -32,6 +32,8 @@ * SUCH DAMAGE. */ +#include "sh_cdefs.h" + /* values of cmdtype */ #define CMDUNKNOWN -1 /* no entry in table for command */ #define CMDNORMAL 0 /* command is an executable program */ diff --git a/cmd/posix/sh/jobs.h b/cmd/posix/sh/jobs.h @@ -2,7 +2,7 @@ * SPDX-License-Identifier: BSD-3-Clause * * Copyright (c) 1991, 1993 - * The Regents of the University of California. All rights reserved. + * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Kenneth Almquist. @@ -37,6 +37,7 @@ #define FORK_BG 1 #define FORK_NOJOB 2 +#include "shell.h" #include <signal.h> /* for sig_atomic_t */ struct job; diff --git a/cmd/posix/sh/memalloc.h b/cmd/posix/sh/memalloc.h @@ -2,7 +2,7 @@ * SPDX-License-Identifier: BSD-3-Clause * * Copyright (c) 1991, 1993 - * The Regents of the University of California. All rights reserved. + * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Kenneth Almquist. @@ -32,6 +32,8 @@ * SUCH DAMAGE. */ +#include "sh_cdefs.h" +#include <stddef.h> #include <string.h> struct stackmark { diff --git a/cmd/posix/sh/output.h b/cmd/posix/sh/output.h @@ -32,6 +32,8 @@ * SUCH DAMAGE. */ +#include "sh_cdefs.h" + #ifndef OUTPUT_INCL #include <stdarg.h> diff --git a/cmd/posix/sh/sh_cdefs.h b/cmd/posix/sh/sh_cdefs.h @@ -0,0 +1,37 @@ +/*- + * Compat defs for non-BSDs + * + * __unused and __nonstring are intentionally NOT defined here + * They collide with struct field names in some libc's <bits/stat.h> + * (`long __unused[3]`) and similar system headers when defined as + * macros before those headers are included. They remain defined in + * shell.h, which includes <sys/stat.h> before defining them + * + * All definitions are guarded with #ifndef so they do not conflict + * with each other or with system-provided definitions + */ + +#ifndef SH_CDEFS_H +#define SH_CDEFS_H + +#ifndef __dead2 +#define __dead2 __attribute__((__noreturn__)) +#endif + +#ifndef __printf0like +#define __printf0like(n, m) __attribute__((__format__(__printf__, n, m))) +#endif + +#ifndef __printflike +#define __printflike(n, m) __attribute__((__format__(__printf__, n, m))) +#endif + +#ifndef _SH_POINTER_TYPEDEF +#define _SH_POINTER_TYPEDEF +typedef void *pointer; /* used in our memalloc.h and bltin.h + canonical home is shell.h, but we + want memalloc to be self-contained + and not pull all of shell.h */ +#endif + +#endif /* SH_CDEFS_H */ diff --git a/cmd/posix/sh/shell.h b/cmd/posix/sh/shell.h @@ -2,7 +2,7 @@ * SPDX-License-Identifier: BSD-3-Clause * * Copyright (c) 1991, 1993 - * The Regents of the University of California. All rights reserved. + * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Kenneth Almquist. @@ -129,9 +129,9 @@ /* * The follow should be set to reflect the type of system you have: - * JOBS -> 1 if you have Berkeley job control, 0 otherwise. - * define DEBUG=1 to compile in debugging (set global "debug" to turn on) - * define DEBUG=2 to compile in and turn on debugging. + * JOBS -> 1 if you have Berkeley job control, 0 otherwise. + * define DEBUG=1 to compile in debugging (set global "debug" to turn on) + * define DEBUG=2 to compile in and turn on debugging. * * When debugging is on, debugging info will be written to ./trace and * a quit signal will generate a core dump. @@ -148,7 +148,10 @@ typedef intmax_t arith_t; #define ARITH_MIN INTMAX_MIN #define ARITH_MAX INTMAX_MAX +#ifndef _SH_POINTER_TYPEDEF +#define _SH_POINTER_TYPEDEF typedef void *pointer; +#endif #if defined(__has_include) #if __has_include(<sys/cdefs.h>) diff --git a/cmd/posix/sh/show.h b/cmd/posix/sh/show.h @@ -29,6 +29,8 @@ * SUCH DAMAGE. */ +#include "sh_cdefs.h" + void showtree(union node *); #ifdef DEBUG void sh_trace(const char *, ...) __printflike(1, 2); diff --git a/cmd/posix/sh/trap.h b/cmd/posix/sh/trap.h @@ -2,7 +2,7 @@ * SPDX-License-Identifier: BSD-3-Clause * * Copyright (c) 1991, 1993 - * The Regents of the University of California. All rights reserved. + * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Kenneth Almquist. @@ -32,6 +32,9 @@ * SUCH DAMAGE. */ +#include "sh_cdefs.h" +#include <signal.h> /* for sig_atomic_t */ + extern volatile sig_atomic_t pendingsig; extern volatile sig_atomic_t pendingsig_waitcmd;