Replies: 4 comments 3 replies
-
I'm a bit torn about this. I don't think we need to care too much about non-POSIX support - if anyone turns up who desperately has to run es on some bizarre OS, they can easily grab an older version - but there's a bit of 'if it isn't broke, don't fix it'. Any time you touch a mostly untested code-base there's the chance that you break something in some strange/unexpected way... but I'm not the one trying to actually work with the code, and haven't been looking at the PRs, so if you'd enjoy doing do some careful cleaning up I'm not going to complain. |
Beta Was this translation helpful? Give feedback.
-
I don't think I mean to do any clean-up just for the sake of clean-up, but -- to look more into my motivating examples here... Autoconf, which is basically our best authority on portability right now, seems upset about using But a fake The Trying to fix this in a way that works for all the UNIXen all the time is complicated, though: back in the day, SysV and BSD created their own incompatible ways to group processes, and the POSIX spec tried to come up with something new that kinda-sorta smooshes the two together, but which more closely matches the BSD way. So the most-correct way to do things seems to be: "do it the POSIX way, unless you can't, in which case do it the BSD way, unless you can't, in which case do it the SysV way." But this is complicated by itself, I don't know how to correctly test for it (autoconf docs aren't much help since they mostly say "everything is POSIX"), and it has subtle semantic implications that I don't understand (what happens on every one of these systems when a backgrounded job reads from the terminal? Outside of POSIX, I couldn't tell you.) So in both of these cases we know how to strive for absolute, maximum portability, but it's strictly harder to implement and I can't even guarantee non-POSIX systems will get the only-mostly-correct behavior I expect, because I can't really find any! |
Beta Was this translation helpful? Give feedback.
-
I tend to lean heavily in favor of careful removal of legacy code instead of leaving it to bitrot. Does es even work on some of these platforms still? |
Beta Was this translation helpful? Give feedback.
-
Relatedly, I just discovered that es seems to mostly work fine on Haiku (impressive!), except that Haiku encodes WIFEXITED/WIFSIGNALED/WIFSTOPPED differently than Linux and friends, meaning that, for example, any normal falsey exit status gets interpreted as a WIFSIGNALED:
and so on. I don't believe POSIX actually specifies how exit statuses should be encoded in wait() -- might be something to be fixed here. |
Beta Was this translation helpful? Give feedback.
-
There are a few places in es' codebase where it currently fusses about working right in this-or-that buggy or incompatible UNIX from back when that was the way the world looked in the early '90s. These days it seems to me that among the various extant UNIXoid OSes, POSIX support has gotten pretty good and coding es to POSIX APIs would be pretty reasonable.
A couple specific examples I have in mind:
waitpid(3)
inproc.c
? It would be nice to be able to unify on a single system version of wait.setpgid(3)
inprim-sys.c
? The current behavior withsetsid(3)
is actually (IMO) a bug given how differently the two functions behave under POSIX.I'm not trying to yank out current compatible behavior just for the heck of it, but it would be nice to not have to do a, say,
HAVE_WAITPID
test for what seems like it should be extremely standard functionality.Does anyone have a strong reaction to this? Is anyone using es on a not-very-POSIX machine?
Beta Was this translation helpful? Give feedback.
All reactions