Can I get the file name from fd (file descriptor) passed by a syscall in kernel code?

Viewed 28

I doubt it but in the kernel code, can I get the file name for an fd(file descriptor) that was passed by a syscall?
In a situation, I get syscall from user space and in do_el0_svc(struct pt_regs *regs) function (arch/arm64/kernel/syscall.c, linux-5.10.0-rc5), I can print the fd value which is in x0. But can I know the file name from the fd value? The syscall list for arm64 is here with number and function, arguments.

0 Answers
Related