Implemented logwtmp(), lock() and unlock().