feat: new abilities#22
Merged
Merged
Conversation
src/applets/dd.cpp: convert-and-copy with operands (key=value, not flags): bs/ibs/obs (byte suffixes c/w/b/K/M/G/T), count, if/of, skip/seek, conv (notrunc/noerror/sync/fsync/fdatasync), status (none/noxfer/progress). Raw POSIX block I/O via io::unique_fd (RAII); reblocks ibs->obs when they differ; conv=sync zero-pads short reads; transfer stats to stderr. Registered (applets.hpp + applet_config.hpp.in + cmake/Config.cmake CFBOX_APPLETS). +10 GTest (489 total) + integration test_dd.sh (55 scripts). size-opt 479->483 KB. POSIX coverage utility 61->62/77 (baseline updated).
…/umask/ulimit/wait/times/unalias) src/applets/sh/sh_builtins.cpp: add find_in_path helper + 10 builtins. type/command resolve builtins->functions->$PATH; command -v/-V describe, command <cmd> executes without consulting functions (fork+execvp). exec replaces the process (execvp). getopts drives OPTIND/OPTARG/OPTERR vars over positional or explicit args. umask reads/sets (octal + -S symbolic). ulimit -a/-f/-n/-s/-c/-d/-v get/set via getrlimit/setrlimit. wait waitpids (any or pid). times prints RUSAGE self+children. hash/unalias are no-ops (cfbox has no command cache or alias table — POSIX-permitted). POSIX coverage builtin 10/20 -> 20/20 (100%); total 74% -> 84% (baseline updated). +test_sh_builtins.sh integration (11 checks). ctest 489 still green. Known follow-up: wait cannot join background jobs yet — cfbox sh has no & job table; wait is registered and type-visible but functional job-wait needs sh_executor work (separate batch).
tests/differential/: framework.sh (run_diff/run_diff_in compare cfbox vs a
busybox oracle, classify MATCH/FAIL), test_diff_coreutils.sh (33 core
text-applet cases), run_all.sh. Needs a built busybox oracle
(competition/busybox/busybox; defconfig with CONFIG_TC off — tc needs kernel
headers absent in the build env).
First run immediately surfaced 2 real divergences, both fixed:
- wc: print_counts padded every count to width 8 (GNU style). BusyBox only
pads when there are multiple files. Added a 'pad' arg: stdin/single-file
print plain, multi-file/total keep %8ld alignment.
- cut -c: char mode erroneously joined selected chars with the field delim
(tab), printing 'a\tb\tc' for 'cut -c1-3'. Char mode now emits selected
chars contiguously ('abc'). Field mode unchanged.
test_diff_coreutils: 33 match, 0 fail. ctest 489 + integration still green.
Not wired into CI (needs the busybox oracle build step).
ibs/obs were uint64_t, but they feed std::vector ctors, read()/memset() sizes and got==ibs comparisons — all size_t. On 32-bit armhf (size_t = unsigned int) the uint64_t->size_t narrowing tripped -Werror=conversion in CI. ibs/obs are now size_t (a block size never realistically exceeds SIZE_MAX); count/skip/seek stay uint64_t (may be large, used for loops and lseek off_t). Parse assignments cast n->size_t. Verified locally: armhf cross-compile green, native ctest 489 + dd 10 green. This was the only CI failure on feat/phase4-sweep (native/release-size passed).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.