@@ -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 {