]> Projects (at) Tadryanom (dot) Me - AdrOS.git/commit
userland: enhance 17 utilities and ulibc with POSIX features
authorTulio A M Mendes <[email protected]>
Mon, 27 Apr 2026 02:34:15 +0000 (23:34 -0300)
committerTulio A M Mendes <[email protected]>
Mon, 4 May 2026 23:52:02 +0000 (20:52 -0300)
commit21309b3b0658f00b2ea666102244d9508b5c6605
tree9f570b94d2b347d681eba1919d1a5012ff1c62d0
parent7306d074e6964ac55bc00bf304ed3903e9b75de5
userland: enhance 17 utilities and ulibc with POSIX features

ulibc:
- Add sys/statvfs.h and statvfs() implementation
- Extend time.h: strftime, localtime, gmtime, ctime, asctime, difftime
- Fix time_t conflict (was uint32_t in time.h, int32_t in sys/types.h)
- Add unistd.h include to statvfs.c for close()

High-priority commands:
- awk: BEGIN/END blocks, NF/NR vars, print with OFS, -v var=val, /bin/bash
- find: -mtime, -size, -perm, -user, -maxdepth, -delete, -exec
- chmod: symbolic mode support (u+x, go-w, a=rw)
- grep: BRE/ERE regex, -i, -r, -l, -q, -n flags
- sed: d/p/q/a/i/c/y commands, line/regex addresses, -n mode
- ps: BSD-style output with UID/PID/PPID/STAT/TIME/CMD
- top: system summary header, process list with -n iterations

Medium-priority commands:
- sh: command substitution $(...), tilde expansion ~, $$/$! vars,
  variable overflow protection
- cp/mv: preserve source file permissions via fstat
- rm: proper -rf recursive directory removal with getdents
- kill: -l flag to list signal names
- init: SIGUSR1/SIGUSR2 handlers for poweroff/reboot

Low-priority commands:
- stat: date/time display, UID/GID name lookup, file type
- dd: conv= (ucase/lcase/swab/noerror/sync/trunc), skip=, seek=
- ls: -n flag for numeric UID/GID

Tests: 120/120 QEMU, 33/33 battery, 57/57 host (3 skipped)
21 files changed:
user/cmds/awk/awk.c
user/cmds/chmod/chmod.c
user/cmds/cp/cp.c
user/cmds/dd/dd.c
user/cmds/df/df.c
user/cmds/find/find.c
user/cmds/grep/grep.c
user/cmds/init/init.c
user/cmds/kill/kill.c
user/cmds/ls/ls.c
user/cmds/mv/mv.c
user/cmds/ps/ps.c
user/cmds/rm/rm.c
user/cmds/sed/sed.c
user/cmds/sh/sh.c
user/cmds/stat/stat.c
user/cmds/top/top.c
user/ulibc/include/sys/statvfs.h [new file with mode: 0644]
user/ulibc/include/time.h
user/ulibc/src/statvfs.c [new file with mode: 0644]
user/ulibc/src/time.c