Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/omega-mv/blob/main/tests/kfd/fdtrace.c # omega-mv Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance. Brought by drakestapleton Sign in to star 1 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `omega-mv / tests / kfd / fdtrace.c` 88 lines ยท 3402 bytes Raw Blame History 1 /* Independent AArch64 syscall-boundary instrument; no AMD device is opened. 2 * A real memfd supplies mmap backing. Only stat metadata is synthetic. */ 3 #define _GNU_SOURCE 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 #include 11 #include 12 #include 13 #include 14 #include 15 #include 16 #include 17 #include 18 #include 19 20 static void die(const char *s) { perror(s); exit(90); } 21 static void poke(pid_t p, uint64_t a, const void *src, size_t n) { 22 const unsigned char *s=src; 23 for (size_t i=0;i=2) st.st_rdev=makedev(234,0); 76 if (call==SYS_newfstatat) st.st_rdev=makedev(234,0); 77 if (call==SYS_newfstatat && mode==3) st.st_rdev=makedev(234,1); 78 if (call==SYS_newfstatat && mode==4) st.st_mode=S_IFREG|0600; 79 if (call==SYS_fstat && mode==5) st.st_mode=S_IFREG|0600; 80 poke(p,buf,&st,sizeof st); 81 regs.regs[0]=0; 82 if (mode==6) regs.regs[0]=(uint64_t)-EBADF; 83 if (ptrace(PTRACE_SETREGSET,p,(void *)NT_PRSTATUS,&io)) die("setregs"); 84 stats++; 85 } 86 entering=!entering; 87 } 88 }