Add dirfd

This commit is contained in:
Jeremy Soller
2020-12-23 19:47:44 -07:00
parent 928b18b306
commit d1ee653b5c
+5
View File
@@ -68,6 +68,11 @@ pub unsafe extern "C" fn closedir(dir: *mut DIR) -> c_int {
ret
}
#[no_mangle]
pub unsafe extern "C" fn dirfd(dir: *mut DIR) -> c_int {
*((*dir).file)
}
#[no_mangle]
pub unsafe extern "C" fn readdir(dir: *mut DIR) -> *mut dirent {
if (*dir).index >= (*dir).len {