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/ProcessTracer.h | |
parent | 7ec1f6ab3c4ea71d51757ce689a6b4a991b121a0 (diff) | |
download | serenity-e886337a67484516b4393a6ddcf7f8c3bc7bdc23.zip |
Kernel: Make ProcessTracer inherit from File.
Diffstat (limited to 'Kernel/ProcessTracer.h')
-rw-r--r-- | Kernel/ProcessTracer.h | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/Kernel/ProcessTracer.h b/Kernel/ProcessTracer.h index d178fb123d..355d5512d1 100644 --- a/Kernel/ProcessTracer.h +++ b/Kernel/ProcessTracer.h @@ -1,25 +1,30 @@ #pragma once -#include <AK/Retainable.h> -#include <AK/Retained.h> +#include <Kernel/File.h> #include <AK/CircularQueue.h> #include <Kernel/UnixTypes.h> -class ProcessTracer : public Retainable<ProcessTracer> { +class ProcessTracer : public File { public: static Retained<ProcessTracer> create(pid_t pid) { return adopt(*new ProcessTracer(pid)); } - ~ProcessTracer(); + virtual ~ProcessTracer() override; bool is_dead() const { return m_dead; } void set_dead() { m_dead = true; } - bool can_read() const { return !m_calls.is_empty() || m_dead; } - int read(byte*, int); + virtual bool can_read(Process&) const override { return !m_calls.is_empty() || m_dead; } + virtual int read(Process&, byte*, int) override; + + virtual bool can_write(Process&) const override { return true; } + virtual int write(Process&, const byte*, int) override { return -EIO; } + + virtual String absolute_path() const override; void did_syscall(dword function, dword arg1, dword arg2, dword arg3, dword result); pid_t pid() const { return m_pid; } private: + virtual const char* class_name() const override { return "ProcessTracer"; } explicit ProcessTracer(pid_t); struct CallData { |