1: #ifndef lint
   2: static char sccsid[] = "@(#)mkdir.c	5.2 (Berkeley) 6/20/85";
   3: #endif
   4: 
   5: #ifndef BSD4_2
   6: #include <stdio.h>
   7: 
   8: /*
   9:  * make a directory. Also make sure that the directory is owned
  10:  * by the right userid
  11:  */
  12: mkdir(path, mode)
  13: char *path;
  14: int mode;
  15: {
  16:     int pid, status, w;
  17: 
  18:     if (pid=fork()) {
  19:         while ((w = wait(&status)) != pid && w != -1)
  20:             ;
  21:         (void) chmod(path, mode);
  22:     } else {
  23:         (void) umask(~mode);
  24:         (void) execlp("mkdir", "mkdir", path, (char *)NULL);
  25:         perror(path);
  26:         _exit(1);
  27:     }
  28:     return status;
  29: }
  30: #endif !BSD4_2

Defined functions

mkdir defined in line 12; used 2 times

Defined variables

sccsid defined in line 2; never used
Last modified: 1986-01-11
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 969
Valid CSS Valid XHTML 1.0 Strict