int
alarm(int
seconds
)
Set an alarm clock for delivery of a signal.
alarm()
arranges for a SIGALRM signal to be delivered to the
process in seconds
seconds.
If seconds
is 0
(zero), no new alarm will be scheduled.
Any previous alarms will in any case be canceled.
Returns the number of seconds remaining until any previously scheduled alarm was due to be delivered, or zero if there was no previously scheduled alarm.
This function is only available on platforms that support signals.
ualarm()
, signal()
, call_out()
object
fork()
Fork the process in two.
Fork splits the process in two, and for the parent it returns a pid object for the child. Refer to your Unix manual for further details.
This function can cause endless bugs if used without proper care.
This function is disabled when using threads.
This function is not available on all platforms.
The most common use for fork is to start sub programs, which is
better done with Process.create_process()
.
Process.create_process()
int
exece(string
file
, array
(string
) args
)
int
exece(string
file
, array
(string
) args
, mapping
(string
:string
) env
)
This function transforms the Pike process into a process running
the program specified in the argument file
with the arguments args
.
If the mapping env
is present, it will completely replace all
environment variables before the new program is executed.
This function only returns if something went wrong during exece(2),
and in that case it returns 0
(zero).
The Pike driver _dies_ when this function is called. You must either
use fork()
or Process.create_process()
if you wish to execute a
program and still run the Pike runtime.
This function is not available on all platforms.
Process.create_process()
, fork()
, Stdio.File->pipe()
Support for the Apple Keychain format.
This is used for the files in eg /System/Library/Keychains.
array
(string
) RegGetKeyNames(int
hkey
, string
key
)
Get a list of value key names from the register.
hkey
One of the following:
|
|
|
|
key
A registry key.
Returns an array of value keys stored at the specified location if any.
Returns UNDEFINED
on missing key
.
Throws errors on other failures.
> RegGetKeyNames(HKEY_CURRENT_USER, "Keyboard Layout"); (1) Result: ({ "IMEtoggle", "Preload", "Substitutes", "Toggle" })
This function is only available on Win32 systems.
RegGetValue()
, RegGetValues()
string
|int
|array
(string
) RegGetValue(int
hkey
, string
key
, string
index
, bool
|void
no_expand
)
Get a single value from the register.
hkey
One of the following:
|
|
|
|
key
Registry key.
index
Value name.
no_expand
Set this to 1
to not expand variables in
REG_EXPAND_SZ
-values.
Returns the value stored at the specified location in the register
if any. Returns UNDEFINED
on missing keys, throws errors
on other failures.
This function is only available on Win32 systems.
Prior to Pike 9.0 REG_EXPAND_SZ
-values were always expanded.
RegGetValues()
, RegGetKeyNames()
mapping
(string
:string
|int
|array
(string
)) RegGetValues(int
hkey
, string
key
, bool
|void
no_expand
)
Get multiple values from the register.
hkey
One of the following:
|
|
|
|
key
Registry key.
no_expand
Set this to 1
to not expand variables in
REG_EXPAND_SZ
-values.
Returns a mapping with all the values stored at the specified location
in the register if any.
Returns UNDEFINED
on missing key
.
Throws errors on other failures.
> RegGetValues(HKEY_CURRENT_USER, "Keyboard Layout\\Preload"); (5) Result: ([ "1":"0000041d" ])
This function is only available on Win32 systems.
Prior to Pike 9.0 REG_EXPAND_SZ
-values were always expanded.
RegGetValue()
, RegGetKeyNames()