uucplock.3 (84306) | uucplock.3 (131504) |
---|---|
1.\" 2.\" Copyright (c) 1996 Brian Somers <brian@awfulhak.demon.co.uk> 3.\" 4.\" All rights reserved. 5.\" 6.\" Redistribution and use in source and binary forms, with or without 7.\" modification, are permitted provided that the following conditions 8.\" are met: --- 9 unchanged lines hidden (view full) --- 18.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, 19.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25.\" | 1.\" 2.\" Copyright (c) 1996 Brian Somers <brian@awfulhak.demon.co.uk> 3.\" 4.\" All rights reserved. 5.\" 6.\" Redistribution and use in source and binary forms, with or without 7.\" modification, are permitted provided that the following conditions 8.\" are met: --- 9 unchanged lines hidden (view full) --- 18.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, 19.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25.\" |
26.\" $FreeBSD: head/lib/libutil/uucplock.3 84306 2001-10-01 16:09:29Z ru $ | 26.\" $FreeBSD: head/lib/libutil/uucplock.3 131504 2004-07-02 23:52:20Z ru $ |
27.\" " 28.Dd March 30, 1997 29.Os 30.Dt UUCPLOCK 3 31.Sh NAME 32.Nm uu_lock , 33.Nm uu_unlock , 34.Nm uu_lockerr --- 87 unchanged lines hidden (view full) --- 122is passed to 123.Fn uu_lockerr , 124an empty string is returned. 125Otherwise, a string specifying 126the reason for failure is returned. 127.Fn uu_lockerr 128uses the current value of 129.Va errno | 27.\" " 28.Dd March 30, 1997 29.Os 30.Dt UUCPLOCK 3 31.Sh NAME 32.Nm uu_lock , 33.Nm uu_unlock , 34.Nm uu_lockerr --- 87 unchanged lines hidden (view full) --- 122is passed to 123.Fn uu_lockerr , 124an empty string is returned. 125Otherwise, a string specifying 126the reason for failure is returned. 127.Fn uu_lockerr 128uses the current value of 129.Va errno |
130to determine the exact error. Care should be made not to allow | 130to determine the exact error. 131Care should be made not to allow |
131.Va errno 132to be changed between calls to 133.Fn uu_lock 134and 135.Fn uu_lockerr . 136.Pp 137.Fn uu_lock_txfr 138may return any of the following values: 139.Pp 140.Dv UU_LOCK_OK : | 132.Va errno 133to be changed between calls to 134.Fn uu_lock 135and 136.Fn uu_lockerr . 137.Pp 138.Fn uu_lock_txfr 139may return any of the following values: 140.Pp 141.Dv UU_LOCK_OK : |
141The transfer was successful. The specified process now holds the device | 142The transfer was successful. 143The specified process now holds the device |
142lock. 143.Pp 144.Dv UU_LOCK_OWNER_ERR : 145The current process does not already own a lock on the specified device. 146.Pp 147.Dv UU_LOCK_WRITE_ERR : 148The new process id could not be written to the lock file via a call to 149.Xr write 2 . 150.Sh ERRORS 151If 152.Fn uu_lock 153returns one of the error values above, the global value 154.Va errno | 144lock. 145.Pp 146.Dv UU_LOCK_OWNER_ERR : 147The current process does not already own a lock on the specified device. 148.Pp 149.Dv UU_LOCK_WRITE_ERR : 150The new process id could not be written to the lock file via a call to 151.Xr write 2 . 152.Sh ERRORS 153If 154.Fn uu_lock 155returns one of the error values above, the global value 156.Va errno |
155can be used to determine the cause. Refer to the respective manual pages | 157can be used to determine the cause. 158Refer to the respective manual pages |
156for further details. 157.Pp 158.Fn uu_unlock 159will set the global variable 160.Va errno 161to reflect the reason that the lock file could not be removed. 162Refer to the description of 163.Xr unlink 2 --- 5 unchanged lines hidden (view full) --- 169.Xr write 2 170.Sh BUGS 171It is possible that a stale lock is not recognised as such if a new 172processes is assigned the same processes id as the program that left 173the stale lock. 174.Pp 175The calling process must have write permissions to the 176.Pa /var/spool/lock | 159for further details. 160.Pp 161.Fn uu_unlock 162will set the global variable 163.Va errno 164to reflect the reason that the lock file could not be removed. 165Refer to the description of 166.Xr unlink 2 --- 5 unchanged lines hidden (view full) --- 172.Xr write 2 173.Sh BUGS 174It is possible that a stale lock is not recognised as such if a new 175processes is assigned the same processes id as the program that left 176the stale lock. 177.Pp 178The calling process must have write permissions to the 179.Pa /var/spool/lock |
177directory. There is no mechanism in place to ensure that the | 180directory. 181There is no mechanism in place to ensure that the |
178permissions of this directory are the same as those of the 179serial devices that might be locked. | 182permissions of this directory are the same as those of the 183serial devices that might be locked. |