最近在看FreeBSD源码,发现一个这样的问题。
例如这个函数:
int
kern_openat(struct thread *td, int fd, char *path, enum uio_seg pathseg,
int flags, int mode)
在接受用户层数据时,char* path是相对路径。
如果无法转换为绝对路径的话,按理说是无法操作文件对象的。
但是我一直找不到FreeBSD内核在哪里将相对路径转换为绝对路径使用,求熟悉内核的大大指点一二。
最近在看FreeBSD源码,发现一个这样的问题。
例如这个函数:
int
kern_openat(struct thread *td, int fd, char *path, enum uio_seg pathseg,
int flags, int mode)
在接受用户层数据时,char* path是相对路径。
如果无法转换为绝对路径的话,按理说是无法操作文件对象的。
但是我一直找不到FreeBSD内核在哪里将相对路径转换为绝对路径使用,求熟悉内核的大大指点一二。