strerror

Synopsis

(strerror error-number)

Parameters

  • error_number : A UNIX error number as typically contained in errno

Description

This procedure looks up the error message string corresponding to an error number and returns the result as a string.

Side Effects

Return Value

The error message as returned by the C-library function strerror() is returned as a string.

See Also

Example

> (strerror (errno))
"Undefined error: 0"
> (define p (open-input-file "unknown"))

ERROR!
 message   : cannot open file
 irritant  : #<primitive-procedure internal-open-input-file>
 expression: fname
 continue  : possible, continue with value as value from primitive

Error (? for help) >>
> (strerror (errno))
"No such file or directory"
> (strerror 22)
"Invalid argument"
>