Added flock_type patch for MacOS