Or (if on openbsd), the pledge and unveil syscalls. Pretty similar effect, but much easier