feat: shell job control (&, &&, ||) and CTRL+C/CTRL+Z support
1. Background processes (&): trailing & forks without waiting, prints
[bg] PID. Works for simple commands and pipelines.
2. Command chaining (&&): executes next command only if previous
succeeded (exit status 0). Skips remaining && chain on failure
until a || or ; is found.
3. OR chaining (||): executes next command only if previous failed
(exit status != 0). Skips remaining || chain on success until
a && or ; is found.
4. CTRL+C / CTRL+Z: shell ignores SIGINT/SIGTSTP/SIGQUIT. Child
processes get their own process group (setpgid) and are set as
the foreground group (TIOCSPGRP). CTRL+C sends SIGINT only to
the child, not the shell. After child exits, shell restores
itself as foreground group.
New files:
- user/ulibc/include/sys/wait.h: WIFEXITED/WIFSIGNALED/etc macros
Modified:
- user/sh.c: process_line rewritten for ;/&&/||/& operators,
run_simple and run_pipeline use setpgid+TIOCSPGRP job control
- user/ulibc/include/termios.h: added TIOCSPGRP/TIOCGPGRP