Closed q66 closed 3 years ago
caveat: we'll need to find a good way to preprocess the manpage (it's currently not installed)
sort(1) across the BSDs is fascinating. So much work and they vary greatly. pthreads here? Ugh.
OK, so everything looks fine in this but I do have the following nits:
queue.h is a BSD-ism, glibc carries it for compatibility, i don't really see any point in using it (considering the stuff i replaced it with is extremely trivial, and it's literally what those macros do as well) - ifdef'ing around it would just make it worse
as for linux ifdefs, i felt like keeping it portable, but i can drop them if you want, i don't really care either way
pthreads are optional, but they seem to work so might as well use them (NLS is also optional, and i disabled it because it loads extra stuff and the only translation in the tree is for Hungarian)
i'm also porting tail, btw; gonna submit it tomorrow if i get to finishing it... after that we'll only have stty and timeout left, not quite sure what to do about stty
dealt with the linux bits, added manpage
i think this should be fine now
queue.h is a BSD-ism, glibc carries it for compatibility, i don't really see any point in using it (considering the stuff i replaced it with is extremely trivial, and it's literally what those macros do as well) - ifdef'ing around it would just make it worse
I'm aware that queue.h is a BSD-ism. As far as the BSD things go, I kind of like queue.h. But after thinking about this more, the worst part of it is that all of the queue.h implementations vary slightly. I do wish that musl just carried the same one that glibc has for the sake of portability across Linux distributions, but I also don't want to go down the path of carrying queue.h in this tree.
So, TL;DR, what you did is fine here.
as for linux ifdefs, i felt like keeping it portable, but i can drop them if you want, i don't really care either way
Normally I am all in favor of this, but at this point in time for this project I would prefer that we keep it scoped to "this stuff is specifically ported to Linux systems". If there is a strong desire from people to have this portable elsewhere, then we can explore that.
pthreads are optional, but they seem to work so might as well use them (NLS is also optional, and i disabled it because it loads extra stuff and the only translation in the tree is for Hungarian)
I'm fine with it, I was just making an observation that I find it amusing that sort(1) is threaded. Also, agreed on disabling the NLS parts.
Thanks!
i'm also porting tail, btw; gonna submit it tomorrow if i get to finishing it... after that we'll only have stty and timeout left, not quite sure what to do about stty
I've got stty ready to go and will probably commit that during my day today. It was mostly a repeat of what I did porting the one from OpenBSD to Linux, but more simple. I've also got timeout partway through, so you can leave that one with me too.
dealt with the linux bits, added manpage
i think this should be fine now
Looks good, yeah.
alright, cool; my tail port is complete except for the kqueue bits, which i'm gonna replace with inotify+poll probably during today
fgets
is done since 1) there is no standard wide-chargetline
2) I haven't usedgetline
for non-widechar either in order to be able to utilize the static buffer for short lines (since that's going to be most lines, and we don't want to allocate a new buffer for every call, since it's not used with a loop)