Rewrote to use getcap(3) routines.