|
NAMEsigfastblock —
controls signals blocking with a simple memory write
LIBRARYStandard C Library (libc, -lc)SYNOPSIS#include <sys/signalvar.h>
int
DESCRIPTIONThis function is not intended for a direct usage by
applications. The functionality is provided for implementing some
optimizations in
ld-elf.so.1(8)
and 1:1 Threading Library (libthr, -lthr).
The function configures the kernel facility that allows a thread to block asynchronous signals delivery with a single write to userspace memory, avoiding overhead of system calls like sigprocmask(2) for establishing critical sections. The C runtime uses it to optimize implementation of async-signal-safe functionality. A thread might register a The variable is supposed to be modified only from the owning thread, there is no way to guarantee visibility of update from other thread to kernel when signals are delivered. Lower bits of the sigblock variable are reserved as flags, which
might be set or cleared by kernel at arbitrary moments. Userspace code
should use
atomic(9)
operations of incrementing and decrementing by
If a signal would be delivered when unmasked, kernel might set the
The cmd argument specifies one of the following operations:
RETURN VALUESUpon successful completion, the value 0 is returned; otherwise the value -1 is returned and the global variable errno is set to indicate the error.ERRORSThe operation may fail with the following errors:
SEE ALSOkill(2), signal(2), sigprocmask(2), libthr(3), ld-elf.so.1(8)STANDARDSThesigfastblock function is non-standard, although a
similar functionality is a common optimization provided by several other
systems.
HISTORYThesigfastblock function was introduced in
FreeBSD 13.0.
BUGSThesigfastblock symbol is currently not exported by
libc, on purpose. Consumers should either use the
__sys_fast_sigblock symbol from the private libc
namespace, or utilize
syscall(2).
Visit the GSP FreeBSD Man Page Interface. |