diff options
author | Andreas Kling <awesomekling@gmail.com> | 2018-10-16 00:35:03 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2018-10-16 00:35:03 +0200 |
commit | f6086297047b639ede6fc0e058e4efcfc09ea46f (patch) | |
tree | 8d3487d2abc1c4b3d4e7eddf9d6a515ee070595a /VirtualFileSystem/SyntheticFileSystem.cpp | |
parent | 5c50d02c2e6369e551eb67638c7e0b36366f1cca (diff) | |
download | serenity-f6086297047b639ede6fc0e058e4efcfc09ea46f.zip |
Implement creating a new directory.
Diffstat (limited to 'VirtualFileSystem/SyntheticFileSystem.cpp')
-rw-r--r-- | VirtualFileSystem/SyntheticFileSystem.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/VirtualFileSystem/SyntheticFileSystem.cpp b/VirtualFileSystem/SyntheticFileSystem.cpp index bc750b5546..1940d2f724 100644 --- a/VirtualFileSystem/SyntheticFileSystem.cpp +++ b/VirtualFileSystem/SyntheticFileSystem.cpp @@ -97,7 +97,7 @@ bool SyntheticFileSystem::setModificationTime(InodeIdentifier, dword timestamp) return false; } -InodeIdentifier SyntheticFileSystem::createInode(InodeIdentifier parentInode, const String& name, word mode) +InodeIdentifier SyntheticFileSystem::createInode(InodeIdentifier parentInode, const String& name, Unix::mode_t mode, unsigned size) { (void) parentInode; (void) name; @@ -112,7 +112,7 @@ bool SyntheticFileSystem::writeInode(InodeIdentifier, const ByteBuffer&) return false; } -ssize_t SyntheticFileSystem::readInodeBytes(InodeIdentifier inode, Unix::off_t offset, Unix::size_t count, byte* buffer) const +Unix::ssize_t SyntheticFileSystem::readInodeBytes(InodeIdentifier inode, Unix::off_t offset, Unix::size_t count, byte* buffer) const { ASSERT(inode.fileSystemID() == id()); #ifdef SYNTHFS_DEBUG @@ -124,7 +124,13 @@ ssize_t SyntheticFileSystem::readInodeBytes(InodeIdentifier inode, Unix::off_t o ASSERT(buffer); auto& file = *m_files[inode.index() - 1]; - Unix::ssize_t nread = min(file.data.size() - offset, static_cast<Unix::off_t>(count)); + Unix::ssize_t nread = min(static_cast<Unix::off_t>(file.data.size() - offset), static_cast<Unix::off_t>(count)); memcpy(buffer, file.data.pointer() + offset, nread); return nread; } + +InodeIdentifier SyntheticFileSystem::makeDirectory(InodeIdentifier parentInode, const String& name, Unix::mode_t) +{ + printf("FIXME: Implement SyntheticFileSystem::makeDirectory().\n"); + return { }; +} |