MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / watcher_test_self_image

Function watcher_test_self_image

tests/test_watcher.c:1028–1044  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1026}
1027
1028static bool watcher_test_self_image(char out[CBM_SZ_4K]) {
1029#ifdef __APPLE__
1030 int length = proc_pidpath(getpid(), out, CBM_SZ_4K);
1031 if (length <= 0 || length >= CBM_SZ_4K) {
1032 return false;
1033 }
1034 out[length] = '\0';
1035 return true;
1036#else
1037 ssize_t length = readlink("/proc/self/exe", out, CBM_SZ_4K - 1);
1038 if (length <= 0 || length >= CBM_SZ_4K - 1) {
1039 return false;
1040 }
1041 out[length] = '\0';
1042 return true;
1043#endif
1044}
1045
1046static bool watcher_test_wait_pid(const char *marker, uint64_t deadline_ms, pid_t *pid_out) {
1047 while (cbm_now_ms() < deadline_ms) {

Callers 1

test_watcher.cFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected