mirror of
https://github.com/RGBCube/serenity
synced 2025-05-28 16:15:10 +00:00
Implement sys$getcwd properly.
Also fixed broken strcpy that didn't copy the null terminator.
This commit is contained in:
parent
8e640539ef
commit
0f20be05a6
5 changed files with 18 additions and 27 deletions
|
@ -50,8 +50,6 @@ int FileHandle::stat(Unix::stat* buffer)
|
|||
|
||||
Unix::off_t FileHandle::seek(Unix::off_t offset, int whence)
|
||||
{
|
||||
LOCKER(VirtualFileSystem::lock());
|
||||
|
||||
if (!m_vnode)
|
||||
return -EBADF;
|
||||
|
||||
|
@ -94,8 +92,6 @@ Unix::off_t FileHandle::seek(Unix::off_t offset, int whence)
|
|||
|
||||
Unix::ssize_t FileHandle::read(byte* buffer, Unix::size_t count)
|
||||
{
|
||||
LOCKER(VirtualFileSystem::lock());
|
||||
|
||||
if (m_vnode->isCharacterDevice()) {
|
||||
// FIXME: What should happen to m_currentOffset?
|
||||
return m_vnode->characterDevice()->read(buffer, count);
|
||||
|
@ -114,8 +110,6 @@ bool FileHandle::hasDataAvailableForRead()
|
|||
|
||||
ByteBuffer FileHandle::readEntireFile()
|
||||
{
|
||||
LOCKER(VirtualFileSystem::lock());
|
||||
|
||||
if (m_vnode->isCharacterDevice()) {
|
||||
auto buffer = ByteBuffer::createUninitialized(1024);
|
||||
Unix::ssize_t nread = m_vnode->characterDevice()->read(buffer.pointer(), buffer.size());
|
||||
|
@ -133,8 +127,6 @@ bool FileHandle::isDirectory() const
|
|||
|
||||
ssize_t FileHandle::get_dir_entries(byte* buffer, Unix::size_t size)
|
||||
{
|
||||
LOCKER(VirtualFileSystem::lock());
|
||||
|
||||
auto metadata = m_vnode->metadata();
|
||||
if (!metadata.isValid())
|
||||
return -EIO;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue