diff options
author | Andreas Kling <awesomekling@gmail.com> | 2018-10-27 00:29:31 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2018-10-27 00:29:31 +0200 |
commit | 3db8d7ae1a4e294427d06c0532d9bd3b3c19ad13 (patch) | |
tree | 042ba19f7f0bf438dc226e69fa890a4b1ecf0ef9 | |
parent | 509e5f9952c8695cab45f85d0bed15132da9674e (diff) | |
download | serenity-3db8d7ae1a4e294427d06c0532d9bd3b3c19ad13.zip |
Use Unix::stat for sys$lstat().
-rw-r--r-- | ELFLoader/ExecSpace.cpp | 5 | ||||
-rw-r--r-- | Kernel/Syscall.cpp | 2 | ||||
-rw-r--r-- | Kernel/Task.cpp | 6 | ||||
-rw-r--r-- | Kernel/Task.h | 2 | ||||
-rw-r--r-- | Kernel/types.h | 16 |
5 files changed, 9 insertions, 22 deletions
diff --git a/ELFLoader/ExecSpace.cpp b/ELFLoader/ExecSpace.cpp index e15805ac86..67c69bba20 100644 --- a/ELFLoader/ExecSpace.cpp +++ b/ELFLoader/ExecSpace.cpp @@ -1,8 +1,11 @@ #include "ExecSpace.h" #include "ELFLoader.h" -#include <AK/TemporaryFile.h> #include <AK/Types.h> +#ifndef SERENITY +#include <AK/TemporaryFile.h> +#endif + //#define EXECSPACE_DEBUG ExecSpace::ExecSpace() diff --git a/Kernel/Syscall.cpp b/Kernel/Syscall.cpp index 5314418d5d..ca0ed9b66c 100644 --- a/Kernel/Syscall.cpp +++ b/Kernel/Syscall.cpp @@ -69,7 +69,7 @@ DWORD handle(DWORD function, DWORD arg1, DWORD arg2, DWORD arg3) case Syscall::GetDirEntries: return current->sys$get_dir_entries((int)arg1, (void*)arg2, (size_t)arg3); case Syscall::PosixLstat: - return current->sys$lstat((const char*)arg1, (void*)arg2); + return current->sys$lstat((const char*)arg1, (Unix::stat*)arg2); case Syscall::PosixGetcwd: return current->sys$getcwd((char*)arg1, (size_t)arg2); case Syscall::PosixOpen: diff --git a/Kernel/Task.cpp b/Kernel/Task.cpp index 1e625fecf7..21492915de 100644 --- a/Kernel/Task.cpp +++ b/Kernel/Task.cpp @@ -733,13 +733,13 @@ int Task::sys$close(int fd) return 0; } -int Task::sys$lstat(const char* path, void* statbuf) +int Task::sys$lstat(const char* path, Unix::stat* statbuf) { - VALIDATE_USER_BUFFER(statbuf, sizeof(stat)); + VALIDATE_USER_BUFFER(statbuf, sizeof(Unix::stat)); auto handle = VirtualFileSystem::the().open(move(path), m_cwd.ptr()); if (!handle) return -1; - handle->stat((Unix::stat*)statbuf); + handle->stat(statbuf); return 0; } diff --git a/Kernel/Task.h b/Kernel/Task.h index 957b28699e..afa6694f04 100644 --- a/Kernel/Task.h +++ b/Kernel/Task.h @@ -89,7 +89,7 @@ public: int sys$open(const char* path, size_t pathLength); int sys$close(int fd); int sys$read(int fd, void* outbuf, size_t nread); - int sys$lstat(const char*, void* statbuf); + int sys$lstat(const char*, Unix::stat*); int sys$seek(int fd, int offset); int sys$kill(pid_t pid, int sig); int sys$geterror() { return m_error; } diff --git a/Kernel/types.h b/Kernel/types.h index 34113c3e04..8f90b215a7 100644 --- a/Kernel/types.h +++ b/Kernel/types.h @@ -52,22 +52,6 @@ typedef dword blkcnt_t; typedef dword time_t; typedef dword suseconds_t; -struct stat { - dev_t st_dev; /* ID of device containing file */ - ino_t st_ino; /* inode number */ - mode_t st_mode; /* protection */ - nlink_t st_nlink; /* number of hard links */ - uid_t st_uid; /* user ID of owner */ - gid_t st_gid; /* group ID of owner */ - dev_t st_rdev; /* device ID (if special file) */ - off_t st_size; /* total size, in bytes */ - blksize_t st_blksize; /* blocksize for file system I/O */ - blkcnt_t st_blocks; /* number of 512B blocks allocated */ - time_t st_atime; /* time of last access */ - time_t st_mtime; /* time of last modification */ - time_t st_ctime; /* time of last status change */ -}; - struct FarPtr { DWORD offset { 0 }; WORD selector { 0 }; |