Don't call ReadArgs() if started from WB.
[tangerine.git] / compiler / clib / mkdir.c
blob3bedaa2564d9cc280df09fa3d0c0ebbb608dd6f7
1 /*
2 Copyright © 1995-2003, The AROS Development Team. All rights reserved.
3 $Id$
5 POSIX function mkdir().
6 */
8 #include <proto/dos.h>
9 #include <errno.h>
10 #include "__errno.h"
11 #include "__upath.h"
13 /*****************************************************************************
15 NAME */
16 #include <sys/stat.h>
18 int mkdir (
20 /* SYNOPSIS */
21 const char *path,
22 mode_t mode)
24 /* FUNCTION
25 Make a directory file
27 INPUTS
28 path - the path of the directory being created
29 mode - the permission flags for the directory
31 RESULT
32 0 on success or -1 on errorr.
34 NOTES
37 EXAMPLE
39 BUGS
41 SEE ALSO
42 chmod(), stat(), umask()
44 INTERNALS
46 ******************************************************************************/
49 BPTR lock;
51 if (!path) /*safety check */
53 errno = EFAULT;
54 return -1;
57 path = __path_u2a(path);
58 if (!path)
59 return -1;
61 lock = CreateDir(path);
63 if (!lock)
65 errno = IoErr2errno(IoErr());
66 return -1;
69 UnLock(lock);
71 return 0;