Loading posix/basic-unix.lisp +7 −0 Original line number Diff line number Diff line Loading @@ -44,7 +44,14 @@ (let ((errno (if (keywordp err) (foreign-enum-value 'errno-values err) err))) #-linux ; XSI-compliant strerror_r() always stores the error ; message in the user-supplied buffer. (with-foreign-pointer-as-string ((buf bufsiz) 1024) (strerror-r errno buf bufsiz)) #+linux ; GNU strerror_r() doesn't always store the error message ; in the user-supplied buffer, but it returns a string ; instead of an int. (with-foreign-pointer (buf 1024 bufsiz) (strerror-r errno buf bufsiz)))) (defmethod print-object ((posix-error posix-error) stream) Loading posix/wrappers.lisp +4 −1 Original line number Diff line number Diff line Loading @@ -157,8 +157,11 @@ "errno = value;" "return errno;") ;; Note: since we define _GNU_SOURCE on Linux (to get at mremap()), we ;; get the GNU version of strerror_r() which doesn't always store the ;; result in `buf'. #-windows (defwrapper "strerror_r" :int (defwrapper "strerror_r" #+linux :string #-linux :int (errnum :int) (buf :string) (buflen ("size_t" size))) Loading Loading
posix/basic-unix.lisp +7 −0 Original line number Diff line number Diff line Loading @@ -44,7 +44,14 @@ (let ((errno (if (keywordp err) (foreign-enum-value 'errno-values err) err))) #-linux ; XSI-compliant strerror_r() always stores the error ; message in the user-supplied buffer. (with-foreign-pointer-as-string ((buf bufsiz) 1024) (strerror-r errno buf bufsiz)) #+linux ; GNU strerror_r() doesn't always store the error message ; in the user-supplied buffer, but it returns a string ; instead of an int. (with-foreign-pointer (buf 1024 bufsiz) (strerror-r errno buf bufsiz)))) (defmethod print-object ((posix-error posix-error) stream) Loading
posix/wrappers.lisp +4 −1 Original line number Diff line number Diff line Loading @@ -157,8 +157,11 @@ "errno = value;" "return errno;") ;; Note: since we define _GNU_SOURCE on Linux (to get at mremap()), we ;; get the GNU version of strerror_r() which doesn't always store the ;; result in `buf'. #-windows (defwrapper "strerror_r" :int (defwrapper "strerror_r" #+linux :string #-linux :int (errnum :int) (buf :string) (buflen ("size_t" size))) Loading