Fix compilation on {Net,Open}BSD, OpenIndiana etc.