int kill(pid_t pid, int sig);
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).
- pid
- The process to send the signal to.
- sig
- The signal number to send.
Returns 0 if successful, or -1 on error, in which case errno indicates the error.