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