Raymond Toy pushed to branch issue-365-add-strerror at cmucl / cmucl
Commits:
-
8c703d45
by Raymond Toy at 2025-02-15T07:34:51-08:00
-
3e9e71b0
by Raymond Toy at 2025-02-15T07:35:00-08:00
2 changed files:
Changes:
... | ... | @@ -2628,9 +2628,20 @@ |
2628 | 2628 | |
2629 | 2629 | (defun unix-strerror (errno)
|
2630 | 2630 | _N"Returns a string that describes the error code Errno"
|
2631 | - (cast
|
|
2632 | - (alien-funcall
|
|
2633 | - (extern-alien "strerror"
|
|
2634 | - (function (* char) int))
|
|
2635 | - errno)
|
|
2636 | - c-string)) |
|
2631 | + (let ((result
|
|
2632 | + (alien-funcall
|
|
2633 | + (extern-alien "strerror"
|
|
2634 | + (function (* unsigned-char) int))
|
|
2635 | + errno)))
|
|
2636 | + ;; We need to convert the set of octets to a Lisp string according
|
|
2637 | + ;; to the appropriate external format. Copy the C string out to
|
|
2638 | + ;; an array which we can then convert to a string.
|
|
2639 | + (let* ((octets (make-array 100 :element-type '(unsigned-byte 8) :fill-pointer 0)))
|
|
2640 | + (loop for k from 0
|
|
2641 | + for byte = (deref result k)
|
|
2642 | + until (zerop byte)
|
|
2643 | + do
|
|
2644 | + (vector-push-extend byte octets))
|
|
2645 | + (lisp::with-array-data ((data octets) (start) (end))
|
|
2646 | + (declare (ignore start end))
|
|
2647 | + (values (stream:octets-to-string data :end (length octets))))))) |
... | ... | @@ -6209,7 +6209,7 @@ msgid "Same as -help." |
6209 | 6209 | msgstr ""
|
6210 | 6210 | |
6211 | 6211 | #: src/code/commandline.lisp
|
6212 | -msgid "Prints the cmucl version and exits"
|
|
6212 | +msgid "Prints the cmucl version and exits, without loading the lisp core."
|
|
6213 | 6213 | msgstr ""
|
6214 | 6214 | |
6215 | 6215 | #: src/code/commandline.lisp
|