Once upon a time, Alan Cox <alan@lxorguk.ukuu.org.uk> said:
I hate to get involved in this, but actually chroot() is no longer part
of SuS as of version 3.
For other Unix versions, both Tru64 (5.1B) and Solaris (9) chroot(2) man
pages also say the working directory is unaffected by chroot(). The
Solaris man page explicitly mentions using fchdir() to reset the root to
a previously opened directory however.
On Tru64 and Solaris, the chroot command does call chdir() after
chroot(), but that is a userspace thing.
-