diff --git a/man/process/process.3lua.scd b/man/process/process.3lua.scd new file mode 100644 index 0000000..35afef9 --- /dev/null +++ b/man/process/process.3lua.scd @@ -0,0 +1,24 @@ +PROCESS(3lua) "3lua" "Callisto manual pages" + +# NAME +*process* - process and signal library + +# SYNOPSIS +.Syn + +# DESCRIPTION +The *process* library provides routines +to find processes and manipulate them by sending signals. + +Signals are passed as strings identifying the signal, +which represent the signal's name as defined in your system's +**. +Signals are converted from their string name into +the system-dependent numerical constant. +To perform this manually, see process.signum(3lua). + +The term _PID_ refers to a process ID; +the unique integer assigned to a process upon execution. + +# SEE ALSO +callisto(3lua) diff --git a/man/process/process.kill.3lua.scd b/man/process/process.kill.3lua.scd new file mode 100644 index 0000000..eee9c8d --- /dev/null +++ b/man/process/process.kill.3lua.scd @@ -0,0 +1,16 @@ +PROCESS.KILL(3lua) "3lua" "Callisto manual pages" + +# NAME +*process.kill* - kill a process + +# SYNOPSIS +*process.kill*(_pid_: *integer*) + +# DESCRIPTION +*process.kill* sends *SIGKILL* to the process identified by _pid_. + +Equivalent to _process.send(pid, "SIGKILL")_, and fails for all the +reasons *process.send* fails for. + +# SEE ALSO +callisto(3lua), process(3lua), process.send(3lua) diff --git a/man/process/process.pid.3lua.scd b/man/process/process.pid.3lua.scd new file mode 100644 index 0000000..cd4c3c7 --- /dev/null +++ b/man/process/process.pid.3lua.scd @@ -0,0 +1,22 @@ +PROCESS.PID(3lua) "3lua" "Callisto manual pages" + +# NAME +*process.pid* - get the current process's PID + +# SYNOPSIS +*process.pid*() + +# DESCRIPTION +*process.pid* returns the PID of the current interpreter process. + +# EXAMPLES +Create a function that returns a unique name for a temporary file: + +``` +function tmpname(prefix) + return "/tmp/" .. prefix .. '.' .. process.pid() +end +``` + +# SEE ALSO +callisto(3lua), process(3lua), getpid(2) diff --git a/man/process/process.pidof.3lua.scd b/man/process/process.pidof.3lua.scd new file mode 100644 index 0000000..9b3b82a --- /dev/null +++ b/man/process/process.pidof.3lua.scd @@ -0,0 +1,27 @@ +PROCESS.PIDOF(3lua) "3lua" "Callisto manual pages" + +# NAME +*process.pidof* - get the PID of another process + +# SYNOPSIS +*process.pidof*(_cmd_: *string*) + +# DESCRIPTION +*process.pidof* returns the PID of a process +which has the command name _cmd_. +The process is chosen arbitrarily; if there are multiple matches, +the first process found with the command name _cmd_ is returned. + +If a process could not be found, *process.pidof* returns nil. + +# EXAMPLES +Flawed implementation of *process.pid*: + +``` +function pid() + return process.pidof("csto") +end +``` + +# SEE ALSO +callisto(3lua), process(3lua) diff --git a/man/process/process.send.3lua.scd b/man/process/process.send.3lua.scd new file mode 100644 index 0000000..5635f06 --- /dev/null +++ b/man/process/process.send.3lua.scd @@ -0,0 +1,25 @@ +PROCESS.SEND(3lua) "3lua" "Callisto manual pages" + +# NAME +*process.send* - send a signal + +# SYNOPSIS +*process.send*(_pid_: *integer*, _sig_: *string*) + +# DESCRIPTION +*process.send* sends the signal named _sig_ +to the process identitied by _pid_. + +If an error occurs, +*process.send* returns nil, an error message and +a platform-dependent error code. +There are a few reasons *process.send* can fail; +see kill(2) for a list of possible error values. + +# EXAMPLES +Send *SIGKILL* to a process with command name *bash*: + + process.send(process.pidof("bash"), "SIGKILL") + +# SEE ALSO +callisto(3lua), process(3lua), kill(2) diff --git a/man/process/process.signum.3lua.scd b/man/process/process.signum.3lua.scd new file mode 100644 index 0000000..a61ffef --- /dev/null +++ b/man/process/process.signum.3lua.scd @@ -0,0 +1,26 @@ +PROCESS.SIGNUM(3lua) "3lua" "Callisto manual pages" + +# NAME +*process.signum* - translate a signal's name into its numeric constant + +# SYNOPSIS +*process.signum*(_sig_: *string*) + +# DESCRIPTION +*process.signum* returns the numeric form of the signal name _sig_. +The returned integer will likely differ across platforms. + +On many platforms, *SIGKILL* has the numeric value *9*; +therefore, on those platforms _process.signum("SIGKILL")_ +would return *9*. + +If _sig_ is not the name of a valid signal, +*process.signum* throws a Lua error. + +# EXAMPLES +Print the value of *SIGUSR1*: + + print("SIGUSR1 is " .. process.signum("SIGUSR1")) + +# SEE ALSO +callisto(3lua), process(3lua) diff --git a/man/process/process.terminate.3lua.scd b/man/process/process.terminate.3lua.scd new file mode 100644 index 0000000..646459c --- /dev/null +++ b/man/process/process.terminate.3lua.scd @@ -0,0 +1,16 @@ +PROCESS.TERMINATE(3lua) "3lua" "Callisto manual pages" + +# NAME +*process.terminate* - terminate a process + +# SYNOPSIS +*process.terminate*(_pid_: *integer*) + +# DESCRIPTION +*process.terminate* sends *SIGTERM* to the process identified by _pid_. + +Equivalent to _process.send(pid, "SIGTERM")_, and fails for all the +reasons *process.send* fails for. + +# SEE ALSO +callisto(3lua), process(3lua), process.send(3lua)