it's taken from this blog post http://www.perkin.org.uk/posts/solaris-portability-flock.html I think we need to contact the author, but i don't think wouldn't mind including it as he wishes for this code to be included in illumos