diff options
| author | raven <citrons@mondecitronne.com> | 2026-04-08 22:51:39 -0500 |
|---|---|---|
| committer | raven <citrons@mondecitronne.com> | 2026-04-08 22:51:39 -0500 |
| commit | 18a86e1038b20cb6f8922beead08dcc24ba2a4d3 (patch) | |
| tree | 85cb74210d67d42763a4709d18af93aa60a8f400 /src/procfs.h | |
| parent | 4a3429a96b5b5ea7468540349aeb4535d5738053 (diff) | |
rewrite and port to SDL3
Diffstat (limited to 'src/procfs.h')
| -rw-r--r-- | src/procfs.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/procfs.h b/src/procfs.h new file mode 100644 index 0000000..7196a24 --- /dev/null +++ b/src/procfs.h @@ -0,0 +1,27 @@ +#ifndef CORE_PROCFS_H +#define CORE_PROCFS_H + +#include <stdlib.h> +#include <stddef.h> +#include <sys/types.h> +#include <sys/mman.h> + +#ifndef PAGE_SIZE +#define PAGE_SIZE (4096) +#endif + +int procfs_open(pid_t pid); +int read_mem(int fd, uintptr_t addr, uint8_t *data, size_t size); +int write_mem(int fd, uintptr_t addr, uint8_t *data, size_t size); + +typedef struct procfs_map { + uintptr_t base; + uintptr_t max; + char name[1024]; + int prot; +} procfs_map; + +ssize_t procfs_maps(pid_t pid, struct procfs_map **maps); +char procfs_state(pid_t pid); + +#endif |
