Skip to content

[kernel] Return standard exit status on stopped jobs#2516

Merged
ghaerr merged 2 commits intomasterfrom
stopexit
Dec 11, 2025
Merged

[kernel] Return standard exit status on stopped jobs#2516
ghaerr merged 2 commits intomasterfrom
stopexit

Conversation

@ghaerr
Copy link
Copy Markdown
Owner

@ghaerr ghaerr commented Dec 11, 2025

Corrects process exit values returned by waitpid(..., &status, ...) etc to Linux standard. This now aligns with the WIF* macros in <sys/wait.h>.

The standard values for integer value of status are:

Process status       High byte Low Byte
Normal termination   exitvalue 0
Signal termination   0         signo
Stopped              signo     0x7f

sash was updated to properly report stopped jobs and the stopping signal number (either SIGSTOP or SIGTSTP for now).
The Mar 3 1991 version of ash ELKS is using is hopelessly out of date and is fighting hard not to report on Stopped jobs. Comparison with a later May 4 1995 version has tons of code updates in jobs.c when using waitpid(..., WUNTRACED) but unfortunately I've not been able to even get it to compile.

Good shell jobs support in ELKS looks pretty grim, since real support needs the addition of SIGTTIN and SIGTTOU signals, along with the missing tcsetpgrp and tcgetptrp ioctls for working with the controlling terminal.

@ghaerr ghaerr merged commit 1212280 into master Dec 11, 2025
1 check passed
@ghaerr ghaerr deleted the stopexit branch December 11, 2025 03:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant