I think you're right that the pack is the problem and wanted to add that even a link to 's s l l l' working won't be useful since the lengths of the data types of a struct flock are not standard. Some systems use 64 bits for file offsets and those definitely won't work with 'l' in pack (which is always 32 bits), but 'q' might.