/* this function is a POSIX compliant version, which will make a directory */
int mkdir(const char *path, mode_t mode)
/* this function is a POSIX compliant version, which will make a directory */
int mkdir(const char *path, mode_t mode)
{
    int fd;
    struct dfs_fd *d;
    int result;
    fd = fd_new();
    if (fd == -1)
    {
        rt_set_errno(-ENOMEM);
        return -1;
    }
    d = fd_get(fd);
    result = dfs_file_open(d, path, O_DIRECTORY | O_CREAT);
    if (result < 0)
    {
        fd_put(d);
        fd_put(d);
        rt_set_errno(result);
        return -1;
    }
    dfs_file_close(d);
    fd_put(d);
    fd_put(d);
    return 0;
}