getCWD in kernel space

Roman Divacky rdivacky at freebsd.org
Sat Jun 30 18:13:17 UTC 2007


On Sat, Jun 30, 2007 at 03:24:17PM +0000, Eren Erdemli wrote:
> Hello hackers,
> 
> Sorry to disturb you's but I have a question and would like to know if you
> can assist me.
> 
> I am new to freebsd programing and I am trying to get the current working
> directory of  the curthread.
> 
> I have hook on to the sys calls and redirected the mkdir
> 
> my_mkdir(struct thread *p, (void*) uap)
> {
>   mkdir_args = .....................
>   ........
>  getCWD()???????????
> }


curthread->td_proc->p_fd->fd_cdir is a vnode of cwd


More information about the freebsd-hackers mailing list