Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo


Diff of /src/code/misc-aliens.lisp [9c7932] .. [a18f0a] Maximize Restore

  Switch to side-by-side view

--- a/src/code/misc-aliens.lisp
+++ b/src/code/misc-aliens.lisp
@@ -16,3 +16,11 @@
   (dest (* char))
   (src (* char))
   (n unsigned-int))
+(def-alien-routine ("os_get_errno" get-errno) integer)
+(setf (fdocumentation 'get-errno 'function)
+      "Return the value of the C library pseudo-variable named \"errno\".")
+;;; Decode errno into a string.
+(defun strerror (&optional (errno (get-errno)))
+  (alien-funcall (extern-alien "strerror" (function c-string int)) errno))