Nios® V Processor Software Developer Handbook

ID 743810
Date 2/14/2023
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

12.1.1.63. kill()

Prototype

int kill(int pid, int sig)

Commonly Called By

newlib C library

Thread-safe

Yes.

Available from ISR

Yes.

Include

<signal.h>

Description

The kill() function is used by newlib to send signals to processes. The input argument pid is the ID of the process to signal, and sig is the signal to send. As there is only a single process in the HAL, the only valid values for pid are either the current process ID, as returned by getpid(), or the broadcast values, that is, pid must be less than or equal to zero.

The following signals result in an immediate shutdown of the system, without call to exit(): SIGABRT, SIGALRM, SIGFPE, SIGILL, SIGKILL, SIGPIPE, SIGQUIT, SIGSEGV, SIGTERM, SIGUSR1, SIGUSR2, SIGBUS, SIGPOLL, SIGPROF, SIGSYS, SIGTRAP, SIGVTALRM, SIGXCPU, and SIGXFSZ.

The following signals are ignored: SIGCHLD and SIGURG.

All the remaining signals are treated as errors.

Return

The return value is zero on success, or –1 otherwise. If the call fails, errno is set to indicate the cause of the error.