diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-04-28 15:02:55 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-04-28 15:02:55 +0200 |
commit | e886337a67484516b4393a6ddcf7f8c3bc7bdc23 (patch) | |
tree | 21273233b0349ea6bea817938ea18b501a77b74a /Kernel/Devices/Device.h | |
parent | 7ec1f6ab3c4ea71d51757ce689a6b4a991b121a0 (diff) | |
download | serenity-e886337a67484516b4393a6ddcf7f8c3bc7bdc23.zip |
Kernel: Make ProcessTracer inherit from File.
Diffstat (limited to 'Kernel/Devices/Device.h')
-rw-r--r-- | Kernel/Devices/Device.h | 31 |
1 files changed, 5 insertions, 26 deletions
diff --git a/Kernel/Devices/Device.h b/Kernel/Devices/Device.h index 155c5adf85..14ca312234 100644 --- a/Kernel/Devices/Device.h +++ b/Kernel/Devices/Device.h @@ -33,42 +33,21 @@ // - Subclasses should take care to validate incoming addresses before dereferencing. // -#include <AK/Retainable.h> -#include <AK/Types.h> -#include <Kernel/FileSystem/FileDescriptor.h> +#include <Kernel/File.h> -class Process; - -class Device : public Retainable<Device> { +class Device : public File { public: - virtual ~Device(); - - InodeMetadata metadata() const { return { }; } - - virtual KResultOr<Retained<FileDescriptor>> open(int options); - virtual void close(); - - virtual bool can_read(Process&) const = 0; - virtual bool can_write(Process&) const = 0; - - virtual ssize_t read(Process&, byte*, ssize_t) = 0; - virtual ssize_t write(Process&, const byte*, ssize_t) = 0; + virtual ~Device() override; unsigned major() const { return m_major; } unsigned minor() const { return m_minor; } - virtual bool is_tty() const { return false; } - virtual bool is_master_pty() const { return false; } - - virtual int ioctl(Process&, unsigned request, unsigned arg); - - virtual const char* class_name() const = 0; + virtual String absolute_path() const override; uid_t uid() const { return m_uid; } uid_t gid() const { return m_gid; } - virtual bool is_block_device() const { return false; } - virtual bool is_character_device() const { return false; } + virtual bool is_device() const override { return true; } protected: Device(unsigned major, unsigned minor); |