]> 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)
commit59e4cdeb78146cebbe5f1935d11b7f4250febf40
tree216f3eb4797318edac46c71c855400e1be0944a9
parent81f1565c8bf9bb4b137091cb44a4a3573a838e57
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]