3 ms·
>From the kill(2) man page >If pid is less than -1, then sig is sent to every process in the process group whose ID is -pid. This is just awful IMO. Any time
by mrguyorama 2y ago
>From the kill(2) man page
>If pid is less than -1, then sig is sent to every process in the process group whose ID is -pid.
This is just awful IMO. Any time you build an API that has significant behavior boundary on input value (rather than input type) you have probably made a mistake.
I assume this is from the 60s though and therefore impossible to change.
- int_19h 2y agoThis is still very common, unfortunately. Look at all the languages adopting special semantics for negative indices, for example - Python's xs[-1] etc. This can be a lot of fun to debug when you're passing some computed N, and the bug is that it happens to be negative in some cases.