More robust undefined restarts.
[sbcl.git] / src / code / misc-aliens.lisp
blobf3a55c39e91abf440c092d4f979a63b3ef014b98
1 ;;;; assorted alien definitions
3 ;;;; This software is part of the SBCL system. See the README file for
4 ;;;; more information.
5 ;;;;
6 ;;;; This software is derived from the CMU CL system, which was
7 ;;;; written at Carnegie Mellon University and released into the
8 ;;;; public domain. The software is in the public domain and is
9 ;;;; provided with absolutely no warranty. See the COPYING and CREDITS
10 ;;;; files for more information.
12 (in-package "SB!IMPL")
14 (declaim (inline memmove))
15 (define-alien-routine ("memmove" memmove) void
16 (dest (* char))
17 (src (* char))
18 (n unsigned-int))
20 (define-alien-routine ("os_get_errno" get-errno) integer)
21 (setf (fdocumentation 'get-errno 'function)
22 "Return the value of the C library pseudo-variable named \"errno\".")
24 ;;; Decode errno into a string.
25 #!-win32
26 (defun strerror (&optional (errno (get-errno)))
27 (alien-funcall (extern-alien "strerror" (function c-string int)) errno))
29 #!+win32
30 (defun strerror (&optional (errno (sb!win32:get-last-error)))
31 (sb!win32:format-system-message errno))