Make cap_enter/cap_getmode proper functions