1951 leaking a vdev when removing an l2cache device
[unleashed.git] / usr / src / man / man3c / lckpwdf.3c
blob49ebb3334ead49e5982089b0a4b7700c74b1adfd
1 '\" te
2 .\"  Copyright (c) 1997, Sun Microsystems, Inc. All Rights Reserved
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH LCKPWDF 3C "Dec 29, 1996"
7 .SH NAME
8 lckpwdf, ulckpwdf \- manipulate shadow password database lock file
9 .SH SYNOPSIS
10 .LP
11 .nf
12 #include <shadow.h>
14 \fBint\fR \fBlckpwdf\fR(\fBvoid\fR);
15 .fi
17 .LP
18 .nf
19 \fBint\fR \fBulckpwdf\fR(\fBvoid\fR);
20 .fi
22 .SH DESCRIPTION
23 .sp
24 .LP
25 The \fBlckpwdf()\fR and \fBulckpwdf()\fR functions enable modification access
26 to the password databases through the lock file. A process first uses
27 \fBlckpwdf()\fR to lock the lock file, thereby gaining exclusive rights to
28 modify the  \fB/etc/passwd\fR or  \fB/etc/shadow\fR password database.  See
29 \fBpasswd\fR(4) and \fBshadow\fR(4). Upon completing modifications, a process
30 should release the lock on the lock file using \fBulckpwdf()\fR. This mechanism
31 prevents simultaneous modification of the password databases. The lock file,
32 \fB/etc/.pwd.lock\fR, is used to coordinate modification access to the password
33 databases \fB/etc/passwd\fR and  \fB/etc/shadow\fR.
34 .SH RETURN VALUES
35 .sp
36 .LP
37 If \fBlckpwdf()\fR is successful in locking the file within 15 seconds, it
38 returns \fB0\fR. If unsuccessful (for example,  \fB/etc/.pwd.lock\fR is already
39 locked), it returns \fB\(mi1\fR\&.
40 .sp
41 .LP
42 If \fBulckpwdf()\fR is successful in unlocking the file  \fB/etc/.pwd.lock\fR,
43 it returns \fB0\fR. If unsuccessful (for example,  \fB/etc/.pwd.lock\fR is
44 already unlocked), it returns \fB\(mi1\fR\&.
45 .SH USAGE
46 .sp
47 .LP
48 These routines are for internal use only; compatibility is not guaranteed.
49 .SH FILES
50 .sp
51 .ne 2
52 .na
53 \fB\fB/etc/passwd\fR\fR
54 .ad
55 .RS 18n
56 password database
57 .RE
59 .sp
60 .ne 2
61 .na
62 \fB\fB/etc/shadow\fR\fR
63 .ad
64 .RS 18n
65 shadow password database
66 .RE
68 .sp
69 .ne 2
70 .na
71 \fB\fB/etc/.pwd.lock\fR\fR
72 .ad
73 .RS 18n
74 lock file
75 .RE
77 .SH ATTRIBUTES
78 .sp
79 .LP
80 See \fBattributes\fR(5) for descriptions of the following attributes:
81 .sp
83 .sp
84 .TS
85 box;
86 c | c
87 l | l .
88 ATTRIBUTE TYPE  ATTRIBUTE VALUE
90 MT-Level        MT-Safe
91 .TE
93 .SH SEE ALSO
94 .sp
95 .LP
96 \fBgetpwnam\fR(3C), \fBgetspnam\fR(3C), \fBpasswd\fR(4), \fBshadow\fR(4),
97 \fBattributes\fR(5)