errno {
{ EINTR [ 2drop +retry+ ] }
{ EAGAIN [ 2drop +input+ ] }
- [ throw-errno ]
+ [ (throw-errno) ]
} case
] if ;
errno {
{ EINTR [ 2drop +retry+ ] }
{ EAGAIN [ 2drop +output+ ] }
- [ throw-errno ]
+ [ (throw-errno) ]
} case
] if ;
: next-dirent ( DIR* dirent* -- dirent* ? )
f void* <ref> [
- readdir64_r [ dup strerror libc-error ] unless-zero
+ readdir64_r [ (throw-errno) ] unless-zero
] 2keep void* deref ; inline
M: linux (directory-entries) ( path -- seq )
: next-dirent ( DIR* dirent* -- dirent* ? )
f void* <ref> [
- readdir_r [ dup strerror libc-error ] unless-zero
+ readdir_r [ (throw-errno) ] unless-zero
] 2keep void* deref ; inline
: >directory-entry ( dirent* -- directory-entry )
errno {
{ EAGAIN [ wait-for-output ] }
{ EINTR [ wait-to-connect ] }
- [ throw-errno ]
+ [ (throw-errno) ]
} case
] if ;
errno {
{ EINTR [ establish-connection ] }
{ EINPROGRESS [ drop wait-for-output ] }
- [ throw-errno ]
+ [ (throw-errno) ]
} case
] if ;
[ (accept) ]
2bi
] }
- [ throw-errno ]
+ [ (throw-errno) ]
} case
] if ;
datagram +output+ wait-for-port
packet sockaddr len socket datagram do-send
] }
- [ throw-errno ]
+ [ (throw-errno) ]
} case
] when ; inline recursive
ERROR: libc-error errno message ;
-: throw-errno ( -- * ) errno dup strerror libc-error ;
+: (throw-errno) ( errno -- * ) dup strerror libc-error ;
+
+: throw-errno ( -- * ) errno (throw-errno) ;
: io-error ( n -- ) 0 < [ throw-errno ] when ;