The lckpwdf() and ulckpwdf() functions enable modification access to the password databases through the lock file. A process first uses lckpwdf() to lock the lock file, thereby gaining exclusive rights to modify the /etc/passwd or /etc/shadow password database. (See "passwd" and "shadow" man pages.)
Upon completing modifications, a process should release the lock on the lock file using ulckpwdf(). This mechanism prevents simultaneous modification of the password databases. The lock file, /etc/.pwd.lock, is used to coordinate modification access to the password databases /etc/passwd and /etc/shadow.