Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX Reference > L

lckpwdf(3C)

HP-UX 11i Version 3: February 2007
» 

Technical documentation

» Feedback
Content starts here

 » Table of Contents

 » Index

NAME

lckpwdf(), ulckpwdf() — control access to the /etc/passwd and /etc/shadow files

SYNOPSIS

#include <shadow.h>

int lckpwdf (void)

int ulckpwdf (void)

DESCRIPTION

The lckpwdf() and ulckpwdf() routines are used to coordinate modification access to the password file /etc/passwd and to the shadow password file /etc/shadow. The lock file used by these two routines is /etc/.pwd.lock. A process first calls lckpwdf() to gain exclusive access rights for modification. When modifications are complete, ulckpwdf() is called to release the lock on /etc/.pwd.lock. This mechanism prevents simultaneous modification of the files.

RETURN VALUE

The lckpwdf() routine returns zero upon successful completion. If the lock could not be obtained, it returns -1 and sets errno to indicate the error.

The ulckpwdf() routine returns zero upon successful completion. If the lock has already been released, ulckpwdf() returns -1 and sets errno to indicate the error.

FILES

/etc/passwd /etc/shadow /etc/.pwd.lock

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1983-2007 Hewlett-Packard Development Company, L.P.