Remix.run Logo
JuniperMesos 3 hours ago

Why is it even possible to represent a negative PID, let alone treat the integer -1 as a PID meaning "all effective processes"? This seems like a mistake (if not a rookie mistake) in the Linux kernel API itself.

nine_k 2 hours ago | parent | next [-]

-1 is a special case, a way to represent a PID with all bits set in a platform-independent way. It's not very clean, and it comes from ancient times when writing some extra code and storing an extra few bytes was way more expensive.

dminik 2 hours ago | parent | prev | next [-]

It feels a bit like a "better is better" language hitting all of the quirks of a "worse is better" environment.

antonvs 2 hours ago | parent | prev [-]

Pretty much all the rough edges being discussed here are design mistakes in Linux or Unix, and/or a consequence of using an unsafe language with limited abstractions and a weak type system. But because of ubiquity, this is everyone’s problem now.