/
GitCaptain
/
llvm-project
Обзор
Документация
Войти
/
GitCaptain
/
llvm-project
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
fix-tests
libc/src/sys/stat/linux/mkdir.cpp
37 строк
1 KB
Siva Chandra Reddy
[libc][Obvious] Fix typo in mkdir and mkdirat implementations.
09 фев 2022, 00:48
09 фев 2022, 00:48
545331a
Код
Авторство
О чём код?
//===-- Linux implementation of mkdir -------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// #include "src/sys/stat/mkdir.h" #include "src/__support/OSUtil/syscall.h" // For internal syscall function. #include "src/__support/common.h" #include <errno.h> #include <fcntl.h> #include <sys/stat.h> #include <sys/syscall.h> // For syscall numbers. namespace __llvm_libc { LLVM_LIBC_FUNCTION(int, mkdir, (const char *path, mode_t mode)) { #ifdef SYS_mkdir long ret = __llvm_libc::syscall(SYS_mkdir, path, mode); #elif defined(SYS_mkdirat) long ret = __llvm_libc::syscall(SYS_mkdirat, AT_FDCWD, path, mode); #else #error "mkdir and mkdirat syscalls not available." #endif if (ret < 0) { errno = -ret; return -1; } return 0; } } // namespace __llvm_libc