bodyfour
Joined 16 years ago
Joined 16 years ago
Don't expect it to do much, but it's fascinating if you're interested in OS history.
It was a then-important optimization to do the most common operations with macros since calling a function for every getc()/putc() would have slowed I/O down too much.
That's why there is also fgetc()/fputc() -- they're the same as getc()/putc() but they're always defined as functions so calling them generated less code at the callsite at the expense of always requiring a function call. A classic speed-vs-space tradeoff.
But, yeah, it was a mistake that it originally used a "char" to store the file descriptor. Back then it was typical to limit processes to 20 open files ( https://github.com/dspinellis/unix-history-repo/blob/Researc... ) so a "char" I'm sure felt like plenty.
Point of order: Minix switched to BSD nvi in 2013 https://github.com/Stichting-MINIX-Research-Foundation/minix...
Not that it matters -- Minix itself hasn't had a commit since 2018 -- but the last five years of its life were spent without Elvis
So you might have a function that doesn't have proper "const" qualifications in its prototype like:
void my_log(char *message);
and then call-sites like: my_log("Hello, World!");
...and that needed to stay compiling.Still, the process was mostly painless. Everything I needed worked out of the box.
Just a phone alert to say "door to unit #xyz has been opened" would be a huge improvement. Wire up a cheap webcam for extra credit.
This is actually something that has been more of a problem in clang than gcc due to LLVM IR limitations... but that is being fixed (or maybe is already?) There was a presentation about it at the 2023 LLVM Developer's meeting which was recently published on their youtube channel https://www.youtube.com/watch?v=DMUeTaIe1CU
The short version (as I understand) is that you don't really need to produce any code to call std::terminate, all you need is tell the linker it needs to leave a hole in the table which maps %rip to the required unwind actions. If the unwinder doesn't know what to do, it will call std::terminate per the standard.
IR didn't have a way of expressing this "hole", though, so instead clang was forced to emit an explicit "handler" to do the std::terminate call
Should be available on any UNIX, it was added to V7 UNIX back in the 1970s: https://github.com/dspinellis/unix-history-repo/blob/Researc...
Even before that, it existed as a standalone text file https://github.com/dspinellis/unix-history-repo/blob/8cf2a84... This still exists on many systems -- for instance as /usr/share/misc/ascii on MacOS
The first (small) problem is that it caused unneeded intra-party drama. Effective assembly members would end up forced to seek a "promotion" into the state senate if they wanted to stay in politics. This often meant challenging members of the same party. This ends with people constantly fighting their "allies" to scramble up the greased pole, rather than doing more useful work.
Of course, that can happen even without term limits (politicians are the ambitious sort) but they definitely accelerate the effect.
The worse problem is that all of the legislators are now short-timers. But do you know who aren't newbs? The lobbyists! Since they're now the only ones around with deep experience, they invariably get even more involved with crafting laws.
This actually dove-tails into the other problem with the lobbying industry: the revolving door from legislator to the lobbying firm. Even without term limits this happens all of the time. It's very common for a retiring US House member to immediately get a lucrative job lobbying their former colleagues. However in a term-limited legislative body this only gets worse. Not only do lobbyists become more powerful, but term limits provide a guaranteed flow of politicians needing a new job.
So, if you find yourself as a newly-elected politician in such a system and you actually want to make a difference, probably your best bet is to immediately find some lobbyists to get sweet with. They are the only ones with the experience to make the political machinery work, and they're probably your future employer as well.
So at least in my observation, the ultimate effect of term-limits is to transfer power from democratically elected representatives to well-funded special interests. By un-entrenching the politicians you're accidentally making another group even more entrenched.
By contrast, I think the very top legislators are ones that become a true expert in their field of interest. Imagine somebody who has been working on, say, education policy for decades. They know every policy detail, all of the stakeholders, all of the experts. In a world of term limits, how will such a person ever emerge?
All of the above is specifically about legislative term limits. I believe the case for executive term limits is much stronger.
The malicious code that the xz backdoor inserts into the library is a compiled x86_64 object file so it only is targeting one platform.
Yeah, I've been banging on that same drum for ages too... for example on this very site a decade ago: https://news.ycombinator.com/item?id=7213563
I'm honestly surprised that this autoconf vector hasn't happened more often... or more often that we know of.
Probably not an issue for most people in 2026 -- you have to back pretty far for it to be missing. Technically, though, "if x; then :; else" is more portable.