next up previous contents
Next: lseek: reposition current offset Up: MOSS system calls Previous: irq_request: allocate and handle

kill: send a signal to a process

SYNOPSIS

int kill(pid_t pid, int sig);

DESCRIPTION

This system call implements the POSIX kill function, which sends a signal to a process.

Since MOSS currently handles only one process, the only valid values of pid are 0 (the ``current'' process) and 1 (process 1, which under MOSS is ``the'' process). Thus, kill can only be used by the application to send signals to itself.

However, any valid POSIX or BSD signal can be sent, and they will cause any installed signal handlers to be invoked if appropriate. Since job control doesn't really make sense under MOSS, signals whose default action would normally be to stop the process instead merely terminate the process under MOSS (unless a signal handler has been installed).

PARAMETERS

pid
The process to send the signal to.
sig
The signal number to send.

RETURN VALUE

Returns 0 if successful, or -1 on error, in which case errno indicates the error.



Bryan Ford