process(3lua): init man pages

Initialise man pages for the process module.
This commit is contained in:
Jeremy Baxter 2024-04-06 19:58:41 +13:00
parent 69f8fff3bd
commit 37d208a5d2
7 changed files with 156 additions and 0 deletions

View file

@ -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
*<signal.h>*.
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)

View file

@ -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)

View file

@ -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)

View file

@ -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)

View file

@ -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)

View file

@ -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)

View file

@ -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)