1.\" $OpenBSD: portlock.1,v 1.1 2018/07/09 11:36:57 espie Exp $ 2.\" 3.\" Copyright (c) 2010 Marc Espie <espie@openbsd.org> 4.\" 5.\" Permission to use, copy, modify, and distribute this software for any 6.\" purpose with or without fee is hereby granted, provided that the above 7.\" copyright notice and this permission notice appear in all copies. 8.\" 9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16.\" 17.Dd $Mdocdate: July 9 2018 $ 18.Dt PORTLOCK 1 19.Os 20.Sh NAME 21.Nm portlock 22.Nd lock port for concurrent builds 23.Sh SYNOPSIS 24.Nm 25.Op Fl g Ar group 26.Op Fl m Ar mode 27.Ar lockname Op comment ... 28.Sh DESCRIPTION 29.Nm 30creates a lock named 31.Ar lockname 32using 33.Xr open 2 . 34If the lock is already held, it will display one single wait message on 35stderr, sleep and retry until satisfaction. 36.Pp 37If necessary, creates the lock directory, using 38.Fl m Ar mode 39as a mode argument or the default if that option is not specified, 40and 41.Fl g Ar group 42as the group owner if that option is specified. 43.Pp 44This implements a locking mechanism for ports building, see 45.Sq LOCK INFRASTRUCTURE 46in 47.Xr ports 7 48for details. 49See also 50.Xr dpb 1 51for a complementary lock infrastructure when using dpb. 52