You are looking at historical revision 1100 of this page. It may differ significantly from its current revision.

Unit posix

This unit provides services as used on many UNIX-like systems. Note that the following definitions are not all available on non-UNIX systems like Windows. See below for Windows specific notes.

This unit uses the regex, scheduler, extras and utils units.

All errors related to failing file-operations will signal a condition of kind (exn i/o file).


{procedure} change-directory
(change-directory NAME)

Changes the current working directory to NAME.

{procedure} current-directory
(current-directory [DIR])

Returns the name of the current working directory. If the optional argument DIR is given, then (current-directory DIR) is equivalent to (change-directory DIR).

{procedure} create-directory
(create-directory NAME)

Creates a directory with the pathname NAME.

{procedure} delete-directory
(delete-directory NAME)

Deletes the directory with the pathname NAME. The directory has to be empty.

{procedure} directory

Returns a list with all files that are contained in the directory with the name PATHNAME (which defaults to the value of (current-directory)). If SHOW-DOTFILES? is given and not #f, then files beginning with . are not included in the directory listing.

{procedure} directory?
(directory? NAME)

Returns #t if there exists a file with the name NAME and if that file is a directory, or #f otherwise.

{procedure} glob
(glob PATTERN1 ...)

Returns a list of the pathnames of all existing files matching PATTERN1 ..., which should be strings containing the usual file-patterns (with * matching zero or more characters and ? matching zero or one character).

{procedure} set-root-directory!
(set-root-directory! STRING)

Sets the root directory for the current process to the path given in STRING (using the chroot function). If the current process has no root permissions, the operation will fail.


{procedure} call-with-input-pipe
{procedure} call-with-output-pipe
(call-with-input-pipe CMDLINE PROC [MODE])
(call-with-output-pipe CMDLINE PROC [MODE])

Call PROC with a single argument: a input- or output port for a pipe connected to the subprocess named in CMDLINE. If PROC returns normally, the pipe is closed and any result values are returned.

{procedure} close-input-pipe
{procedure} close-output-pipe
(close-input-pipe PORT)
(close-output-pipe PORT)

Closes the pipe given in PORT and waits until the connected subprocess finishes. The exit-status code of the invoked process is returned.

{procedure} create-pipe

The fundamental pipe-creation operator. Calls the C function pipe() and returns 2 values: the file-descriptors of the input- and output-ends of the pipe.

{procedure} open-input-pipe
(open-input-pipe CMDLINE [MODE])

Spawns a subprocess with the command-line string CMDLINE and returns a port, from which the output of the process can be read. If MODE is specified, it should be the keyword #:text (the default) or #:binary.

{procedure} open-output-pipe
(open-output-pipe CMDLINE [MODE])

Spawns a subprocess with the command-line string CMDLINE and returns a port. Anything written to that port is treated as the input for the process. If MODE is specified, it should be the keyword #:text (the default) or #:binary.

{limit} pipe/buf

This variable contains the maximal number of bytes that can be written atomically into a pipe or FIFO.

{procedure} with-input-from-pipe
{procedure} with-output-to-pipe
(with-input-from-pipe CMDLINE THUNK [MODE])
(with-output-to-pipe CMDLINE THUNK [MODE])

Temporarily set the value of current-input-port/current-output-port to a port for a pipe connected to the subprocess named in CMDLINE and call the procedure THUNK with no arguments. After THUNK returns normally the pipe is closed and the standard input-/output port is restored to its previous value and any result values are returned.

  "gs -dNOPAUSE -sDEVICE=jpeg -dBATCH -sOutputFile=signballs.jpg -g600x600 -q -"
  (lambda ()
    (print #<<EOF
%!IOPSC-1993 %%Creator: HAYAKAWA Takashi<xxxxxxxx@xx.xxxxxx.xx.xx>
/C/neg/d/mul/R/rlineto/E/exp/H{{cvx def}repeat}def/T/dup/g/gt/r/roll/J/ifelse 8
V1c&j2AYdjmMdjjd!o&1r!M){( )T 0 4 3 r put T(/)g{T(9)g{cvn}{cvi}J}{($)g[]J}J
cvx}forall/moveto/p/floor/w/div/S/add 29 H[{[{]setgray fill}for Y}for showpage
) ) )


{procedure} create-fifo
(create-fifo FILENAME [MODE])

Creates a FIFO with the name FILENAME and the permission bits MODE, which defaults to

(+ perm/irwxu perm/irwxg perm/irwxo)
{procedure} fifo?
(fifo? FILENAME)

Returns #t if the file with the name FILENAME names a FIFO.

File descriptors and low-level I/O

{procedure} duplicate-fileno
(duplicate-fileno OLD [NEW])

If NEW is given, then the file-descriptor NEW is opened to access the file with the file-descriptor OLD. Otherwise a fresh file-descriptor accessing the same file as OLD is returned.

{procedure} file-close
(file-close FILENO)

Closes the input/output file with the file-descriptor FILENO.

{procedure} file-open

Opens the file specified with the string FILENAME and open-flags FLAGS using the C function open(). On success a file-descriptor for the opened file is returned. FLAGS should be a bitmask containing one or more of the open/... values ored together using bitwise-ior (or simply added together). The optional MODE should be a bitmask composed of one or more permission values like perm/irusr and is only relevant when a new file is created. The default mode is perm/irwxu | perm/irgrp | perm/iroth.

{procedure} file-mkstemp
(file-mkstemp TEMPLATE-FILENAME)

Create a file based on the given TEMPLATE-FILENAME, in which the six last characters must be XXXXXX. These will be replaced with a string that makes the filename unique. The file descriptor of the created file and the generated filename is returned. See the mkstemp(3) manual page for details on how this function works. The template string given is not modified.

Example usage:

(let-values (((fd temp-path) (file-mkstemp "/tmp/mytemporary.XXXXXX")))
  (let ((temp-port (open-output-file* fd)))
    (format temp-port "This file is ~A.~%" temp-path)
    (close-output-port temp-port)))
{procedure} file-read
(file-read FILENO SIZE [BUFFER])

Reads SIZE bytes from the file with the file-descriptor FILENO. If a string or bytevector is passed in the optional argument BUFFER, then this string will be destructively modified to contain the read data. This procedure returns a list with two values: the buffer containing the data and the number of bytes read.

{procedure} file-select

Waits until any of the file-descriptors given in the lists READFDLIST and WRITEFDLIST is ready for input or output, respectively. If the optional argument TIMEOUT is given and not false, then it should specify the number of seconds after which the wait is to be aborted. This procedure returns two values: the lists of file-descriptors ready for input and output, respectively. READFDLIST and WRITEFDLIST may also by file-descriptors instead of lists. In this case the returned values are booleans indicating whether input/output is ready by #t or #f otherwise. You can also pass #f as READFDLIST or WRITEFDLIST argument, which is equivalent to ().

{procedure} file-write
(file-write FILENO BUFFER [SIZE])

Writes the contents of the string or bytevector BUFFER into the file with the file-descriptor FILENO. If the optional argument SIZE is given, then only the specified number of bytes are written.

{file descriptor} fileno/stdin
{file descriptor} fileno/stdout
{file descriptor} fileno/stderr

These variables contain file-descriptors for the standard I/O files.

{flag} open/rdonly
{flag} open/wronly
{flag} open/rdwr
{flag} open/read
{flag} open/write
{flag} open/creat
{flag} open/append
{flag} open/excl
{flag} open/noctty
{flag} open/nonblock
{flag} open/trunc
{flag} open/sync
{flag} open/fsync
{flag} open/binary
{flag} open/text

Flags for use with file-open.

{procedure} open-input-file*
{procedure} open-output-file*
(open-input-file* FILENO [OPENMODE])
(open-output-file* FILENO [OPENMODE])

Opens file for the file-descriptor FILENO for input or output and returns a port. FILENO should be a positive exact integer. OPENMODE specifies an additional mode for opening the file (currently only the keyword #:append is supported, which opens an output-file for appending).

{procedure} port->fileno
(port->fileno PORT)

If PORT is a file- or tcp-port, then a file-descriptor is returned for this port. Otherwise an error is signaled.

Retrieving file attributes

{procedure} file-access-time
{procedure} file-change-time
{procedure} file-modification-time
(file-access-time FILE)
(file-change-time FILE)
(file-modification-time FILE)

Returns time (in seconds) of the last acces, modification or change of FILE. FILE may be a filename or a file-descriptor. If the file does not exist, an error is signaled.

{procedure} file-stat
(file-stat FILE [LINK])

Returns a 9-element vector with the following contents: inode-number, mode (as with file-permissions), number of hard links, uid of owner (as with file-owner), gid of owner, size (as with file-size) and access-, change- and modification-time (as with file-access-time, file-change-time and file-modification-time). If the optional argument LINK is given and not #f, then the file-statistics vector will be resolved for symbolic links (otherwise symbolic links are resolved).

{procedure} file-position
(file-position FILE)

Returns the current file position of FILE, which should be a port or a file-descriptor.

{procedure} file-size
(file-size FILENAME)

Returns the size of the file designated by FILE. FILE may be a filename or a file-descriptor. If the file does not exist, an error is signaled.

{procedure} regular-file?
(regular-file? FILENAME)

Returns true, if FILENAME names a regular file (not a directory or symbolic link).

Changing file attributes

{procedure} file-truncate
(file-truncate FILE OFFSET)

Truncates the file FILE to the length OFFSET, which should be an integer. If the file-size is smaller or equal to OFFSET then nothing is done. FILE should be a filename or a file-descriptor.

{procedure} set-file-position!
(set-file-position! FILE POSITION [WHENCE])

Sets the current read/write position of FILE to POSITION, which should be an exact integer. FILE should be a port or a file-descriptor. WHENCE specifies how the position is to interpreted and should be one of the values seek/set, seek/cur and seek/end. It defaults to seek/set.

Exceptions: (exn bounds), (exn i/o file)


{procedure} current-process-id

Returns the process ID of the current process.

{procedure} parent-process-id

Returns the process ID of the parent of the current process.

{procedure} process-execute

Creates a new child process and replaces the running process with it using the C library function execvp(3). If the optional argument ARGUMENT-LIST is given, then it should contain a list of strings which are passed as arguments to the subprocess. If the optional argument ENVIRONMENT-LIST is supplied, then the library function execve(2) is used, and the environment passed in ENVIRONMENT-LIST (which should be of the form ("<NAME>=<VALUE>" ...) is given to the invoked process. Note that execvp(3) respects the current setting of the PATH environment variable while execve(3) does not.

On native Windows, process-execute ignores the ENVIRONMENT-LIST arguments.

{procedure} process-fork
(process-fork [THUNK])

Creates a new child process with the UNIX system call fork(). Returns either the PID of the child process or 0. If THUNK is given, then the child process calls it as a procedure with no arguments and terminates.

{procedure} process-run
(process-run PATHNAME [LIST])

Creates a new child process using the UNIX system call fork() that executes the program given by the string PATHNAME using the UNIX system call execv(). The PID of the new process is returned. If LIST is not specified, then PATHNAME is passed to a program named by the environment variable SHELL (or /bin/sh, if the variable is not defined), so usual argument expansion can take place.

{procedure} process-signal
(process-signal PID [SIGNAL])

Sends SIGNAL to the process with the id PID using the UNIX system call kill(). SIGNAL defaults to the value of the variable signal/term.

{procedure} process-wait
(process-wait [PID [NOHANG]])

Suspends the current process until the child process with the id PID has terminated using the UNIX system call waitpid(). If PID is not given, then this procedure waits for any child process. If NOHANG is given and not #f then the current process is not suspended. This procedure returns three values:

{procedure} process

Passes the string COMMANDLINE to the host-system's shell that is invoked as a subprocess and returns three values: an input port from which data written by the sub-process can be read, an output port from which any data written to will be received as input in the sub-process and the process-id of the started sub-process. Blocking reads and writes to or from the ports returned by process only block the current thread, not other threads executing concurrently.

If ARGUMENTLIST is given, then the invocation of the subprocess is not done via the shell, but directly. The arguments are directly passed to process-execute (as is ENVIRONMENT). Not using the shell may be preferrable for security reasons.

On native Windows the ARGUMENTLIST and ENVIRONMENT arguments are ignored.

{procedure} sleep
(sleep SECONDS)

Puts the process to sleep for SECONDS. Returns either 0 if the time has completely elapsed, or the number of remaining seconds, if a signal occurred.

{procedure} symbolic-link?
(symbolic-link? FILENAME)

Returns true, if FILENAME names a symbolic link.

{procedure} create-symbolic-link
(create-symbolic-link OLDNAME NEWNAME)

Creates a symbolic link with the filename NEWNAME that points to the file named OLDNAME.

{procedure} read-symbolic-link
(read-symbolic-link FILENAME)

Returns the filename to which the symbolic link FILENAME points.

{procedure} file-link

Creates a hard link from OLDNAME to NEWNAME (both strings).


{procedure} file-owner
(file-owner FILE)

Returns the user-id of FILE. FILE may be a filename or a file-descriptor.

{procedure} file-permissions
(file-permissions FILE)

Returns the permission bits for FILE. You can test this value by performing bitwise operations on the result and the perm/@dots{} values. FILE may be a filename or a file-descriptor.

{procedure} file-read-access?
{procedure} file-write-access?
{procedure} file-execute-access?
(file-read-access? FILENAME)
(file-write-access? FILENAME)
(file-execute-access? FILENAME)

These procedures return #t if the current user has read, write or execute permissions on the file named FILENAME.

{procedure} change-file-mode
(change-file-mode FILENAME MODE)

Changes the current file mode of the file named FILENAME to MODE using the chmod() system call. The perm/... variables contain the various permission bits and can be combinded with the bitwise-ior procedure.

{procedure} change-file-owner
(change-file-owner FILENAME UID GID)

Changes the owner information of the file named FILENAME to the user- and group-ids UID and GID (which should be exact integers) using the chown() system call.

{procedure} current-user-id
{procedure} current-group-id
{procedure} current-effective-user-id
{procedure} current-effective-group-id

Return the user- and group-ids of the current process.

{procedure} process-group-id
(process-group-id PID)

Returns the process group ID of the process specified by PID.

{procedure} group-information
(group-information GROUP)

If GROUP specifies a valid group-name or group-id, then this procedure returns a list of four values: the group-name, the encrypted group password, the group ID and a list of the names of all group members. If no group with the given name or ID exists, then #f is returned.

{procedure} get-groups

Returns a list with the supplementary group IDs of the current user.

{procedure} set-groups!
(set-groups! GIDLIST)

Sets the supplementrary group IDs of the current user to the IDs given in the list GIDLIST.

Only the superuser may invoke this procedure.

{procedure} initialize-groups
(initialize-groups USERNAME BASEGID)

Sets the supplementrary group IDs of the current user to the IDs from the user with name USERNAME (a string), including BASEGID.

Only the superuser may invoke this procedure.

{permission bits} perm/irusr
{permission bits} perm/iwusr
{permission bits} perm/ixusr
{permission bits} perm/irgrp
{permission bits} perm/iwgrp
{permission bits} perm/ixgrp
{permission bits} perm/iroth
{permission bits} perm/iwoth
{permission bits} perm/ixoth
{permission bits} perm/irwxu
{permission bits} perm/irwxg
{permission bits} perm/irwxo
{permission bits} perm/isvtx
{permission bits} perm/isuid
{permission bits} perm/isgid

These variables contain permission bits as used in change-file-mode.

{procedure} set-user-id!
(set-user-id! UID)

Sets the effective user id of the current process to UID, which should be a positive integer.

{procedure} set-group-id!
(set-group-id! GID)

Sets the effective group id of the current process to GID, which should be a positive integer.

{procedure} set-process-group-id!
(set-user-id! PID PGID)

Sets the process group ID of the process specifed by PID to PGID.

{procedure} user-information
(user-information USER)

If USER specifes a valid username (as a string) or user ID, then the user database is consulted and a list of 7 values are returned: the user-name, the encrypted password, the user ID, the group ID, a user-specific string, the home directory and the default shell. If no user with this name or ID can be found, then #f is returned.

{procedure} create-session

Creates a new session if the calling process is not a process group leader and returns the session ID.

Record locking

{procedure} file-lock
(file-lock PORT [START [LEN]])

Locks the file associated with PORT for reading or writing (according to whether PORT is an input- or output-port). START specifies the starting position in the file to be locked and defaults to 0. LEN specifies the length of the portion to be locked and defaults to #t, which means the complete file. file-lock returns a lock-object.

{procedure} file-lock/blocking
(file-lock/blocking PORT [START [LEN]])

Similar to file-lock, but if a lock is held on the file, the current process blocks (including all threads) until the lock is released.

{procedure} file-test-lock
(file-test-lock PORT [START [LEN]])

Tests whether the file associated with PORT is locked for reading or writing (according to whether PORT is an input- or output-port) and returns either #f or the process-id of the locking process.

{procedure} file-unlock
(file-unlock LOCK)

Unlocks the previously locked portion of a file given in LOCK.

Signal handling

{procedure} set-alarm!
(set-alarm! SECONDS)

Sets an internal timer to raise the signal/alrm after SECONDS are elapsed. You can use the set-signal-handler! procedure to write a handler for this signal.

{procedure} set-signal-handler!
(set-signal-handler! SIGNUM PROC)

Establishes the procedure of one argument PROC as the handler for the signal with the code SIGNAL. PROC is called with the signal number as its sole argument. If the argument PROC is #f then this signal will be ignored. Note that is is unspecified in which thread of execution the signal handler will be invoked.

{procedure} set-signal-mask!
(set-signal-mask! SIGLIST)

Sets the signal mask of the current process to block all signals given in the list SIGLIST. Signals masked in that way will not be delivered to the current process.

{signal code} signal/term
{signal code} signal/kill
{signal code} signal/int
{signal code} signal/hup
{signal code} signal/fpe
{signal code} signal/ill
{signal code} signal/segv
{signal code} signal/abrt
{signal code} signal/trap
{signal code} signal/quit
{signal code} signal/alrm
{signal code} signal/vtalrm
{signal code} signal/prof
{signal code} signal/io
{signal code} signal/urg
{signal code} signal/chld
{signal code} signal/cont
{signal code} signal/stop
{signal code} signal/tstp
{signal code} signal/pipe
{signal code} signal/xcpu
{signal code} signal/xfsz
{signal code} signal/usr1
{signal code} signal/usr2
{signal code} signal/winch

These variables contain signal codes for use with process-signal or set-signal-handler!.

Environment access

{procedure} current-environment

Returns a association list of the environment variables and their current values.

{procedure} setenv

Sets the environment variable named VARIABLE to VALUE. Both arguments should be strings. If the variable is not defined in the environment, a new definition is created.

{procedure} unsetenv
(unsetenv VARIABLE)

Removes the definition of the environment variable VARIABLE from the environment of the current process. If the variable is not defined, nothing happens.

Memory mapped I/O

{pocedure} memory-mapped-file?
(memory-mapped-file? X)

Returns #t, if X is an object representing a memory mapped file, or #f otherwise.

{procedure} map-file-to-memory

Maps a section of a file to memory using the C function mmap(). ADDRESS should be a foreign pointer object or #f; LEN specifies the size of the section to be mapped; PROTECTION should be one or more of the flags prot/read, prot/write, prot/exec or prot/none bitwise-iored together; FLAG should be one or more of the flags map/fixed, map/shared, map/private, map/anonymous or map/file; FILENO should be the file-descriptor of the mapped file. The optional argument OFFSET gives the offset of the section of the file to be mapped and defaults to 0. This procedure returns an object representing the mapped file section. The procedure move-memory! can be used to access the mapped memory.

{procedure} memory-mapped-file-pointer
(memory-mapped-file-pointer MMAP)

Returns a machine pointer to the start of the memory region to which the file is mapped.

{procedure} unmap-file-from-memory
(unmap-file-from-memory MMAP [LEN])

Unmaps the section of a file mapped to memory using the C function munmap(). MMAP should be a mapped file as returned by the procedure map-file-to-memory. The optional argument LEN specifies the length of the section to be unmapped and defaults to the complete length given when the file was mapped.

Date and time routines

{procedure} seconds->local-time
(seconds->local-time SECONDS)

Breaks down the time value represented in SECONDS into a 10 element vector of the form #(seconds minutes hours mday month year wday yday dstflag timezone), in the following format:

the number of seconds after the minute (0 - 59)
the number of minutes after the hour (0 - 59)
the number of hours past midnight (0 - 23)
the day of the month (1 - 31)
the number of months since january (0 - 11)
the number of years since 1900
the number of days since Sunday (0 - 6)
the number of days since January 1 (0 - 365)
a flag that is true if Daylight Saving Time is in effect at the time described.
the difference between UTC and the latest local standard time, in seconds west of UTC.
{procedure} local-time->seconds
(local-time->seconds VECTOR)

Converts the ten-element vector VECTOR representing the time value relative to the current timezone into the number of seconds since the first of January, 1970 UTC.

{procedure} local-timezone-abbreviation

Returns the abbreviation for the local timezone as a string.

{procedure} seconds->string
(seconds->string SECONDS)

Converts the local time represented in SECONDS into a string of the form "Tue May 21 13:46:22 1991\n".

{procedure} seconds->utc-time
(seconds->utc-time SECONDS)

Similar to seconds->local-time, but interpretes SECONDS as UTC time.

{procedure} utc-time->seconds
(utc-time->seconds VECTOR)

Converts the ten-element vector VECTOR representing the UTC time value into the number of seconds since the first of January, 1970 UTC.

{procedure} time->string
(time->string VECTOR)

Converts the broken down time represented in the 10 element vector VECTOR into a string of the form "Tue May 21 13:46:22 1991\n".

Raw exit

{procedure} _exit
(_exit [CODE])

Exits the current process without flushing any buffered output (using the C function _exit). Note that the exit-handler is not called when this procedure is invoked. The optional return-code CODE defaults to 0.

ERRNO values

{error code} errno/perm
{error code} errno/noent
{error code} errno/srch
{error code} errno/intr
{error code} errno/io
{error code} errno/noexec
{error code} errno/badf
{error code} errno/child
{error code} errno/nomem
{error code} errno/acces
{error code} errno/fault
{error code} errno/busy
{error code} errno/notdir
{error code} errno/isdir
{error code} errno/inval
{error code} errno/mfile
{error code} errno/nospc
{error code} errno/spipe
{error code} errno/pipe
{error code} errno/again
{error code} errno/rofs
{error code} errno/exist
{error code} errno/wouldblock

These variables contain error codes as returned by errno.

Finding files

{procedure} find-files

Recursively traverses the contents of DIRECTORY (which should be a string) and invokes the procedure ACTION for all files for which the procedure PREDICATE is true. PREDICATE may me a procedure of one argument or a regular-expression string. ACTION should be a procedure of two arguments: the currently encountered file and the result of the previous invocation of ACTION, or, if this is the first invocation, the value of IDENTITY. ACTION defaults to cons, IDENTITY defaults to (). LIMIT should a procedure of one argument that is called for each nested directory and which should return true, if that directory is to be traversed recursively. LIMIT may also be an exact integer that gives the maximum recursion depth. A depth of 0 means the files in the specified directory are traversed but not any nested directories. LIMIT may also be #f (the default), which is equivalent to (constantly #t).

Note that ACTION is called with the full pathname of each file, including the directory prefix.

Getting the hostname and system information

{procedure} get-host-name

Returns the hostname of the machine that this process is running on.

{procedure} system-information

Invokes the UNIX system call uname() and returns a list of 5 values: system-name, node-name, OS release, OS version and machine.

Setting the file buffering mode

{procedure} set-buffering-mode!
(set-buffering-mode! PORT MODE [BUFSIZE])

Sets the buffering-mode for the file associated with PORT to MODE, which should be one of the keywords #:full, #:line or #:none. If BUFSIZE is specified it determines the size of the buffer to be used (if any).

Terminal ports

{procedure} terminal-name
(terminal-name PORT)

Returns the name of the terminal that is connected to PORT.

{procedure} terminal-port?
(terminal-port? PORT)

Returns #t if PORT is connected to a terminal and #f otherwise.

How Scheme procedures relate to UNIX C functions

change-directory chdir
change-file-mode chmod
change-file-owner chown
create-directory mkdir
create-fifo mkfifo
create-pipe pipe
create-session setsid
create-symbolic-link link
current-directory curdir
current-effective-groupd-id getegid
current-effective-user-id geteuid
current-group-id getgid
current-parent-id getppid
current-process-id getpid
current-user-id getuid
delete-directory rmdir
duplicate-fileno dup/dup2
_exit _exit
file-close close
file-access-time stat
file-change-time stat
file-modification-time stat
file-execute-access? access
file-open open
file-lock fcntl
file-position ftell/lseek
file-read read
file-read-access? access
file-select select
file-stat stat
file-test-lock fcntl
file-truncate truncate/ftruncate
file-unlock fcntl
file-write write
file-write-access? access
get-groups getgroups
get-host-name gethostname
initialize-groups initgroups
local-time->seconds mktime
local-timezone-abbreviation localtime
map-file-to-memory mmap
open-input-file* fdopen
open-output-file* fdopen
open-input-pipe popen
open-output-pipe popen
port->fileno fileno
process-execute execvp
process-fork fork
process-group-id getpgid
process-signal kill
process-wait waitpid
close-input-pipe pclose
close-output-pipe pclose
read-symbolic-link readlink
seconds->local-time localtime
seconds->string ctime
seconds->utc-time gmtime
set-alarm! alarm
set-buffering-mode! setvbuf
set-file-position! fseek/seek
set-groups! setgroups
set-signal-mask! sigprocmask
set-group-id! setgid
set-process-group-id! setpgid
set-user-id! setuid
set-root-directory! chroot
setenv setenv/putenv
sleep sleep
system-information uname
terminal-name ttyname
terminal-port? isatty
time->string asctime
unsetenv putenv
unmap-file-from-memory munmap
user-information getpwnam/getpwuid
utc-time->seconds timegm

Windows specific notes

The following definitions are not supported for native Windows builds (compiled with the Microsoft tools or with MingW):

open/noctty  open/nonblock  open/fsync  open/sync
perm/isvtx  perm/isuid  perm/isgid
set-signal-handler!  set-signal-mask!
user-information  group-information  get-groups  set-groups!  initialize-groups
current-user-id  current-group-id  current-effective-user-id  current-effective-groupd-id
set-user-id!  set-group-id!
process-group-id  set-process-group-id!
create-symbolic-link  read-symbolic-link
file-lock  file-lock/blocking  file-unlock  file-test-lock
create-fifo  fifo?
map-file-to-memory  unmap-file-from-memory  memory-mapped-file-pointer  memory-mapped-file?
terminal-port?  terminal-name
process-fork  process-signal
utc-time->seconds local-timezone-abbreviation

Additionally, the following definitions are only available for Windows:

{spawn mode} spawn/overlay
{spawn mode} spawn/wait
{spawn mode} spawn/nowait
{spawn mode} spawn/nowaito
{spawn mode} spawn/detach

These variables contains special flags that specify the exact semantics of process-spawn: spawn/overlay replaces the current process with the new one. spawn/wait suspends execution of the current process until the spawned process returns. spawn/nowait does the opposite (spawn/nowaito is identical, according to the Microsoft documentation) and runs the process asynchronously. spawn/detach runs the new process in the background, without being attached to a console.

{procedure} process-spawn
(process-spawn MODE FILENAME ARGUMENT ...)

Creates and runs a new process with the given filename and command-line arguments. MODE specifies how exactly the process should be executed and must be one or more of the spawn/... flags defined above.