lock-util: add a new lock_generic_with_timeout() helper
authorLennart Poettering <lennart@poettering.net>
Thu, 2 Nov 2023 10:07:14 +0000 (11:07 +0100)
committerLennart Poettering <lennart@poettering.net>
Thu, 2 Nov 2023 13:19:32 +0000 (14:19 +0100)
commite5f1e8b89432724ba5c4772d1394eefe799c5504
tree89c2382a6f6ff9e7074b8b559c42a46f0bc9b28b
parente9ccae31355b8d4fd7496b0548470c8c977897d8
lock-util: add a new lock_generic_with_timeout() helper

This is just like lock_generic(), but applies the lock with a timeout.
This requires jumping through some hoops by executing things in a child
process, so that we can abort if necessary via a timer. Linux after all
has no native way to take file locks with a timeout.
src/basic/lock-util.c
src/basic/lock-util.h
src/basic/meson.build
src/test/test-lock-util.c