1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 07:28:11 +00:00

Add a Unix namespace for foo_t types.

This allows me to keep prototyping things on a random desktop machine,
even if that machine has its own ideas about foo_t types.
This commit is contained in:
Andreas Kling 2018-10-14 22:57:41 +02:00
parent c6d6ba7512
commit 1f41a36c52
16 changed files with 116 additions and 49 deletions

View file

@ -3,19 +3,14 @@
#include "VirtualFileSystem.h"
#include <AK/ByteBuffer.h>
enum class SeekType {
Absolute, // SEEK_SET
RelativeToCurrent, // SEEK_CUR
RelativeToEnd, // SEEK_END
};
class FileHandle {
public:
explicit FileHandle(RetainPtr<VirtualFileSystem::Node>&&);
~FileHandle();
FileOffset lseek(FileOffset, SeekType);
ssize_t read(byte* buffer, size_t count);
Unix::off_t seek(Unix::off_t, int whence);
Unix::ssize_t read(byte* buffer, Unix::size_t count);
int stat(Unix::stat*);
ByteBuffer readEntireFile();
@ -24,6 +19,6 @@ private:
RetainPtr<VirtualFileSystem::Node> m_vnode;
FileOffset m_currentOffset { 0 };
Unix::off_t m_currentOffset { 0 };
};