8.26
learn
- origin shell code in pic 8-23, pic 8-24, pic 8-25
- how to use waitpid in pic 8-18
- how to wait child process in pic 8-42
and write a job management module
compose them and the little shell is born.
add bg
fg
jobs
command to origin shell program
!INCLUDE "./code/shell/shell.c"
job management module. signal handlers are the key part
!INCLUDE "./code/shell/job.c"
test it
(cd chapter8/code/shell; make && ./shell)
ps: ./loop
is a dead loop program, ./sleep
sleeps 5 secs and exit.
当前内容版权归 DreamAndDead 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 DreamAndDead .