mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 11:37:34 +00:00
Kernel+LibC+LibCore: Implement mkdirat(2)
This commit is contained in:
parent
6445a706cf
commit
eb5389e933
5 changed files with 12 additions and 5 deletions
|
@ -23,12 +23,18 @@ mode_t umask(mode_t mask)
|
|||
|
||||
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/mkdir.html
|
||||
int mkdir(char const* pathname, mode_t mode)
|
||||
{
|
||||
return mkdirat(AT_FDCWD, pathname, mode);
|
||||
}
|
||||
|
||||
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/mkdirat.html
|
||||
int mkdirat(int dirfd, char const* pathname, mode_t mode)
|
||||
{
|
||||
if (!pathname) {
|
||||
errno = EFAULT;
|
||||
return -1;
|
||||
}
|
||||
int rc = syscall(SC_mkdir, pathname, strlen(pathname), mode);
|
||||
int rc = syscall(SC_mkdir, dirfd, pathname, strlen(pathname), mode);
|
||||
__RETURN_WITH_ERRNO(rc, rc, -1);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue