Started implementing sys/stat.h calls
[reactos.git] / posix / lib / psxdll / sys / stat / mkdir.c
1 /* $Id: mkdir.c,v 1.1 2002/05/17 02:10:41 hyperion Exp $
2 */
3 /*
4 * COPYRIGHT: See COPYING in the top level directory
5 * PROJECT: ReactOS POSIX+ Subsystem
6 * FILE: subsys/psx/lib/psxdll/sys/stat/mkdir.c
7 * PURPOSE: Make a directory
8 * PROGRAMMER: KJK::Hyperion <noog@libero.it>
9 * UPDATE HISTORY:
10 * 15/05/2002: Created
11 */
12
13 #include <sys/types.h>
14 #include <sys/stat.h>
15 #include <fcntl.h>
16 #include <unistd.h>
17
18 int mkdir(const char *path, mode_t mode)
19 {
20 int nFileNo;
21
22 switch((nFileNo = open(path, O_CREAT | O_EXCL | _O_DIRFILE, mode)))
23 {
24 case -1:
25 return (-1);
26
27 default:
28 close(nFileNo);
29 return (0);
30 }
31 }
32
33 /* EOF */
34