2 Copyright © 1995-2012, The AROS Development Team. All rights reserved.
5 POSIX.1-2008 function mkdir().
14 /*****************************************************************************
29 path - the path of the directory being created
30 mode - the permission flags for the directory
33 0 on success or -1 on errorr.
43 chmod(), stat(), umask()
47 ******************************************************************************/
53 if (!path
) /*safety check */
59 apath
= (char*) __path_u2a(path
);
63 /* Duplicate apath to avoid modifying function argument if !__upath */
64 apath
= strdup(apath
);
71 /* Remove possible trailing / to avoid problems in handlers */
72 if(strlen(apath
) > 0 && apath
[strlen(apath
)-1] == '/')
73 apath
[strlen(apath
)-1] = '\0';
75 lock
= CreateDir((STRPTR
) apath
);
80 errno
= __stdc_ioerr2errno(IoErr());