diff options
| author | Orfeas <38209077+0xfea5@users.noreply.github.com> | 2024-04-16 00:19:57 +0300 |
|---|---|---|
| committer | Orfeas <38209077+0xfea5@users.noreply.github.com> | 2024-04-16 00:26:01 +0300 |
| commit | 5369407082db53b68a1100e7b5391a1e9c36e621 (patch) | |
| tree | 7a54bcf8d0c7b1737a65201a09fa7e06f1a4a8c0 /src/util.c | |
| parent | Attaching & Detaching from process (diff) | |
| download | linux-game-trainer-5369407082db53b68a1100e7b5391a1e9c36e621.tar.gz linux-game-trainer-5369407082db53b68a1100e7b5391a1e9c36e621.zip | |
Parse /proc/pid/maps
Diffstat (limited to 'src/util.c')
| -rw-r--r-- | src/util.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/util.c b/src/util.c new file mode 100644 index 0000000..11796ce --- /dev/null +++ b/src/util.c | |||
| @@ -0,0 +1,15 @@ | |||
| 1 | #include <stdio.h> | ||
| 2 | #include <string.h> | ||
| 3 | #include <stdlib.h> | ||
| 4 | #include "util.h" | ||
| 5 | |||
| 6 | void* xmalloc(size_t size) | ||
| 7 | { | ||
| 8 | void *block = malloc(size); | ||
| 9 | if (!block) { | ||
| 10 | perror("malloc"); | ||
| 11 | exit(1); | ||
| 12 | } | ||
| 13 | memset(block, 0, size); | ||
| 14 | return block; | ||
| 15 | } | ||
