thrkill(2) - OpenBSD manual pages (original) (raw)

NAME

thrkill —send signal to a thread in the same process

SYNOPSIS

#include <signal.h>

int
thrkill(pid_t tid, int sig,void *tcb);

DESCRIPTION

Thethrkill() function sends the signal given by sig totid, a thread in the same process as the caller.thrkill() will only succeed iftcb is either NULL or the address of the thread control block (TCB) of the target thread.sig may be one of the signals specified insigaction(2) or it may be 0, in which case error checking is performed but no signal is actually sent.

If tid is zero then the current thread is targeted.

RETURN VALUES

Upon successful completion, the value 0 is returned; otherwise the value -1 is returned and the global variableerrno is set to indicate the error.

ERRORS

thrkill() will fail and no signal will be sent if:

[EINVAL]

sig is not a valid signal number.

[ESRCH]

The process doesn't have a thread with thread IDtid.

[ESRCH]

tcb is not NULL and not the TCB address of the thread with thread ID tid.

SEE ALSO

__get_tcb(2), kill(2), sigaction(2),pthread_kill(3), raise(3)

STANDARDS

The thrkill() function is specific toOpenBSD and should not be used in portable applications. Usepthread_kill(3) instead.

HISTORY

The thrkill() system call appeared inOpenBSD 5.9.