]> Projects (at) Tadryanom (dot) Me - AdrOS.git/commit
feat: Phase 5 — posix_compat.c + Busybox 1.36.1 cross-compilation
authorTulio A M Mendes <[email protected]>
Sat, 14 Mar 2026 09:03:52 +0000 (06:03 -0300)
committerTulio A M Mendes <[email protected]>
Sat, 14 Mar 2026 09:03:52 +0000 (06:03 -0300)
commitb3f3f7020dfd45181ceba9cb8dfce218849fdfd5
tree6414488f26722d87e761c5cc145a78ca42520895
parent91dba62d192d6c19f949534c4abde65698e98fb6
feat: Phase 5 — posix_compat.c + Busybox 1.36.1 cross-compilation

Add posix_compat.c to libgloss/adros with comprehensive POSIX stubs
needed for cross-compiling Busybox and other ported software:
- poll() via select() emulation
- popen/pclose stubs
- getline/getdelim
- dirname/basename (libgen)
- symlink/lchown/utimes/ftruncate stubs
- getgroups/setpriority/getpriority
- getrlimit/setrlimit (RLIM_INFINITY defaults)
- mount table: setmntent/getmntent/endmntent/getmntent_r
- mount/umount2 stubs
- DNS stubs: getaddrinfo/freeaddrinfo/gai_strerror/getnameinfo/
  gethostbyname/hstrerror/h_errno
- mknod/execvp/sysinfo/getrusage
- signal() via sigaction wrapper
- uname() syscall (INT 0x80, nr=136)
- sigsuspend/vfork (fork emulation)
- mmap (MAP_ANONYMOUS via malloc)/munmap
- rmdir (INT 0x80, nr=40)
- chroot/readlink/realpath/sysconf/fchown stubs
- clock_settime/utimensat stubs
- clearenv/getgrnam/getgrgid stubs
- sethostname/inet_ntoa/htonl/htons/ntohl/ntohs

Busybox 1.36.1 cross-compiled successfully:
- 262KB static ELF32 i686-adros, 70 applets
- Includes: ash shell, cat, ls, cp, mv, rm, mkdir, chmod, chown,
  grep, sed, diff, find, xargs, sort, head, tail, wc, cut, tr,
  printf, echo, env, sleep, date, dd, stat, readlink, hexdump,
  md5sum, sha256sum, hostname, kill, clear, more, and more

Tests: 101/101 smoke, 64/64 host utils, cppcheck clean
newlib/libgloss/adros/posix_compat.c [new file with mode: 0644]