1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-12 02:30:30 +09:00

Add basic symlink support.

- sys$readlink + readlink()
- Add a /proc/PID/exe symlink to the process's executable.
- Print symlink contents in ls output.
- Some work on plumbing options into VFS::open().
This commit is contained in:
Andreas Kling 2018-10-28 14:11:51 +01:00
parent 1d4af51250
commit 97726862dd
Notes: sideshowbarker 2024-07-19 18:36:54 +09:00
20 changed files with 140 additions and 46 deletions

View file

@ -74,7 +74,8 @@ ByteBuffer FileSystem::readEntireInode(InodeIdentifier inode, FileHandle* handle
return nullptr;
}
auto contents = ByteBuffer::createUninitialized(metadata.size);
size_t initialSize = metadata.size ? metadata.size : 4096;
auto contents = ByteBuffer::createUninitialized(initialSize);
Unix::ssize_t nread;
byte buffer[512];
@ -87,6 +88,7 @@ ByteBuffer FileSystem::readEntireInode(InodeIdentifier inode, FileHandle* handle
memcpy(out, buffer, nread);
out += nread;
offset += nread;
ASSERT(offset <= initialSize); // FIXME: Support dynamically growing the buffer.
}
if (nread < 0) {
kprintf("[fs] readInode: ERROR: %d\n", nread);