mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 06:47:35 +00:00
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.
This commit is contained in:
parent
303577df16
commit
de4604ac95
26 changed files with 238 additions and 132 deletions
|
@ -41,6 +41,7 @@
|
|||
__ERROR(ENOSYS, "No such syscall") \
|
||||
__ERROR(ENOTIMPL, "Not implemented") \
|
||||
__ERROR(EAFNOSUPPORT, "Address family not supported") \
|
||||
__ERROR(EWHYTHO, "Failed without setting an error code (Bug!)") \
|
||||
|
||||
enum __errno_values {
|
||||
#undef __ERROR
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#include <sys/stat.h>
|
||||
#include <errno.h>
|
||||
#include <Kernel/Syscall.h>
|
||||
|
||||
extern "C" {
|
||||
|
@ -8,5 +9,11 @@ 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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -7,5 +7,6 @@ __BEGIN_DECLS
|
|||
|
||||
mode_t umask(mode_t);
|
||||
int chmod(const char* pathname, mode_t);
|
||||
int mkdir(const char* pathname, mode_t);
|
||||
|
||||
__END_DECLS
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue