2021-01-30 03:49:34 +00:00
|
|
|
/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:2;tab-width:8;coding:utf-8 -*-│
|
2023-12-08 03:11:56 +00:00
|
|
|
│ vi: set et ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi │
|
2021-01-30 03:49:34 +00:00
|
|
|
╞══════════════════════════════════════════════════════════════════════════════╡
|
|
|
|
│ Copyright 2021 Justine Alexandra Roberts Tunney │
|
|
|
|
│ │
|
|
|
|
│ Permission to use, copy, modify, and/or distribute this software for │
|
|
|
|
│ any purpose with or without fee is hereby granted, provided that the │
|
|
|
|
│ above copyright notice and this permission notice appear in all copies. │
|
|
|
|
│ │
|
|
|
|
│ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL │
|
|
|
|
│ WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED │
|
|
|
|
│ WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE │
|
|
|
|
│ AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL │
|
|
|
|
│ DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR │
|
|
|
|
│ PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER │
|
|
|
|
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
|
|
|
│ PERFORMANCE OF THIS SOFTWARE. │
|
|
|
|
╚─────────────────────────────────────────────────────────────────────────────*/
|
2023-08-21 09:28:24 +00:00
|
|
|
#include "libc/calls/syscall-nt.internal.h"
|
2022-05-23 22:06:11 +00:00
|
|
|
#include "libc/calls/syscall_support-nt.internal.h"
|
2021-01-30 03:49:34 +00:00
|
|
|
#include "libc/nt/files.h"
|
2023-11-18 00:47:47 +00:00
|
|
|
#include "libc/str/str.h"
|
2021-01-30 03:49:34 +00:00
|
|
|
|
2021-02-04 03:35:29 +00:00
|
|
|
textwindows int sys_mkdirat_nt(int dirfd, const char *path, uint32_t mode) {
|
2023-08-21 09:28:24 +00:00
|
|
|
char16_t path16[PATH_MAX];
|
2021-01-30 09:49:43 +00:00
|
|
|
if (__mkntpathat(dirfd, path, 0, path16) == -1) return -1;
|
2022-04-08 03:30:04 +00:00
|
|
|
if (CreateDirectory(path16, 0)) return 0;
|
2022-04-18 07:01:26 +00:00
|
|
|
return __fix_enotdir(-1, path16);
|
2021-01-30 03:49:34 +00:00
|
|
|
}
|