summaryrefslogtreecommitdiff
path: root/Kernel/ProcessTracer.cpp
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-04-28 15:02:55 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-04-28 15:02:55 +0200
commite886337a67484516b4393a6ddcf7f8c3bc7bdc23 (patch)
tree21273233b0349ea6bea817938ea18b501a77b74a /Kernel/ProcessTracer.cpp
parent7ec1f6ab3c4ea71d51757ce689a6b4a991b121a0 (diff)
downloadserenity-e886337a67484516b4393a6ddcf7f8c3bc7bdc23.zip
Kernel: Make ProcessTracer inherit from File.
Diffstat (limited to 'Kernel/ProcessTracer.cpp')
-rw-r--r--Kernel/ProcessTracer.cpp22
1 files changed, 13 insertions, 9 deletions
diff --git a/Kernel/ProcessTracer.cpp b/Kernel/ProcessTracer.cpp
index b15763d632..30889a121d 100644
--- a/Kernel/ProcessTracer.cpp
+++ b/Kernel/ProcessTracer.cpp
@@ -18,14 +18,18 @@ void ProcessTracer::did_syscall(dword function, dword arg1, dword arg2, dword ar
m_calls.enqueue(data);
}
-int ProcessTracer::read(byte* buffer, int buffer_size)
+int ProcessTracer::read(Process&, byte* buffer, int buffer_size)
{
- if (!m_calls.is_empty()) {
- auto data = m_calls.dequeue();
- // FIXME: This should not be an assertion.
- ASSERT(buffer_size == sizeof(data));
- memcpy(buffer, &data, sizeof(data));
- return sizeof(data);
- }
- return 0;
+ if (m_calls.is_empty())
+ return 0;
+ auto data = m_calls.dequeue();
+ // FIXME: This should not be an assertion.
+ ASSERT(buffer_size == sizeof(data));
+ memcpy(buffer, &data, sizeof(data));
+ return sizeof(data);
+}
+
+String ProcessTracer::absolute_path() const
+{
+ return String::format("tracer:%d", m_pid);
}