aboutsummaryrefslogtreecommitdiffstats
path: root/c/gbos.h
diff options
context:
space:
mode:
authoruser <user@clank>2026-07-16 11:15:12 +0200
committeruser <user@clank>2026-07-16 11:15:12 +0200
commitbb4f468b73c8a888bec1e5b2ba7f1575ab7f8456 (patch)
tree24e681e7ca242f3041f6a3effa197445ada451fb /c/gbos.h
parentkill + ps: implement SYS_KILL (pid 1 immortal) and a ps tool (diff)
downloadgbos-bb4f468b73c8a888bec1e5b2ba7f1575ab7f8456.tar.gz
gbos-bb4f468b73c8a888bec1e5b2ba7f1575ab7f8456.tar.xz
gbos-bb4f468b73c8a888bec1e5b2ba7f1575ab7f8456.zip
jobs: background execution (&), non-blocking reap, spin demo
- sys_reap: nohang reap of a finished zombie child (-> pid or 0). - shell: 'cmd &' launches in the background (prints [pid], no wait); reaps finished jobs at the prompt ([pid done]). Foreground now waits for its own child specifically (loops wait(), reporting bg completions meanwhile) so kill reports the right pid. - spin: a process that yields forever - a target for ps/kill. - verified: spin &; ps shows it; kill <pid> removes just that one; immortal init; self-finishing bg worker reaped with [pid done].
Diffstat (limited to '')
-rw-r--r--c/gbos.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/c/gbos.h b/c/gbos.h
index 5f22a5a..f76d1e0 100644
--- a/c/gbos.h
+++ b/c/gbos.h
@@ -41,4 +41,6 @@ unsigned char lookup(const char *name); /* command name -> program id */
unsigned char kill(unsigned char pid); /* terminate a pid (1 is immortal)*/
unsigned char psget(unsigned char slot, unsigned char *buf); /* {pid,state,prog}*/
void progname(unsigned char id, char *buf); /* id -> name */
+void yield(void);
+unsigned char reap(void); /* reap a finished bg job, or 0 */
#endif