Skip to content

Commit e30a077

Browse files
test(glibc): diff revoke ENOSYS stub (bd-44prx8)
1 parent b5378de commit e30a077

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

crates/frankenlibc-abi/tests/conformance_diff_bsd_stubs.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ use std::ffi::{CString, c_char, c_int, c_ulong};
77

88
unsafe extern "C" {
99
fn chflags(path: *const c_char, flags: c_ulong) -> c_int;
10+
fn revoke(path: *const c_char) -> c_int;
1011
fn setlogin(name: *const c_char) -> c_int;
1112
}
1213

@@ -51,3 +52,18 @@ fn bsd_stubs_match_host_enosys_contract() {
5152
"setlogin ENOSYS contract"
5253
);
5354
}
55+
56+
#[test]
57+
fn revoke_matches_host_enosys_contract() {
58+
let path = CString::new("/nonexistent/frankenlibc-revoke").unwrap();
59+
clear_errnos();
60+
let host_result = unsafe { revoke(path.as_ptr()) };
61+
let host_result_errno = host_errno();
62+
clear_errnos();
63+
let fl_result = unsafe { fl::revoke(path.as_ptr()) };
64+
assert_eq!(
65+
(fl_result, fl_errno()),
66+
(host_result, host_result_errno),
67+
"revoke ENOSYS contract"
68+
);
69+
}

0 commit comments

Comments
 (0)