Get memory regions as string
This commit is contained in:
14
src/memory.c
14
src/memory.c
@@ -1,14 +1,18 @@
|
||||
#include "memory.h"
|
||||
|
||||
#include "logger.h"
|
||||
#include "files.h"
|
||||
#include "logger.h"
|
||||
#include "types.h"
|
||||
|
||||
static
|
||||
str read_memory_maps_self() {
|
||||
str memory_str = str_null;
|
||||
str memory_str = str_null;
|
||||
|
||||
HiloadResult res = read_file_to_str(&memory_str, "/proc/self/maps");
|
||||
sc_log_debug("Memory Map (/proc/self/maps):\n%s\n", str_ptr(memory_str));
|
||||
HiloadResult res = read_stream_to_str(&memory_str, "/proc/self/maps");
|
||||
if (res == HILOAD_FAIL)
|
||||
return str_null;
|
||||
|
||||
return memory_str;
|
||||
sc_log_debug("Memory Map\n-- /proc/self/maps:\n%s\n", str_ptr(memory_str));
|
||||
|
||||
return memory_str;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user