Kernel: Remove offset from OpenFileDescriptor
This is now handled on the libc side. There might be reasons to have it in kernel side, but for simplicity's sake I'm moving it to libc for now :)
This commit is contained in:
@@ -41,16 +41,15 @@ namespace Kernel
|
||||
pid_t pid() const { return m_pid; }
|
||||
|
||||
BAN::ErrorOr<int> open(BAN::StringView, int);
|
||||
BAN::ErrorOr<void> close(int);
|
||||
BAN::ErrorOr<size_t> read(int, void*, size_t);
|
||||
BAN::ErrorOr<size_t> write(int, const void*, size_t);
|
||||
BAN::ErrorOr<void> creat(BAN::StringView, mode_t);
|
||||
BAN::ErrorOr<void> seek(int, size_t);
|
||||
BAN::ErrorOr<void> close(int fd);
|
||||
BAN::ErrorOr<size_t> read(int fd, void* buffer, size_t offset, size_t count);
|
||||
BAN::ErrorOr<size_t> write(int fd, const void* buffer, size_t offset, size_t count);
|
||||
BAN::ErrorOr<void> creat(BAN::StringView name, mode_t);
|
||||
|
||||
BAN::ErrorOr<void> fstat(int, stat*);
|
||||
BAN::ErrorOr<void> stat(BAN::StringView, stat*);
|
||||
BAN::ErrorOr<void> fstat(int fd, stat*);
|
||||
BAN::ErrorOr<void> stat(BAN::StringView path, stat*);
|
||||
|
||||
BAN::ErrorOr<void> mount(BAN::StringView, BAN::StringView);
|
||||
BAN::ErrorOr<void> mount(BAN::StringView source, BAN::StringView target);
|
||||
|
||||
BAN::ErrorOr<BAN::Vector<BAN::String>> read_directory_entries(int);
|
||||
|
||||
@@ -78,7 +77,6 @@ namespace Kernel
|
||||
{
|
||||
BAN::RefPtr<Inode> inode;
|
||||
BAN::String path;
|
||||
size_t offset = 0;
|
||||
uint8_t flags = 0;
|
||||
};
|
||||
|
||||
|
||||
@@ -5,21 +5,20 @@
|
||||
#define SYS_WRITE 3
|
||||
#define SYS_TERMID 4
|
||||
#define SYS_CLOSE 5
|
||||
#define SYS_SEEK 6
|
||||
#define SYS_OPEN 7
|
||||
#define SYS_ALLOC 8
|
||||
#define SYS_FREE 9
|
||||
#define SYS_OPEN 6
|
||||
#define SYS_ALLOC 7
|
||||
#define SYS_FREE 8
|
||||
|
||||
#include <kernel/Attributes.h>
|
||||
#include <stdint.h>
|
||||
|
||||
namespace Kernel
|
||||
{
|
||||
|
||||
template<typename T1 = void*, typename T2 = void*, typename T3 = void*>
|
||||
inline long syscall(int syscall, T1 arg1 = nullptr, T2 arg2 = nullptr, T3 arg3 = nullptr)
|
||||
ALWAYS_INLINE long syscall(int syscall, uintptr_t arg1 = 0, uintptr_t arg2 = 0, uintptr_t arg3 = 0, uintptr_t arg4 = 0, uintptr_t arg5 = 0)
|
||||
{
|
||||
long ret;
|
||||
asm volatile("int $0x80" : "=a"(ret) : "a"(syscall), "b"((uintptr_t)arg1), "c"((uintptr_t)arg2), "d"((uintptr_t)arg3) : "memory");
|
||||
asm volatile("int $0x80" : "=a"(ret) : "a"(syscall), "b"((uintptr_t)arg1), "c"((uintptr_t)arg2), "d"((uintptr_t)arg3), "S"((uintptr_t)arg4), "D"((uintptr_t)arg5) : "memory");
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user