Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export error codes #1056

Merged
merged 1 commit into from
Nov 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
115 changes: 75 additions & 40 deletions src/std/os/error.ss
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,45 @@
check-ptr
foreign-allocation-error?
strerror
E2BIG
EACCES
EAGAIN
EINTR
EINPROGRESS
EWOULDBLOCK
EBADF
EBUSY
ECHILD
ECONNABORTED
ECONNREFUSED
ECONNRESET)
ECONNRESET
EDOM
EEXIST
EFAULT
EFBIG
EINPROGRESS
EINTR
EINVAL
EIO
EISDIR
EMFILE
EMLINK
ENFILE
ENODEV
ENOENT
ENOEXEC
ENOMEM
ENOSPC
ENOTBLK
ENOTDIR
ENOTTY
ENXIO
EPERM
EPIPE
ERANGE
EROFS
ESPIPE
ESRCH
ETXTBSY
EWOULDBLOCK
EXDEV)

(deferror-class OSError (errno) os-error?)
(defrule (raise-os-error where errno irritants ...)
Expand Down Expand Up @@ -59,42 +90,46 @@
(let (r (make arg ...))
(if r r (raise-allocation-error make '(make arg ...))))))

(begin-ffi (strerror EINPROGRESS EWOULDBLOCK
ECONNABORTED ECONNREFUSED ECONNRESET
EPERM
ENOENT
ESRCH
EINTR
EIO
ENXIO
E2BIG
ENOEXEC
EBADF
ECHILD
EAGAIN
ENOMEM
EACCES
EFAULT
ENOTBLK
EBUSY
EEXIST
EXDEV
ENODEV
ENOTDIR
EISDIR
EINVAL
ENFILE
EMFILE
ENOTTY
ETXTBSY
EFBIG
ENOSPC
ESPIPE
EROFS
EMLINK
EPIPE
EDOM
ERANGE)
(begin-ffi (strerror
E2BIG
EACCES
EAGAIN
EBADF
EBUSY
ECHILD
ECONNABORTED
ECONNREFUSED
ECONNRESET
EDOM
EEXIST
EFAULT
EFBIG
EINPROGRESS
EINTR
EINVAL
EIO
EISDIR
EMFILE
EMLINK
ENFILE
ENODEV
ENOENT
ENOEXEC
ENOMEM
ENOSPC
ENOTBLK
ENOTDIR
ENOTTY
ENXIO
EPERM
EPIPE
ERANGE
EROFS
ESPIPE
ESRCH
ETXTBSY
EWOULDBLOCK
EXDEV)
(c-declare "#include <errno.h>")
(c-declare "#include <string.h>")

Expand Down