End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
Process::Status#to_s
stat.to_s → string
process.c
View on GitHub ↗
static VALUE
pst_to_s(VALUE st)
{
rb_pid_t pid;
int status;
VALUE str;
pid = pst_pid(st);
status = PST2INT(st);
str = rb_str_buf_new(0);
pst_message(str, pid, status);
return str;
}
Show pid and exit status as a string.
Example
system("false") p $?.to_s #=> "pid 12766 exit 1"