aboutsummaryrefslogtreecommitdiff
path: root/src/target/ext/auxv.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/target/ext/auxv.rs')
-rw-r--r--src/target/ext/auxv.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/target/ext/auxv.rs b/src/target/ext/auxv.rs
new file mode 100644
index 0000000..c801af2
--- /dev/null
+++ b/src/target/ext/auxv.rs
@@ -0,0 +1,16 @@
+//! Access the target’s auxiliary vector.
+use crate::target::{Target, TargetResult};
+
+/// Target Extension - Access the target’s auxiliary vector.
+pub trait Auxv: Target {
+ /// Get auxiliary vector from the target.
+ ///
+ /// Return the number of bytes written into `buf` (which may be less than
+ /// `length`).
+ ///
+ /// If `offset` is greater than the length of the underlying data, return
+ /// `Ok(0)`.
+ fn get_auxv(&self, offset: u64, length: usize, buf: &mut [u8]) -> TargetResult<usize, Self>;
+}
+
+define_ext!(AuxvOps, Auxv);