I'm writing a LKM and need to find out where a specific symlink is pointing to. Basically I need the functionality of the syscall readlinkat
(or readlink
) but in kernel-space. Is there an easy way to do this?
Using readlinkat
directly is not working for me, I'm always getting EFAULT (I guess this is because my buffer is obviously in kernel memory space and not in user-space).