summaryrefslogtreecommitdiff
path: root/Kernel/Coredump.h
diff options
context:
space:
mode:
authorLiav A <liavalb@gmail.com>2022-11-26 14:42:35 +0200
committerAndrew Kaster <andrewdkaster@gmail.com>2022-12-03 05:56:59 -0700
commit0bb7c8f4c4757ed1f1abb77a46ba32e9cf72106d (patch)
tree08a3b6fe067b25f042f5bbeccd6460dc444c5211 /Kernel/Coredump.h
parent7dcf8f971b9caf7abe01691fcedce978844585e4 (diff)
downloadserenity-0bb7c8f4c4757ed1f1abb77a46ba32e9cf72106d.zip
Kernel+SystemServer: Don't hardcode coredump directory path
Instead, allow userspace to decide on the coredump directory path. By default, SystemServer sets it to the /tmp/coredump directory, but users can now change this by writing a new path to the sysfs node at /sys/kernel/variables/coredump_directory, and also to read this node to check where coredumps are currently generated at.
Diffstat (limited to 'Kernel/Coredump.h')
-rw-r--r--Kernel/Coredump.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/Kernel/Coredump.h b/Kernel/Coredump.h
index 89567da718..d1acea68d8 100644
--- a/Kernel/Coredump.h
+++ b/Kernel/Coredump.h
@@ -11,6 +11,7 @@
#include <AK/Vector.h>
#include <Kernel/Forward.h>
#include <Kernel/Library/NonnullLockRefPtr.h>
+#include <Kernel/Locking/SpinlockProtected.h>
#include <Kernel/Memory/Region.h>
namespace Kernel {
@@ -18,6 +19,7 @@ namespace Kernel {
class Coredump {
public:
static ErrorOr<NonnullOwnPtr<Coredump>> try_create(NonnullLockRefPtr<Process>, StringView output_path);
+ static SpinlockProtected<OwnPtr<KString>>& directory_path();
~Coredump() = default;
ErrorOr<void> write();