pwd - Why is iget() hidden in xv6 -


I am playing a bit with a modern implementation of Unix version 6.

My first hack, I wanted to implement the simple getcwd syscall, but I am losing a bit for which I should use the intangible level.

  • Am I the structure file interface?
  • Or maybe the struct inode interface?
  • For the cases, it seems that it can be implemented purely in the US.

    I have started applying it with the struct input manipulator, my intuitive idea proc-> gt; cwd , then readi () was to get its second entry ( .. ), to scan it again to scan my previous inum , and so on until I hit not on the root.

    Not very demonstrative, but it will be fit for the first hack.

    My problem is though that to get me the inum from struct inode to fs.c: iget () Required dirent I have noticed that the iget () is in the stable fs.c and is not declared in defs.h , which makes me a bit upset, But why can not I find the reason.

    So, this is my question, why is iget () been deliberately hidden from the rest of the kernel?

    I think they were just practical.

    iget is used only by the Directory Heripulation routine. The Directory Heritable Routine is in FSC.

    For Getcwd implementation, it would be better if you followed the chdir syscall code. The path is you need to store it, possibly in a new area in proc architecture Of course, if the given path is relative, you should add it to the current stored path.

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -