What is the best way for the process to determine that it runs in jail?

Yuri yuri at rawbw.com
Sun Jul 7 00:43:31 UTC 2019


I found online that it is possible to stat the root folder and find its 
inode number.

The inode number is 2 when the root is on UFS, and 4 if the root is on ZFS.

This looks pretty hackish to me. Is this reliable?

Is there a better/best way?


Thank you,

Yuri




More information about the freebsd-hackers mailing list