mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 05:27:46 +00:00
More work towards getting bash to build.
Implemented some syscalls: dup(), dup2(), getdtablesize(). FileHandle is now a retainable, since that's needed for dup()'ed fd's. I didn't really test any of this beyond a basic smoke check.
This commit is contained in:
parent
82f84bab11
commit
9f2b9c82bf
17 changed files with 114 additions and 23 deletions
|
@ -3,15 +3,16 @@
|
|||
#include "VirtualFileSystem.h"
|
||||
#include "InodeMetadata.h"
|
||||
#include <AK/ByteBuffer.h>
|
||||
#include <AK/Retainable.h>
|
||||
|
||||
class TTY;
|
||||
|
||||
class FileHandle {
|
||||
class FileHandle : public Retainable<FileHandle> {
|
||||
public:
|
||||
explicit FileHandle(RetainPtr<VirtualFileSystem::Node>&&);
|
||||
static RetainPtr<FileHandle> create(RetainPtr<VirtualFileSystem::Node>&&);
|
||||
~FileHandle();
|
||||
|
||||
OwnPtr<FileHandle> clone();
|
||||
RetainPtr<FileHandle> clone();
|
||||
|
||||
int close();
|
||||
|
||||
|
@ -39,9 +40,6 @@ public:
|
|||
VirtualFileSystem::Node* vnode() { return m_vnode.ptr(); }
|
||||
|
||||
#ifdef SERENITY
|
||||
int fd() const { return m_fd; }
|
||||
void setFD(int fd) { m_fd = fd; }
|
||||
|
||||
bool isBlocking() const { return m_isBlocking; }
|
||||
void setBlocking(bool b) { m_isBlocking = b; }
|
||||
#endif
|
||||
|
@ -50,6 +48,7 @@ public:
|
|||
|
||||
private:
|
||||
friend class VirtualFileSystem;
|
||||
explicit FileHandle(RetainPtr<VirtualFileSystem::Node>&&);
|
||||
|
||||
RetainPtr<VirtualFileSystem::Node> m_vnode;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue