dolock.1 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. .\" $OpenBSD: dolock.1,v 1.5 2015/11/22 23:34:34 tim 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: November 22 2015 $
  18. .Dt DOLOCK 1
  19. .Os
  20. .Sh NAME
  21. .Nm dolock
  22. .Nd lock port for concurrent builds
  23. .Sh SYNOPSIS
  24. .Nm dolock
  25. .Op Fl g Ar group
  26. .Op Fl m Ar mode
  27. .Ar lockname Op comment ...
  28. .Sh DESCRIPTION
  29. .Nm
  30. creates a lock named
  31. .Ar lockname
  32. using
  33. .Xr open 2 .
  34. If the lock is already held, it will display one single wait message on
  35. stderr, sleep and retry until satisfaction.
  36. .Pp
  37. If necessary, creates the lock directory, using
  38. .Fl m Ar mode
  39. as a mode argument or the default if that option is not specified,
  40. and
  41. .Fl g Ar group
  42. as the group owner if that option is specified.
  43. .Pp
  44. This implements a locking mechanism for ports building, see
  45. .Sq LOCK INFRASTRUCTURE
  46. in
  47. .Xr ports 7
  48. for details.
  49. See also
  50. .Xr dpb 1
  51. for a complementary lock infrastructure when using dpb.