/* mkdir.c (rsxnt) -- Copyright (c) 1996-1997 Rainer Schnitker */

#include "rsxnt.h"

int __mkdir(const char *name)
{
    static SECURITY_ATTRIBUTES defsec =
        { sizeof(SECURITY_ATTRIBUTES), NULL, TRUE };
    char fname[512];

    _rsxnt_truncate_name (fname, name);

    if (_rsxnt_get_process_ptr()->bConsoleApp)
        OemToChar(fname, fname);

    if (CreateDirectory(fname, &defsec) == FALSE)
        return _rsxnt_get_last_errno();
    else
        return 0;
}
