- 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
- detach_IO(+Stream) is det
- This predicate is intended to create Unix deamon processes. It
performs two actions.
- The I/O streams
user_input
,user_output
anduser_error
are closed if they are connected to a terminal (seetty
property in stream_property/2). Input streams are rebound to a dummy stream that returns EOF. Output streams are reboud to forward their output to Stream. - The process is detached from the current process-group and
its controlling terminal. This is achieved using
setsid()
if provided or usingioctl()
TIOCNOTTY
on/dev/tty
.
To ignore all output, it may be rebound to a null stream. For example:
..., open_null_stream(Out), detach_IO(Out).
The detach_IO/1 should be called only once per process. Subsequent calls silently succeed without any side effects.
- See also
- - detach_IO/0 and library(syslog).
- The I/O streams