mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 07:38:10 +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
|
@ -6,6 +6,11 @@
|
|||
#include "TTY.h"
|
||||
#include <AK/BufferStream.h>
|
||||
|
||||
RetainPtr<FileHandle> FileHandle::create(RetainPtr<VirtualFileSystem::Node>&& vnode)
|
||||
{
|
||||
return adopt(*new FileHandle(move(vnode)));
|
||||
}
|
||||
|
||||
FileHandle::FileHandle(RetainPtr<VirtualFileSystem::Node>&& vnode)
|
||||
: m_vnode(move(vnode))
|
||||
{
|
||||
|
@ -15,9 +20,9 @@ FileHandle::~FileHandle()
|
|||
{
|
||||
}
|
||||
|
||||
OwnPtr<FileHandle> FileHandle::clone()
|
||||
RetainPtr<FileHandle> FileHandle::clone()
|
||||
{
|
||||
auto handle = make<FileHandle>(m_vnode.copyRef());
|
||||
auto handle = FileHandle::create(m_vnode.copyRef());
|
||||
if (!handle)
|
||||
return nullptr;
|
||||
handle->m_currentOffset = m_currentOffset;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue