Skip to content

Commit ce0d97e

Browse files
authored
Linux on loongarch64 has no open syscall so use openat (#751)
1 parent 4e817b8 commit ce0d97e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/backend/libc/fs/syscalls.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,12 @@ weak!(fn __futimens64(c::c_int, *const LibcTimespec) -> c::c_int);
8484
/// This is only currently necessary as a workaround for old glibc; see below.
8585
#[cfg(all(unix, target_env = "gnu"))]
8686
fn open_via_syscall(path: &CStr, oflags: OFlags, mode: Mode) -> io::Result<OwnedFd> {
87-
// Linux on aarch64 and riscv64 has no `open` syscall so use `openat`.
87+
// Linux on aarch64, loongarch64 and riscv64 has no `open` syscall so use `openat`.
8888
#[cfg(any(
8989
target_arch = "aarch64",
9090
target_arch = "riscv32",
91-
target_arch = "riscv64"
91+
target_arch = "riscv64",
92+
target_arch = "loongarch64"
9293
))]
9394
{
9495
openat_via_syscall(CWD, path, oflags, mode)
@@ -98,7 +99,8 @@ fn open_via_syscall(path: &CStr, oflags: OFlags, mode: Mode) -> io::Result<Owned
9899
#[cfg(not(any(
99100
target_arch = "aarch64",
100101
target_arch = "riscv32",
101-
target_arch = "riscv64"
102+
target_arch = "riscv64",
103+
target_arch = "loongarch64"
102104
)))]
103105
unsafe {
104106
syscall! {

0 commit comments

Comments
 (0)