Perl and File Locking

Warren Young
Wed Sep 25 14:39:00 GMT 2013

On 9/25/2013 02:24, wrote:
> "Your vendor has not defined Fcntl macro O_EXLOCK,"

O_EXLOCK is a BSD feature, and Cygwin tries to emulate Linux, not BSD.

Minimal testing tells me you can use Cygwin's nonstandard 
F_LCK_MANDATORY feature from Perl.  This script,, doesn't die:

     sysopen my $fh, "", 0600, O_RDONLY or die "sysopen: $!\n";
     fcntl $fh, 0x99, 1 or die "fcntl: $!\n";

Whether it actually does what you expect is a different question.

Problem reports:
Unsubscribe info:

More information about the Cygwin mailing list