FD to pathname
Open
enhancement
- Dominant language
- C
- Stars
- 22.7k
- Forks
- 4.1k
- Avg merge
- 10d 4h
- Merged PRs (30d)
- 3
Description
Would like a macro or function for mapping a file descriptor to a pathname. I was trying something like (this may be wrong):
``` C
#include
#include
#include
int kprobe__vfs_fstat(struct pt_regs *ctx, unsigned int fd)
{
struct file *file = (struct file *)¤t->files->fdt[fd];
bpf_trace_printk("fstat file %d %s\\n", fd, file->f_path.dentry->d_iname);
return 0;
}
```
and got:
``` Shell
error: couldn't allocate output register for constraint 'r' at line 2148418561
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.