1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
|
<!--
# VIP @lib/vip/html.l
# 26oct23 Software Lab. Alexander Burger
-->
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>K</title>
<link rel="stylesheet" href="doc.css" type="text/css">
</head>
<body>
<h1>K</h1>
<dl>
<dt><a id="+Key"><code>+Key</code></a></dt>
<dd>Prefix class for maintaining unique indexes to <code><a
href="refR.html#+relation">+relation</a></code>s, a subclass of <code><a
href="refI.html#+index">+index</a></code>. Accepts an optional argument for a
<code><a href="refH.html#+Hook">+Hook</a></code> attribute. See also <a
href="ref.html#dbase">Database</a>.
<pre>
(rel nr (+Need +Key +Number)) # Mandatory, unique Customer/Supplier number
</pre></dd>
<dt><a id="key"><code>(key ['cnt ['var]]) -> sym</code></a></dt>
<dd>Returns the next character from standard input as a single-character
transient symbol. The console is set to raw mode. While waiting for a key press,
a <code>poll(2)</code> system call is executed for all file descriptors and
timers in the <code>VAL</code> of the global variable <code><a
href="refR.html#*Run">*Run</a></code>. If <code>cnt</code> is
non-<code>NIL</code>, that amount of milliseconds is waited maximally, and
<code>NIL</code> is returned upon timeout. Otherwise, the remaining milliseconds
are optionally stored in <code>var</code>. See also <code><a
href="refR.html#raw">raw</a></code> and <code><a
href="refW.html#wait">wait</a></code>.
<pre>
: (key) # Wait for a key
-> "a" # 'a' pressed
</pre></dd>
<dt><a id="kids"><code>(kids) -> lst</code></a></dt>
<dd>Returns a list of process IDs of all running child processes. See also
<code><a href="refF.html#fork">fork</a></code>, <code><a
href="refD.html#detach">detach</a></code>, <code><a
href="refP.html#pipe">pipe</a></code>, <code><a
href="refT.html#tell">tell</a></code>, <code><a
href="refP.html#proc">proc</a></code> and <code><a
href="refK.html#kill">kill</a></code>.
<pre>
: (unless (fork) (wait 60000) (bye))
-> NIL
: (unless (fork) (wait 60000) (bye))
-> NIL
: (proc 'pil)
PID PPID STARTED SIZE %CPU WCHAN CMD
2205 22853 19:45:24 1336 0.1 - /usr/bin/picolisp /usr/lib/picolisp/lib.l /usr/bin/pil +
2266 2205 19:45:30 1336 0.0 - /usr/bin/picolisp /usr/lib/picolisp/lib.l /usr/bin/pil +
2300 2205 19:45:33 1336 0.0 - /usr/bin/picolisp /usr/lib/picolisp/lib.l /usr/bin/pil +
-> T
: (kids)
-> (2300 2266)
</pre></dd>
<dt><a id="kill"><code>(kill 'pid ['cnt]) -> flg</code></a></dt>
<dd>Sends a signal with the signal number <code>cnt</code> (or SIGTERM if
<code>cnt</code> is not given) to the process with the ID <code>pid</code>.
Returns <code>T</code> if successful.
<pre>
: (kill *Pid 20) # Stop current process
[2]+ Stopped pil + # Unix shell
$ fg # Job control: Foreground
pil +
-> T # 'kill' was successful
</pre></dd>
</dl>
</body>
</html>
|