Assuming your process doesn't drop its root privileges, before you do
the initial chroot() you could do:
old_root = open("/", O_RDONLY);
Then later do
fchdir(oldroot);
chroot(".");
But the cleaner and more portable solution is probably to have a child
process executing inside the chroot, and have its parent eject the CD
when the child exists.
Paul
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/