-r : shared lock. Other shared locks on the same file will not prevent
the lock from being acquired (but an exclusive lock will).

-w : exclusive lock. This is the default.

Notes

s6-setlock leaks an open file descriptor into the prog
execution. This is intended: the fd holds the lock, which is released
when prog exits. prog must not touch fds it does not
know about.

If the timed lock option is chosen, s6-setlock does not acquire the lock
itself. Instead, it spawns a s6lockd-helper
process that acquires the lock while s6-setlock controls the timeout; the
s6lockd-helper process then holds the lock and lives as long as
prog.