MCPcopy Create free account
hub / github.com/MJx0/KittyMemoryEx / init

Method init

KittyMemoryEx/KittyMemOp.cpp:73–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71/* =================== KittyMemSys =================== */
72
73bool KittyMemSys::init(pid_t pid)
74{
75 if (pid < 1)
76 {
77 _lastErrno = ESRCH;
78 KITTY_LOGE("KittyMemSys: Invalid PID.");
79 return false;
80 }
81
82 errno = 0;
83 ssize_t rt = syscall(syscall_rpmv_n, 0, 0, 0, 0, 0, 0);
84 if (rt == -1 && errno == ENOSYS)
85 {
86 _lastErrno = ENOSYS;
87 KITTY_LOGE("KittyMemSys: syscall readv/writev not supported.");
88 return false;
89 }
90
91 _pid = pid;
92 return true;
93}
94
95size_t KittyMemSys::Read(uintptr_t address, void *buffer, size_t len)
96{

Callers 2

initializeMethod · 0.45
dumpMemRangeMethod · 0.45

Calls 4

openMethod · 0.80
lastErrorMethod · 0.80
pathMethod · 0.80
lastStrErrorMethod · 0.80

Tested by

no test coverage detected