title: Detecting a chroot jail from within
body: <p>How can one detect being in a chroot jail without root privileges?  Assume a standard BSD or Linux system.  The best I came up with was to look at the inode value for "/" and to consider whether it is reasonably low, but I would like a more accurate method for detection.</p>
  
  <p><code>[edit 20080916 142430 EST]</code> Simply looking around the filesystem isn't sufficient, as it's not difficult to duplicate things like /boot and /dev to fool the jailed user.</p>
  
  <p><code>[edit 20080916 142950 EST]</code> For Linux systems, checking for unexpected values within /proc is reasonable, but what about systems that don't support /proc in the first place?</p>