Changed selfpatch to be C

This commit is contained in:
York Jasper Niebuhr 2025-10-26 19:54:59 +01:00
parent 31d80c3783
commit cd10fce382
5 changed files with 17 additions and 1 deletions

View File

@ -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 target_include_directories(spslr_selfpatch PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>

View File

@ -0,0 +1,6 @@
#ifndef SPSLR_SELFPATCH_H
#define SPSLR_SELFPATCH_H
void spslr_selfpatch();
#endif

View File

@ -0,0 +1,6 @@
#include <spslr.h>
#include <stdio.h>
void spslr_selfpatch() {
printf("SPSLR -> selfpatch()\n");
}

View File

@ -1,3 +1,5 @@
#include <spslr.h>
#include "task_struct.h" #include "task_struct.h"
int second_pid(); int second_pid();
@ -7,6 +9,8 @@ struct task_struct global = { .pid = 42, .comm = "main_global" };
int main(void) int main(void)
{ {
spslr_selfpatch();
struct list_head task_list; struct list_head task_list;
INIT_LIST_HEAD(&task_list); INIT_LIST_HEAD(&task_list);