flock()
is generally async-signal-safe because it is a system call. Its semantics make it hard to implement it differently. It is not in the POSIX's list of async-signal-safe functions because it is not in POSIX at all.
Is it possible to use flock()
in the sigaction handler without problems?