Hello!
Is it possible to get the current/working directory (in string format) of user in kernel code? For example if the user executes some command that finally does something in kernel, is it possible to get the path where user was when he/she/it executed the command?
I already found constant named "AT_FDCWD". I think that references to current working directory using file descriptor, but I need it in string format (like /home/user).
Then I found function __getcwd(), but I think it didn't work because the charbuf it filled contained garbage. Also nothing in kernel code used it, so maybe it's meant to be called only from user code.
Is it possible to get the current/working directory (in string format) of user in kernel code? For example if the user executes some command that finally does something in kernel, is it possible to get the path where user was when he/she/it executed the command?
I already found constant named "AT_FDCWD". I think that references to current working directory using file descriptor, but I need it in string format (like /home/user).
Then I found function __getcwd(), but I think it didn't work because the charbuf it filled contained garbage. Also nothing in kernel code used it, so maybe it's meant to be called only from user code.