summaryrefslogtreecommitdiff
path: root/lib/libutil/uucplock.3
diff options
context:
space:
mode:
authorbrian <brian@cvs.openbsd.org>1998-06-08 20:28:31 +0000
committerbrian <brian@cvs.openbsd.org>1998-06-08 20:28:31 +0000
commitbdff9cf05810fe6a150dbf8a9b415458d2e5a27b (patch)
tree35efe397763b557676c6a5136b7e80fc2ec0eb2c /lib/libutil/uucplock.3
parent1899d502b989476279392c9466872c58a23e8bfe (diff)
Add uu_lock_txfr() for donating locks to another process.
Reviewed by: Theo
Diffstat (limited to 'lib/libutil/uucplock.3')
-rw-r--r--lib/libutil/uucplock.325
1 files changed, 23 insertions, 2 deletions
diff --git a/lib/libutil/uucplock.3 b/lib/libutil/uucplock.3
index 40eeab60847..5bb1fa51e08 100644
--- a/lib/libutil/uucplock.3
+++ b/lib/libutil/uucplock.3
@@ -21,7 +21,7 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.\" $Id: uucplock.3,v 1.1 1997/11/09 00:29:14 bri Exp $
+.\" $Id: uucplock.3,v 1.2 1998/06/08 20:28:29 brian Exp $
.\" "
.Dd March 30, 1997
.Os
@@ -37,6 +37,8 @@
.Ft int
.Fn uu_lock "const char *ttyname"
.Ft int
+.Fn uu_lock_txfr "const char *ttyname" "pid_t pid"
+.Ft int
.Fn uu_unlock "const char *ttyname"
.Ft const char *
.Fn uu_lockerr "int uu_lockresult"
@@ -61,6 +63,11 @@ the process id found in the lock file is no longer running,
.Fn uu_lock
will write its own process id into the file and return success.
.Pp
+.Fn uu_lock_txfr
+transfers lock ownership to another process.
+.Fn uu_lock
+must have previously been successful.
+.Pp
.Fn uu_unlock
removes the lockfile created by
.Fn uu_lock
@@ -128,10 +135,24 @@ to be changed between calls to
.Fn uu_lock
and
.Fn uu_lockerr .
+.Pp
+.Fn uu_lock_txfr
+may return any of the following values:
+.Pp
+.Dv UU_LOCK_OK:
+The transfer was successful. The specified process now holds the device
+lock.
+.Pp
+.Dv UU_LOCK_OWNER_ERR:
+The current process does not already own a lock on the specified device.
+.Pp
+.Dv UU_LOCK_WRITE_ERR:
+The new process id could not be written to the lock file via a call to
+.Xr write 2 .
.Sh ERRORS
If
.Fn uu_lock
-returns one of the four error values above, the global value
+returns one of the error values above, the global value
.Va errno
can be used to determine the cause. Refer to the respective manual pages
for further details.