From 2b55e1d9727e930e8db1049d18d44bd8b370fb91 Mon Sep 17 00:00:00 2001 From: Matthew Leach Date: Wed, 14 Jan 2026 21:02:11 +0000 Subject: [PATCH] sycalls: name_to_handle_at: stub Return EOPNOTSUPP for `sys_name_to_handle_at`. --- etc/syscalls_linux_aarch64.md | 2 +- libkernel/src/error.rs | 3 +++ libkernel/src/error/syscall_error.rs | 2 ++ src/arch/arm64/exceptions/syscall.rs | 2 ++ src/fs/syscalls/at/handle.rs | 5 +++++ src/fs/syscalls/at/mod.rs | 1 + 6 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 src/fs/syscalls/at/handle.rs diff --git a/etc/syscalls_linux_aarch64.md b/etc/syscalls_linux_aarch64.md index 59d0420..03ecaa4 100644 --- a/etc/syscalls_linux_aarch64.md +++ b/etc/syscalls_linux_aarch64.md @@ -248,7 +248,7 @@ | 0x105 (261) | prlimit64 | (pid_t pid, unsigned int resource, const struct rlimit64 *new_rlim, struct rlimit64 *old_rlim) | __arm64_sys_prlimit64 | true | | 0x106 (262) | fanotify_init | (unsigned int flags, unsigned int event_f_flags) | __arm64_sys_fanotify_init | false | | 0x107 (263) | fanotify_mark | (int fanotify_fd, unsigned int flags, __u64 mask, int dfd, const char *pathname) | __arm64_sys_fanotify_mark | false | -| 0x108 (264) | name_to_handle_at | (int dfd, const char *name, struct file_handle *handle, void *mnt_id, int flag) | __arm64_sys_name_to_handle_at | false | +| 0x108 (264) | name_to_handle_at | (int dfd, const char *name, struct file_handle *handle, void *mnt_id, int flag) | __arm64_sys_name_to_handle_at | strub | | 0x109 (265) | open_by_handle_at | (int mountdirfd, struct file_handle *handle, int flags) | __arm64_sys_open_by_handle_at | false | | 0x10a (266) | clock_adjtime | (const clockid_t which_clock, struct __kernel_timex *utx) | __arm64_sys_clock_adjtime | false | | 0x10b (267) | syncfs | (int fd) | __arm64_sys_syncfs | true | diff --git a/libkernel/src/error.rs b/libkernel/src/error.rs index c706f0c..3e62a64 100644 --- a/libkernel/src/error.rs +++ b/libkernel/src/error.rs @@ -189,6 +189,9 @@ pub enum KernelError { #[error("Value out of range")] RangeError, + #[error("Operation not supported on transport endpoint")] + OpNotSupported, + #[error("{0}")] Other(&'static str), } diff --git a/libkernel/src/error/syscall_error.rs b/libkernel/src/error/syscall_error.rs index 4f31fe1..138deab 100644 --- a/libkernel/src/error/syscall_error.rs +++ b/libkernel/src/error/syscall_error.rs @@ -38,6 +38,7 @@ pub const EDOM: isize = -33; pub const ERANGE: isize = -34; pub const EWOULDBLOCK: isize = -EAGAIN; pub const ENOSYS: isize = -38; +pub const EOPNOTSUPP: isize = -95; pub const ETIMEDOUT: isize = -110; pub fn kern_err_to_syscall(err: KernelError) -> isize { @@ -55,6 +56,7 @@ pub fn kern_err_to_syscall(err: KernelError) -> isize { KernelError::TimedOut => ETIMEDOUT, KernelError::RangeError => ERANGE, KernelError::NoChildProcess => ECHILD, + KernelError::OpNotSupported => EOPNOTSUPP, e => todo!("{e}"), } } diff --git a/src/arch/arm64/exceptions/syscall.rs b/src/arch/arm64/exceptions/syscall.rs index 2abcc70..daefdea 100644 --- a/src/arch/arm64/exceptions/syscall.rs +++ b/src/arch/arm64/exceptions/syscall.rs @@ -9,6 +9,7 @@ use crate::{ access::{sys_faccessat, sys_faccessat2}, chmod::sys_fchmodat, chown::sys_fchownat, + handle::sys_name_to_handle_at, link::sys_linkat, mkdir::sys_mkdirat, open::sys_openat, @@ -524,6 +525,7 @@ pub async fn handle_syscall() { ) .await } + 0x108 => sys_name_to_handle_at(), 0x10b => sys_syncfs(arg1.into()).await, 0x10e => { sys_process_vm_readv( diff --git a/src/fs/syscalls/at/handle.rs b/src/fs/syscalls/at/handle.rs new file mode 100644 index 0000000..6524bd6 --- /dev/null +++ b/src/fs/syscalls/at/handle.rs @@ -0,0 +1,5 @@ +use libkernel::error::{KernelError, Result}; + +pub fn sys_name_to_handle_at() -> Result { + Err(KernelError::OpNotSupported) +} diff --git a/src/fs/syscalls/at/mod.rs b/src/fs/syscalls/at/mod.rs index 5fcc74d..1303406 100644 --- a/src/fs/syscalls/at/mod.rs +++ b/src/fs/syscalls/at/mod.rs @@ -12,6 +12,7 @@ use libkernel::{ pub mod access; pub mod chmod; pub mod chown; +pub mod handle; pub mod link; pub mod mkdir; pub mod open;