I would like to retrieve the path of a file descriptor that I receive in a kernel extension (obtained from write_args->fd
from SYS_write
syscall) in OSX 10.10 (while preferably remaining compatible with OSX 10.6), like this on Linux. I have tried:
char filePath[PATH_MAX];
if (fcntl(wa->fd, F_GETPATH, filePath) != -1) {
return filePath;
}
But fcntl
is apparently not available from kernel space. Same holds for fd_lookup
.
Any help is appreciated!