[patch][jail] fstat according to specified jid

I’ve made top with jail id support. I start to think adding similar functions to other programs.

fstat is the victim. I decide to let fstat can accept jid and then display active files according to the specified jid.

Here comes the patch.

To apply this patch, you must rebuild your kernel.

% cd /usr/src; patch < patch_fstat_jid
% make kernel
...reboot with new kernel
% cd /usr/src/lib/libkvm; make clean install clean
% cd /usr/src/usr.bin/fstat; make clean install clean
... to make other program sync
% cp -f /usr/src/sys/sys/sysctl.h /usr/include/sys/

If you see any error appear, please inform me :)

How to use?

% fstat -j

NOTE, this patch will be send-pr-ed sooner or later. But I need your test first. :)

UPDATE 2006/06/12: Thanks to Roberto Lima for ‘cp -f /usr/src/sys/sys/sysctl.h /usr/include/sys/’ :)
UPDATE 2006/06/30: pr is here.

3 Responses to “[patch][jail] fstat according to specified jid”

Leave a Reply

It sounds like SK2 has recently been updated on this blog. But not fully configured. You MUST visit Spam Karma's admin page at least once before letting it filter your comments (chaos may ensue otherwise).