Hi Sam, Thank you very much for your reply! On Tue, Sep 8, 2015 at 12:41 PM, Sam Edge wrote: > Erm ... slight technical hitch? Your example flock.c doesn't call > fork(), nor does it use your two macros MAX_ITER & CHILDREN. Good question. This problem was originally found when running autom4te on Wine. In autom4te-2.69, we have: 68 my $flock_implemented = 'yes'; 982 $icache_file = new Autom4te::XFile $icache, O_RDWR|O_CREAT; 983 $icache_file->lock (LOCK_EX) 984 if ($flock_implemented eq "yes"); This cause problem on Wine on some machine, while it works fine on some other machine. After tracking down, I successfully reproduce the problem with Cygwin using the attached test case stc-flock-fork-2.c, which is changed based on another test case from an old cygwin mailing list archive [1]. Later then, I found that even without fork(), we can still reproduce the same problem, Valgrind + Wine shows same warning either with or without fork, so I simply the test case a bit further, that's why you didn't see fork in my test case. Thank for your comment, it's good to make things clearer to everybody. Any further comment is welcome! [1] https://www.cygwin.com/ml/cygwin/2011-08/txt00012.txt -- Regards, Qian Hong - http://www.winehq.org