From cd10fce382ecab7bd8076d89a4a4377c2f3cc7d3 Mon Sep 17 00:00:00 2001 From: York Jasper Niebuhr Date: Sun, 26 Oct 2025 19:54:59 +0100 Subject: [PATCH] Changed selfpatch to be C --- selfpatch/CMakeLists.txt | 2 +- selfpatch/include/spslr.h | 6 ++++++ selfpatch/src/selfpatch.c | 6 ++++++ selfpatch/src/selfpatch.cpp | 0 subject/main.c | 4 ++++ 5 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 selfpatch/include/spslr.h create mode 100644 selfpatch/src/selfpatch.c delete mode 100644 selfpatch/src/selfpatch.cpp diff --git a/selfpatch/CMakeLists.txt b/selfpatch/CMakeLists.txt index 4771ad7..3bfe872 100644 --- a/selfpatch/CMakeLists.txt +++ b/selfpatch/CMakeLists.txt @@ -1,4 +1,4 @@ -add_library(spslr_selfpatch STATIC src/selfpatch.cpp) +add_library(spslr_selfpatch STATIC src/selfpatch.c) target_include_directories(spslr_selfpatch PUBLIC $ diff --git a/selfpatch/include/spslr.h b/selfpatch/include/spslr.h new file mode 100644 index 0000000..22068b3 --- /dev/null +++ b/selfpatch/include/spslr.h @@ -0,0 +1,6 @@ +#ifndef SPSLR_SELFPATCH_H +#define SPSLR_SELFPATCH_H + +void spslr_selfpatch(); + +#endif diff --git a/selfpatch/src/selfpatch.c b/selfpatch/src/selfpatch.c new file mode 100644 index 0000000..9d50fa7 --- /dev/null +++ b/selfpatch/src/selfpatch.c @@ -0,0 +1,6 @@ +#include +#include + +void spslr_selfpatch() { + printf("SPSLR -> selfpatch()\n"); +} diff --git a/selfpatch/src/selfpatch.cpp b/selfpatch/src/selfpatch.cpp deleted file mode 100644 index e69de29..0000000 diff --git a/subject/main.c b/subject/main.c index 737d062..260ce9c 100644 --- a/subject/main.c +++ b/subject/main.c @@ -1,3 +1,5 @@ +#include + #include "task_struct.h" int second_pid(); @@ -7,6 +9,8 @@ struct task_struct global = { .pid = 42, .comm = "main_global" }; int main(void) { + spslr_selfpatch(); + struct list_head task_list; INIT_LIST_HEAD(&task_list);