- ext
- clib
- socket.pl -- Network socket (TCP and UDP) library
- uid.pl -- User and group management on Unix systems
- unix.pl -- Unix specific operations
- syslog.pl
- filesex.pl -- Extended operations on files
- uri.pl -- Process URIs
- process.pl -- Create processes and redirect I/O
- time.pl -- Time and alarm library
- sha.pl -- SHA secure hashes
- crypt.pl
- memfile.pl
- uuid.pl -- Universally Unique Identifier (UUID) Library
- hash_stream.pl -- Maintain a hash on a stream
- md5.pl -- MD5 hashes
- streampool.pl -- Input multiplexing
- cgi.pl -- Read CGI parameters
- prolog_stream.pl -- A stream with Prolog callbacks
- udp_broadcast.pl -- A UDP broadcast proxy
- rlimit.pl
- clib
- fork(-Pid) is det
- Clone the current process into two branches. In the child, Pid
is unified to child. In the original process, Pid is unified to
the process identifier of the created child. Both parent and
child are fully functional Prolog processes running the same
program. The processes share open I/O streams that refer to Unix
native streams, such as files, sockets and pipes. Data is not
shared, though on most Unix systems data is initially shared and
duplicated only if one of the programs attempts to modify the
data.
Unix
fork()
is the only way to create new processes and fork/1 is a simple direct interface to it.- Errors
- -
permission_error(fork, process, main)
is raised if the calling thread is not the only thread in the process. Forking a Prolog process with threads will typically deadlock because only the calling thread is cloned in the fork, while all thread synchronization are cloned.