summaryrefslogtreecommitdiff
path: root/src/uio-address-rw.c
diff options
context:
space:
mode:
authorJari Vetoniemi <mailroxas@gmail.com>2018-10-21 16:23:23 +0300
committerJari Vetoniemi <mailroxas@gmail.com>2018-10-21 16:23:23 +0300
commit75f9922f6d3c1e5bbbe7b90ca170392cc0f5efbc (patch)
treed79e445e87ae9a55e146c6c3b46fef6f238d23e7 /src/uio-address-rw.c
parentd81411896f140981400e4fbf4aafacdbabad96cd (diff)
Refactor io utils, add *-address-rw tools
Namespace io_ stuff into mem_io_ to be less likely to collision with anything else. Add io-stream utility for working with streams instead of direct buffers. Add address-rw tools for simple memory read/write, where regions aren't needed.
Diffstat (limited to 'src/uio-address-rw.c')
-rw-r--r--src/uio-address-rw.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/uio-address-rw.c b/src/uio-address-rw.c
new file mode 100644
index 0000000..1606fa4
--- /dev/null
+++ b/src/uio-address-rw.c
@@ -0,0 +1,13 @@
+#include "cli/cli.h"
+#include "mem/io.h"
+
+// This address-rw uses uio
+// It needs recent kernel, but may be racy as it reads / writes while process is running.
+// Ideal for realtime memory tools.
+// It's recommended to `setcap cap_sys_ptrace=eip uio-region-rw` to run this tool without sudo
+
+int
+main(int argc, const char *argv[])
+{
+ return proc_address_rw(argc, argv, mem_io_uio_init);
+}