mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 23:47:45 +00:00
Kernel: Have File virtuals take a FileDescriptor& rather than a Process&.
This will allow us to implement different behaviors depending on the role of the descriptor a File is being accessed through.
This commit is contained in:
parent
3761bc3ed7
commit
8cbb7f101f
39 changed files with 156 additions and 155 deletions
|
@ -12,11 +12,11 @@ public:
|
|||
bool is_dead() const { return m_dead; }
|
||||
void set_dead() { m_dead = true; }
|
||||
|
||||
virtual bool can_read(Process&) const override { return !m_calls.is_empty() || m_dead; }
|
||||
virtual int read(Process&, byte*, int) override;
|
||||
virtual bool can_read(FileDescriptor&) const override { return !m_calls.is_empty() || m_dead; }
|
||||
virtual int read(FileDescriptor&, byte*, int) override;
|
||||
|
||||
virtual bool can_write(Process&) const override { return true; }
|
||||
virtual int write(Process&, const byte*, int) override { return -EIO; }
|
||||
virtual bool can_write(FileDescriptor&) const override { return true; }
|
||||
virtual int write(FileDescriptor&, const byte*, int) override { return -EIO; }
|
||||
|
||||
virtual String absolute_path() const override;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue