Skip to content

Commit

Permalink
posix: Return EINVAL on seeking on a sysfs directory
Browse files Browse the repository at this point in the history
  • Loading branch information
Dennisbonke committed Oct 23, 2023
1 parent 6a0e246 commit f7a4f23
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions posix/subsystem/src/sysfs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@ void DirectoryFile::handleClose() {
_cancelServe.cancel();
}

// TODO: Verify that this is correct
async::result<frg::expected<Error, off_t>> DirectoryFile::seek(off_t, VfsSeek) {
co_return Error::illegalArguments;
}

// TODO: This iteration mechanism only works as long as _iter is not concurrently deleted.
async::result<ReadEntriesResult> DirectoryFile::readEntries() {
if(_iter != _node->_entries.end()) {
Expand Down
1 change: 1 addition & 0 deletions posix/subsystem/src/sysfs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ struct DirectoryFile final : File {

FutureMaybe<ReadEntriesResult> readEntries() override;
helix::BorrowedDescriptor getPassthroughLane() override;
async::result<frg::expected<Error, off_t>> seek(off_t offset, VfsSeek whence) override;

private:
// TODO: Remove this and extract it from the associatedLink().
Expand Down

0 comments on commit f7a4f23

Please sign in to comment.