Skip to content

Commit dc4ca4d

Browse files
committed
Adds strlen
1 parent b6c1d97 commit dc4ca4d

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

kernel-1100/src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,9 @@ impl okf::Kernel for Kernel {
185185
unsafe fn solisten(self, so: *mut Self::Socket, backlog: c_int, td: *mut Self::Thread)
186186
-> c_int;
187187

188+
#[offset(0x21DC40)]
189+
unsafe fn strlen(self, s: *const c_char) -> usize;
190+
188191
#[offset(0x37BAF0)]
189192
unsafe fn vfs_busy(self, mp: *mut Self::Mount, flags: c_int) -> c_int;
190193

src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,10 @@ pub trait Kernel: MappedKernel {
234234
unsafe fn solisten(self, so: *mut Self::Socket, backlog: c_int, td: *mut Self::Thread)
235235
-> c_int;
236236

237+
/// # Safety
238+
/// `s` cannot be null and must point to a null-terminated string.
239+
unsafe fn strlen(self, s: *const c_char) -> usize;
240+
237241
/// # Safety
238242
/// `mp` cannot be null.
239243
unsafe fn vfs_busy(self, mp: *mut Self::Mount, flags: c_int) -> c_int;

0 commit comments

Comments
 (0)