diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2015-04-10 22:18:50 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2015-04-10 22:18:50 -0700 |
commit | 6a350fd788f3114629c9993aa4d1ec5c292182f5 (patch) | |
tree | 5b2319bf1f8d7144bfadcf9055264e809017e750 /txr.1 | |
parent | cc9bd9efeb1a0b49819e086020c09656abeac768 (diff) | |
download | txr-6a350fd788f3114629c9993aa4d1ec5c292182f5.tar.gz txr-6a350fd788f3114629c9993aa4d1ec5c292182f5.tar.bz2 txr-6a350fd788f3114629c9993aa4d1ec5c292182f5.zip |
Functions open-fileno and fileno.
* stream.c (fd_k): New keyword variable.
(stdio_get_prop): Handle the :fd property by returning
the file descriptor.
(open_fileno): New function.
(stream_init): Initialize fd_k, and register fileno and open-fileno.
* stream.h (open_fileno): Declared.
* txr.1: Documented open-fileno and fileno.
* utf8.c (w_fdopen): New function.
* utf8.h (w_fdopen): Declared.
Diffstat (limited to 'txr.1')
-rw-r--r-- | txr.1 | 36 |
1 files changed, 36 insertions, 0 deletions
@@ -24816,6 +24816,42 @@ or .codn nil , rather than zero or nonzero. The others return integer values. +.SS* Unix File Descriptors + +.coNP Function @ open-fileno +.synb +.mets (open-fileno < file-descriptor <> [ mode-string ]) +.syne +The +.code open-fileno +function creates a \*(TX stream over a file descriptor. The +.meta file-descriptor +argument must be an integer denoting a valid file descriptor. + +For a description of +.metn mode-string , +see the +.code open-file +function. + +.coNP Function @ fileno +.synb +.mets (fileno << stream ) +.syne +.desc +The +.code fileno +function returns the underlying file descriptor of +.metn stream , +if it has one. Otherwise, it returns +.codn nil. + +This is equivalent to querying the stream using +.code stream-get-prop +for the +.code :fd +property. + .SS* Unix Itimers Itimers ("interval timers") can be used in combination with signal handling to execute asynchronous actions. Itimers deliver delayed, one-time signals, |