diff --git a/libc/src/sys/stat/linux/mkdir.cpp b/libc/src/sys/stat/linux/mkdir.cpp --- a/libc/src/sys/stat/linux/mkdir.cpp +++ b/libc/src/sys/stat/linux/mkdir.cpp @@ -21,7 +21,7 @@ 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_unlinkat) +#elif defined(SYS_mkdirat) long ret = __llvm_libc::syscall(SYS_mkdirat, AT_FDCWD, path, mode); #else #error "mkdir and mkdirat syscalls not available." diff --git a/libc/src/sys/stat/linux/mkdirat.cpp b/libc/src/sys/stat/linux/mkdirat.cpp --- a/libc/src/sys/stat/linux/mkdirat.cpp +++ b/libc/src/sys/stat/linux/mkdirat.cpp @@ -18,7 +18,7 @@ namespace __llvm_libc { LLVM_LIBC_FUNCTION(int, mkdirat, (int dfd, const char *path, mode_t mode)) { -#ifdef SYS_unlinkat +#ifdef SYS_mkdirat long ret = __llvm_libc::syscall(SYS_mkdirat, dfd, path, mode); #else #error "mkdirat syscalls not available."