ladybird/LibC/stat.cpp
Andreas Kling de4604ac95 Finally hook up the mkdir code to a syscall.
Added a /bin/mkdir that makes directories. How very neat :^)
There are various limitations because of missing functionality.
2018-11-18 15:02:16 +01:00

19 lines
344 B
C++

#include <sys/stat.h>
#include <errno.h>
#include <Kernel/Syscall.h>
extern "C" {
mode_t umask(mode_t mask)
{
return Syscall::invoke(Syscall::SC_umask, (dword)mask);
}
int mkdir(const char* pathname, mode_t mode)
{
int rc = Syscall::invoke(Syscall::SC_mkdir, (dword)pathname, (dword)mode);
__RETURN_WITH_ERRNO(rc, rc, -1);
}
}