~ chicken-core (master) /manual/Module (scheme process-context)
Trap1[[tags: manual]]2[[toc:]]34== Module (scheme process-context56<procedure>(command-line)</procedure>78Returns the command line passed to the process as a list of strings. The first9string corresponds to the command name. It is10an error to mutate any of these strings.1112<procedure>(exit [obj])</procedure>1314Runs all outstanding dynamic-wind after procedures, terminates the running program, and communicates an exit15value to the operating system. If no argument is supplied, or if16obj is #t, the exit procedure should communicate to the operating system that17the program exited normally. If18obj is #f, the exit procedure should communicate to the operating system that19the program exited abnormally. Otherwise, exit should translate20obj into an appropriate exit value for the operating system, if possible.2122The exit procedure must not signal an exception or return to its continuation.2324Note: Because of the requirement to run handlers, this procedure is not25just the operating system's exit procedure.2627<procedure>(emergency-exit [obj])</procedure>2829Terminates the program without running any outstanding dynamic-wind30after procedures and communicates an exit value to the operating system in the31same manner as exit.3233Note: The emergency-exit procedure corresponds to the _exit procedure in34Windows and Posix.3536<procedure>(get-environment-variable name)</procedure>3738Many operating systems provide each running process with an environment39consisting of environment variables. (This environment is not to be confused40with the Scheme environments that can be passed to eval)41Both the name and value of an environment variable are strings. The procedure42get-environment-variable returns the value of the environment variable43name, or #f if the named environment variable is not found. It may use locale44information to encode the name and decode the value of the environment45variable. It is an error if46get-environment-variable can’t decode the value. It is also an error to mutate47the resulting string.4849 (get-environment-variable "PATH")50 ==> "/usr/local/bin:/usr/bin:/bin"5152<procedure>(get-environment-variables)</procedure>5354Returns the names and values of all the environment variables as an alist,55where the car of each entry is the name of an environment variable and the cdr56is its value, both as strings. The order of the list is unspecified. It is an57error to mutate any of these strings or the alist itself.5859 (get-environment-variables)60 ==> (("USER" . "root") ("HOME" . "/"))6162---63Previous: [[Module (scheme lazy)]]6465Next: [[Module (scheme read)]]