move flock to shared bsd code, pass correct constants