---
name: "portlock"
section: "1"
platform: "openbsd"
package: "man"
version: "8.0-current-20261101"
release: "OpenBSD 8.0-current (2026-11-01)"
platforms: ["openbsd"]
url: "https://new.carta.tech/portlock"
---

# portlock(1)

lock port for concurrent builds

## NAME

**portlock** – lock port for concurrent builds

## SYNOPSIS

**portlock** \[**-g** *group*\] \[**-m** *mode*\] *lockname* \[comment ...\]

## DESCRIPTION

**portlock** creates a lock named *lockname* using [open(2)](/open/2.md). If the lock is already held, it will display one single wait message on stderr, sleep and retry until satisfaction.

If necessary, creates the lock directory, using **-m** *mode* as a mode argument or the default if that option is not specified, and **-g** *group* as the group owner if that option is specified.

This implements a locking mechanism for ports building, see ‘LOCK INFRASTRUCTURE’ in [ports(7)](/ports/7.md) for details. See also [dpb(1)](/dpb/1.md) for a complementary lock infrastructure when using dpb.
