News for hackers. Stuff that matters.
Re:Rust and Nix = easier Unix systems programming by SixSigma on Thursday April 14, 2016 @02:53AM (#11494757)
In reliability theory "X failed" is a poor error message. What we want to know is which failure mode has been triggered.

The function of kill is to kill a given pid, so there are two failure modes : "the pid didn't exist" or "the pid didn't die"

Re:Rust and Nix = easier Unix systems programming by Sean1708 on Thursday April 14, 2016 @06:48AM (#11495557)
"kill failed" isn't actually the message which is printed. What you get is

    thread '<main>' panicked at 'kill failed: Sys(ESRCH)', ../src/libcore/result.rs:746
So you know that it failed because of ESRCH (no such process).
Re:Rust and Nix = easier Unix systems programming by SixSigma on Thursday April 14, 2016 @10:25AM (#11496970)
Ah, that makes much more sense, thanks
Re:Rust and Nix = easier Unix systems programming by masklinn on Thursday April 14, 2016 @07:00AM (#11495599)
> The function of kill is to kill a given pid

1. there are more failure modes than these (POSIX kill(2) can set 3 different errnos)

2. kill(2) signals process, it doesn't usually kill them (let alone kill them outright in such a way that this information could ever be returned)

3. kill(2) can signal process sets of cardinality > 1

4. the `unwrap` panic message will print the unwrapped value, which includes the ERRNO

Re:Rust and Nix = easier Unix systems programming by LukeShu on Thursday April 14, 2016 @03:10AM (#11494821)
It's poorly named, because the function of kill isn't to kill a given PID; it's to send a signal to a given PID.
Re:Rust and Nix = easier Unix systems programming by realusername on Thursday April 14, 2016 @09:54AM (#11496658)
kill(2) unlike it's name actually sends any signal to a pid, not only SIGKILL. Other signals are used for various purpose. SIGINT is for example used when using Ctrl-C on a terminal.
[dead]
Re:Rust and Nix = easier Unix systems programming by SixSigma on Thursday April 14, 2016 @05:53AM (#11495363)
I got exposed to reliability theory in Logistics Engineering.

Mostly: Reliability Centered Maintenance

https://en.wikipedia.org/wiki/Reliability-centered_maintenan...