1: /* $Header$ */ 2: 3: /* 4: * Author: Peter J. Nicklin 5: */ 6: 7: /* 8: * mk_dir() creates a directory named by dirname via the mkdir command. 9: * Returns exit status of mkdir command. 10: */ 11: #include <sys/param.h> 12: #include "bin.h" 13: #include "system.h" 14: 15: mk_dir(dirname) 16: char *dirname; /* directory name */ 17: { 18: int pid; /* process identity */ 19: int status; /* child return status */ 20: int w; /* a child id */ 21: 22: if ((pid = FORK()) == 0) 23: { 24: execl(MKDIR, "mkdir", dirname, 0); 25: _exit(1); 26: } 27: while ((w = wait(&status)) != pid && w != -1) 28: continue; 29: status >>= NBBY; 30: status &= 0xff; 31: return(status); 32: }