From 64d81cdad8d38bca760c932062c8f1ac85afa8dd Mon Sep 17 00:00:00 2001 From: Eitaro Fukamachi Date: Sun, 11 Aug 2024 16:05:45 +0000 Subject: [PATCH] Fix I/O error codes. (fixes #103) --- src/syscall/main.lisp | 10 ---------- src/syscall/types.lisp | 11 ++++++++++- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/syscall/main.lisp b/src/syscall/main.lisp index b16a813..ff67e93 100644 --- a/src/syscall/main.lisp +++ b/src/syscall/main.lisp @@ -43,16 +43,6 @@ (defconstant F-SETFL 4.) (defconstant O-NONBLOCK 4.) -(defconstant EWOULDBLOCK 35.) -(defconstant EPIPE 32.) -(defconstant EINTR 4.) -(defconstant EPROTO 100.) -(defconstant ECONNABORTED 53.) -(defconstant ECONNREFUSED 61.) -(defconstant ECONNRESET 54.) -(defconstant ENOTCONN 57.) -(defconstant EAGAIN 11.) - (defun set-fd-nonblock (fd enabled) (declare (optimize (speed 3) (safety 0))) (let ((current-flags (%fcntl/noarg fd F-GETFL))) diff --git a/src/syscall/types.lisp b/src/syscall/types.lisp index aca90a6..5c5602b 100644 --- a/src/syscall/types.lisp +++ b/src/syscall/types.lisp @@ -1,4 +1,4 @@ -(include "sys/types.h" "sys/fcntl.h") +(include "sys/types.h" "sys/fcntl.h" "errno.h") #+(or freebsd bsd) (include "sys/socket.h") @@ -14,3 +14,12 @@ (constant (+SF-MNOWAIT+ "SF_MNOWAIT")) (constant (+O-RDONLY+ "O_RDONLY")) +(constant (EWOULDBLOCK "EWOULDBLOCK")) +(constant (EPIPE "EPIPE")) +(constant (EINTR "EINTR")) +(constant (EPROTO "EPROTO")) +(constant (ECONNABORTED "ECONNABORTED")) +(constant (ECONNREFUSED "ECONNREFUSED")) +(constant (ECONNRESET "ECONNRESET")) +(constant (ENOTCONN "ENOTCONN")) +(constant (EAGAIN "EAGAIN"))