smallsh(명령어처리기)교수님의 초안에서 background기능을 추가하였다.◎background 기능교수님의 초안에서는 parent가 입력받은 명령어를 child에게 실행시키도록 하고 있다. background 기능은 여기에 착안하여, parent의 불완전 종료를 이용해서 쉽게 구현할 수 있다. 즉 parent가 child를 기다리지 않고 종료하게 되면 child는 system의 init process와 함께 구동되어 자연스럽게 background 기능을 실행하게 되는 것이다.그럼 첨가된 부분을 중심으로 실제 소스를 살펴보자.smallsh.h#include #include #include #define EOL1 /* end of line */#define ARG2 /* normal arguments */#define SEMICOLON3#define AMPERSAND4 /*background 기능 index*/#define MAXARG512 /* max. no. command args */#define MAXBUF512 /* max. length input line */#define FOREGROUND0#define BACKGROUND1 /*background 기능 index*/--------------------------------------------------------------------smallch.c (함수 나열순은 실제 소스에서의 순서를 따랐다.)/* program buffers and work pointers */static char inpbuf[MAXBUF], tokbuf[2*MAXBUF],*ptr = inpbuf, *tok = tokbuf;/* print prompt and read a line */int userin(char *p){/*userin()함수의 경우 교수님의 초안과 일치한다.getchar를 이용하여 EOF를 만날때까지 inpbuf에 한문자씩( n'까지 포함하여)저장한다. return 값은 정상종료일 경우 문자개수이다.*/}static char special[] = {' ', 't', ';', 'n', '