icon Top 9 categories map      RocketAware > man pages >

pw_lock(3)

Tips: Browse or Search all pages for efficient awareness of more than 6000 of the most popular reusable and open source applications, functions, libraries, and FAQs.


The "RKT couplings" below include links to source code, updates, additional information, advice, FAQs, and overviews.


Home

Search all pages


Subjects

By activity
Professions, Sciences, Humanities, Business, ...

User Interface
Text-based, GUI, Audio, Video, Keyboards, Mouse, Images,...

Text Strings
Conversions, tests, processing, manipulation,...

Math
Integer, Floating point, Matrix, Statistics, Boolean, ...

Processing
Algorithms, Memory, Process control, Debugging, ...

Stored Data
Data storage, Integrity, Encryption, Compression, ...

Communications
Networks, protocols, Interprocess, Remote, Client Server, ...

Hard World
Timing, Calendar and Clock, Audio, Video, Printer, Controls...

File System
Management, Filtering, File & Directory access, Viewers, ...

    

RocketLink!--> Man page versions: OpenBSD



PW_LOCK(3)                OpenBSD Programmer's Manual               PW_LOCK(3)

NAME
     pw_lock, pw_mkdb, pw_abort - passwd file update functions



SYNOPSIS
     #include <util.h>

     int
     pw_lock(int retries);

     int
     pw_mkdb();

     void
     pw_abort();

DESCRIPTION
     The pw_lock(), pw_mkdb(), and pw_abort() functions allow a program to up-
     date the system passwd database.

     The pw_lock() function attempts to lock the passwd database by creating
     the file /etc/ptmp with an exclusive lock (using flock(2) semantics) and
     returns the file descriptor of that file.  If retries is greater than ze-
     ro, pw_lock() will try multiple times to open /etc/ptmp, waiting one sec-
     ond between tries.  In addition to being a lock file, /etc/ptmp will also
     hold the contents of the new passwd file.

     The pw_mkdb() function updates the passwd file from the contents of
     /etc/ptmp. You should finish writing to and close the file descriptor re-
     turned by pw_lock() before calling pw_mkdb().  If pw_mkdb() fails and you
     do not wish to retry, you should make sure to call pw_abort() to clean up
     the lock file.

     The pw_abort() function aborts a passwd file update by deleting
     /etc/ptmp. The passwd database remains unchanged.

RETURN VALUES
     The pw_lock() and pw_mkdb() functions return -1 if they are unable to
     complete properly.

FILES
     /etc/master.passwd
     /etc/ptmp

SEE ALSO
     flock(2),  pw_init(3)

OpenBSD 2.6                    December 15, 1995                             1

Source: OpenBSD 2.6 man pages. Copyright: Portions are copyrighted by BERKELEY
SOFTWARE DESIGN, INC., The Regents of the University of California, Massachusetts
Institute of Technology, Free Software Foundation, FreeBSD Inc., and others.



(Corrections, notes, and links courtesy of RocketAware.com)


[Detailed Topics]
OpenBSD sources for pw_lock(3)


[Overview Topics]

Up to: Process Limits: Identity - Process ownership and Identity


RocketLink!--> Man page versions: OpenBSD






Rapid-Links: Search | About | Comments | Submit Path: RocketAware > man pages > pw_lock.3/
RocketAware.com is a service of Mib Software
Copyright 1999, Forrest J. Cavalier III. All Rights Reserved.
We welcome submissions and comments