diff --git a/kernel/include/kernel/Process.h b/kernel/include/kernel/Process.h index c1567aa7..49a2fb49 100644 --- a/kernel/include/kernel/Process.h +++ b/kernel/include/kernel/Process.h @@ -109,7 +109,6 @@ namespace Kernel BAN::ErrorOr sys_read(int fd, void* buffer, size_t count); BAN::ErrorOr sys_write(int fd, const void* buffer, size_t count); BAN::ErrorOr sys_access(const char* path, int amode); - BAN::ErrorOr sys_create(const char*, mode_t); BAN::ErrorOr sys_create_dir(const char*, mode_t); BAN::ErrorOr sys_unlink(const char*); BAN::ErrorOr readlink_impl(BAN::RefPtr, char* buffer, size_t bufsize); diff --git a/kernel/kernel/Process.cpp b/kernel/kernel/Process.cpp index 45ac4c97..2229d3ef 100644 --- a/kernel/kernel/Process.cpp +++ b/kernel/kernel/Process.cpp @@ -970,14 +970,6 @@ namespace Kernel return 0; } - BAN::ErrorOr Process::sys_create(const char* path, mode_t mode) - { - LockGuard _(m_process_lock); - TRY(validate_string_access(path)); - TRY(create_file_or_dir(VirtualFileSystem::get().root_file(), path, mode)); - return 0; - } - BAN::ErrorOr Process::sys_create_dir(const char* path, mode_t mode) { LockGuard _(m_process_lock); diff --git a/userspace/libraries/LibC/fcntl.cpp b/userspace/libraries/LibC/fcntl.cpp index bbfc8459..809f2c99 100644 --- a/userspace/libraries/LibC/fcntl.cpp +++ b/userspace/libraries/LibC/fcntl.cpp @@ -1,12 +1,11 @@ #include -#include #include #include #include int creat(const char* path, mode_t mode) { - return syscall(SYS_CREATE, path, S_IFREG | __UMASKED_MODE(mode)); + return open(path, O_WRONLY | O_CREAT | O_TRUNC, mode); } int open(const char* path, int oflag, ...) diff --git a/userspace/libraries/LibC/include/sys/syscall.h b/userspace/libraries/LibC/include/sys/syscall.h index e4b7afe7..1746c153 100644 --- a/userspace/libraries/LibC/include/sys/syscall.h +++ b/userspace/libraries/LibC/include/sys/syscall.h @@ -56,7 +56,6 @@ __BEGIN_DECLS O(SYS_POWEROFF, poweroff) \ O(SYS_CHMOD, chmod) \ O(SYS_FCHMOD, fchmod) \ - O(SYS_CREATE, create) \ O(SYS_CREATE_DIR, create_dir) \ O(SYS_UNLINK, unlink) \ O(SYS_READLINK, readlink) \