macro_rules! ld_preload_function { (unsafe fn $realname:ident($($paramname:ident : $paramtype:ty),*) -> $ret:ty => $customname:ident $block:block) => { ... }; }
Expand description
Allows to overwrite functions which are defined within C.
Example (fakeroot):
use libc::uid_t;
ld_preload_function! {
unsafe fn getuid() -> uid_t => root_user_id {
0
}
}