This diff aims to add a jailname and jid builtin variables to support a stable API to get access to jail details. Currently, tracing jails is possible via use of another builtin variable, curthread, but this change makes it more reliable and easier to write scripts across FreeBSD versions.
zonename was also now added to FreeBSD and it simply falls through to jailname as a compatibility mechanism. The version for the variables is 1.13, as suggested by markj@.
Sponsored by: DARPA, AFRL