Handbook
Glossary
refill-stdin ( buffer stdin size -- )
Vocabulary
io
.
backend
.
unix
Inputs
buffer
an
object
stdin
an
object
size
an
object
Outputs
None
Definition
USING:
accessors
io.buffers
kernel
libc
math
unix.ffi
;
IN:
io.backend.unix
::
refill-stdin
( buffer stdin size -- )
stdin
data>>
handle-fd
buffer
buffer-end
size
read
dup
0
<
[
drop
errno
EINTR
=
[
buffer stdin size
refill-stdin
]
[
throw-errno
]
if
]
[
size
=
[
"Error reading stdin pipe"
throw
]
unless
size buffer
buffer+
]
if
;