[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]

Technical Reference: Base Operating System and Extensions , Volume 2


raise Subroutine

Purpose

Sends a signal to the currently running program.

Libraries

Standard C Library (libc.a)

Threads Library (libpthreads.a)

Syntax

#include <sys/signal.h>


int raise ( Signal)
int Signal;

Description

The raise subroutine sends the signal specified by the Signal parameter to the executing process or thread, depending if the POSIX threads API (the libpthreads.a library) is used or not. When the program is not linked with the threads library, the raise subroutine sends the signal to the calling process as follows:

return kill(getpid(), Signal);

When the program is linked with the threads library, the raise subroutine sends the signal to the calling thread as follows:

return pthread_kill(pthread_self(), Signal);

Parameter


Signal Specifies a signal number.

Return Values

Upon successful completion of the raise subroutine, a value of 0 is returned. Otherwise, a nonzero value is returned, and the errno global variable is set to indicate the error.

Error Code


EINVAL The value of the sig argument is an invalid signal number

Implementation Specifics

This subroutine is part of Base Operating System (BOS) Runtime.

When using the threads library, it is important to ensure that the threads library is linked before the standard C library.

Related Information

The _exit subroutine, kill subroutine, pthread_kill subroutine, sigaction (sigaction, sigvec, or signal Subroutine) subroutine.

Signal Management in AIX 5L Version 5.1 General Programming Concepts: Writing and Debugging Programs provides more information about signal management in multi-threaded processes.


[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]