make memset return u8

Signed-off-by: Quentin JEROME <qjerome@users.noreply.github.com>
pull/583/head
Quentin JEROME 2 years ago
parent 4e41da6a86
commit b0f999419e

@ -57,11 +57,12 @@ pub trait BpfContext {
} }
#[no_mangle] #[no_mangle]
pub unsafe extern "C" fn memset(s: *mut u8, c: c_int, n: usize) { pub unsafe extern "C" fn memset(s: *mut u8, c: c_int, n: usize) -> u8 {
let base = s as usize; let base = s as usize;
for i in 0..n { for i in 0..n {
*((base + i) as *mut u8) = c as u8; *((base + i) as *mut u8) = c as u8;
} }
0
} }
#[no_mangle] #[no_mangle]

Loading…
Cancel
Save