title: Semantics of Linux O_PATH file descriptors?
body: <p>Linux 2.6.39 introduced <code>O_PATH</code> open mode, which (roughly speaking) doesn't really open the file at all (i.e. doesn't create an open file description), but just gives a file descriptor that's a handle to the unopened target. Its main use is as an argument to the <code>*at</code> functions (<code>openat</code>, etc.), and it seems to be suitable as an implementation of the POSIX 2008 <code>O_SEARCH</code> functionality which Linux was previously missing. However, I've been unable to find any good documentation on the exact semantics of <code>O_PATH</code>. A couple specific questions I have are:</p>
  
  <ol>
  <li>What operations are possible on Linux <code>O_PATH</code> file descriptors? (Only <code>*at</code> functions?)</li>
  <li>Is <code>O_PATH</code> ever useful with non-directories?</li>
  <li>How is the file descriptor bound to the underlying filesystem object, and what happens if it's moved, deleted, etc.? Does an <code>O_PATH</code> file descriptor count as a reference that prevents the object from being freed when the last link is unlinked? Etc.</li>
  </ol>