Skip to content

Commit 0617d58

Browse files
committed
refactor: remove macOS ≤ 13 fallback for mknodat/mkfifoat
macOS 13 and earlier are EOL. Use c::mknodat directly via libc without weak-linking, matching other platforms.
1 parent 47efde4 commit 0617d58

1 file changed

Lines changed: 0 additions & 31 deletions

File tree

src/backend/libc/fs/syscalls.rs

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1209,37 +1209,6 @@ pub(crate) fn mknodat(
12091209
mode: Mode,
12101210
dev: Dev,
12111211
) -> io::Result<()> {
1212-
// macOS ≤ 13 lacks `mknodat`.
1213-
#[cfg(target_os = "macos")]
1214-
unsafe {
1215-
weak! {
1216-
fn mknodat(
1217-
c::c_int,
1218-
*const ffi::c_char,
1219-
c::mode_t,
1220-
c::dev_t
1221-
) -> c::c_int
1222-
}
1223-
if let Some(libc_mknodat) = mknodat.get() {
1224-
return ret(libc_mknodat(
1225-
borrowed_fd(dirfd),
1226-
c_str(path),
1227-
(mode.bits() | file_type.as_raw_mode()) as c::mode_t,
1228-
dev.try_into().map_err(|_e| io::Errno::PERM)?,
1229-
));
1230-
}
1231-
// Otherwise, see if we can emulate the `AT_FDCWD` case.
1232-
if borrowed_fd(dirfd) != c::AT_FDCWD {
1233-
return Err(io::Errno::NOSYS);
1234-
}
1235-
ret(c::mknod(
1236-
c_str(path),
1237-
(mode.bits() | file_type.as_raw_mode()) as c::mode_t,
1238-
dev.try_into().map_err(|_e| io::Errno::PERM)?,
1239-
))
1240-
}
1241-
1242-
#[cfg(not(target_os = "macos"))]
12431212
unsafe {
12441213
ret(c::mknodat(
12451214
borrowed_fd(dirfd),

0 commit comments

Comments
 (0)