Implement lockf