porting obsd userland code to run under linux & musl libc...
* 731c3aa usr.bin/mail: dont use uid_from_user()
* a37d400 usr.bin/mail: fix yet another implicit use of time.h
* 7351d56 usr.bin/mail: use ifdef for ALTWERASE
* 40f5e5e usr.bin/mail: fix another implicit use of time.h
* f68a55e usr.bin/mail: fix implicit use of <sys/file.h>
* f07cade usr.bin/mail: fix implicit use of time.h
* db80de8 usr.bin/mail: import new code from OBSD 7.2
* 9afee35 usr.bin/indent: import new version via OBSD 7.2
i've had lots of false starts with this but this time i'm confident i'll succeed
no idea when i'll have something ready though. i'm fixing/updating lobase and bringing that up to date. see:
https://github.com/Duncaen/lobase
this does most of what i want, but it's 5 years outdated. i've forked it and i'm gradually importing newer code from modern openbsd
i want this for linux distros that use busybox, so that they can... not use busybox, because busybox *sucks*
@libreleah hi. Have you looked at the rust port of the coreutils? It's got a much better bus factor.
https://github.com/uutils/coreutils
@P Yeah but I like the openbsd code. It's tried and tested, and very efficient.
I just prefer C to Rust.
@libreleah Ok. Thanks for the quick answer, and good luck with your project
@libreleah I can definitely see a use for this in helping Linux users make their scripts more portable too. Lots of people will write for GNU/Linux and then hit problems moving code to other other UNIX-based OSs because they only run Linux locally...
@sxa Well, the same problem exists on BSD userlands aswell. For example, FreeBSD's csh and OpenBSD's ksh both provide non-POSIX extensions, as do many of their utilities.
I'm going to maintain an as-is version of these utils, merely ported to compile and run properly, but then maintain a branch in parallel that removes non-POSIX features, bringing feature parity with busybox.
What I want is a single-binary setup like busybox, but with openbsd code in it.
@libreleah Yeah most of them provide some specific extensions but if users could be encouraged to try on Linux and BSD userlands (e.g. in a docker container) I suspect that would knock out quite a few of the issues I see when making stuff work on Solaris/AIX. Fortunately I don't have to use HP-UX much these days to add to that list :-)
@dan the code quality in busybox is awful. it seems small, but a lot of it is calling a bunch of libraries too, and the style is just quite cumbersome, overall it's about the same code size as equivalent openbsd code with non-posix features removed to match busybox functionality
openbsd code style is very clean, it almost feels like you're reading a book
compliance/liability issues with busybox code due to GPL license (and from what i've gleaned, conflicting GPL 2/3 licensing depending on use)
@dan openbsd has a tendency to heavily audit code, and remove useless additions, make it leaner over time
they do this without sacrificing quality or features. for example, openbsd ksh is about the same code size as busybox ash but is packed full of features - freebsd's sh is much smaller too
(i don't see the point in stripping openbsd ksh, i'm doing two profiles: small or full and for small i'll adapter freebsd sh for when i want sh)
openbsd ksh / busybox ash: ~18k sloc
freebsd sh: 12k sloc
@libreleah
This is so cool. I hope to see it used in projects like OpenWRT in the future