4 ms·
there could very well be a bug. if there's a bug, fix it. But from what I read, it's documented as not threadsafe and this problem is happening in a threaded e
by fsckboy 3y ago
there could very well be a bug. if there's a bug, fix it.
But from what I read, it's documented as not threadsafe and this problem is happening in a threaded environment. That still could be called a bug. You find bugs, you fix them;
That's better than hyperventilating about how there is some massive problem with an operating system that you are using because all the people who came before you who knew more than you decided it was the best thing to use. The other OSes sucked more. This OS is simple enough that you can actually learn how it works, it's all laid out in front of you.
Should it do some additional things? sure. Help write the code.
- dundarious 3y agoA beartrap/footgun means "a bit too easy to harm yourself for comfort", not "there is a bug". I am relatively old and have been programming to this interface for a few decades, so I'm not hyperventilating about it. My point (which made reference to the actual OS documentation) was that it takes being bit by such issues before you learn what this "Attributes" section means: > │Interface │ Attribute │ Value │ > │getaddrinfo() │ Thread safety │ MT-Safe env locale │ For the 1st decade of my career, I just searched for "re-entrant", "reentrant", or "MT" and went on my merry way, without realizing the importance of the other possible values of attributes table: in this case "env". It's worth highlighting!
- fsckboy 3y agowhen you read the doc and realized you missed something, don't say "footgun", say "aha! I misunderstood" Then if you want, set about to make things better. Instead of jumping to "It shouldn't work this way" consider "Hmmm, why does it work this way? Is it possible that Thompson, Kernighan and Ritchie knew more about how to make a coherent straightforward system that would last 50 years in 1970 than I know how to now?"
- burntsushi 3y agoOr perhaps you might consider that we've learned something in the last 50 years. It sounds to me like you're hyperventilating about other people pointing out footguns. Maybe, just maybe, people in the past were capable of making mistakes. Let's not put them on a pedestal.
- rb12345 3y agoIn fairness, they also gave us the joys of `strcpy(src_ptr, dest_ptr)` and `scanf("%s", str_ptr)`, which with the benefit of hindsight and many buffer overflows later were a terrible idea.