Raymond Toy pushed to branch issue-375-mkstemp-return-filename at cmucl / cmucl
Commits:
-
30c30e87
by Raymond Toy at 2025-02-16T18:48:47-08:00
-
4827d17e
by Raymond Toy at 2025-02-16T18:48:47-08:00
-
70b34d28
by Raymond Toy at 2025-02-16T18:48:47-08:00
2 changed files:
Changes:
| ... | ... | @@ -2921,8 +2921,10 @@ |
| 2921 | 2921 | (with-alien ((buffer (* c-call:unsigned-char)))
|
| 2922 | 2922 | (setf buffer (make-alien c-call:unsigned-char (1+ length)))
|
| 2923 | 2923 | ;; Copy the octets from OCTETS to the null-terminated array BUFFER.
|
| 2924 | - (dotimes (k length)
|
|
| 2925 | - (setf (deref buffer k) (aref octets k)))
|
|
| 2924 | + (system:without-gcing
|
|
| 2925 | + (kernel:system-area-copy (vector-sap octets) 0
|
|
| 2926 | + (alien-sap buffer) 0
|
|
| 2927 | + (* length vm:byte-bits)))
|
|
| 2926 | 2928 | (setf (deref buffer length) 0)
|
| 2927 | 2929 | |
| 2928 | 2930 | (syscall ("mkstemp" (* c-call:char))
|
| ... | ... | @@ -2955,8 +2957,12 @@ |
| 2955 | 2957 | (with-alien ((buffer (* c-call:unsigned-char)))
|
| 2956 | 2958 | (setf buffer (make-alien c-call:unsigned-char (1+ length)))
|
| 2957 | 2959 | ;; Copy the octets from OCTETS to the null-terminated array BUFFER.
|
| 2958 | - (dotimes (k length)
|
|
| 2959 | - (setf (deref buffer k) (aref octets k)))
|
|
| 2960 | + (system:without-gcing
|
|
| 2961 | + (kernel:system-area-copy (vector-sap octets) 0
|
|
| 2962 | + (alien-sap buffer)
|
|
| 2963 | + (* length vm:byte-bits)))
|
|
| 2964 | + (setf (deref buffer length) 0)
|
|
| 2965 | + |
|
| 2960 | 2966 | (let ((result (alien-funcall
|
| 2961 | 2967 | (extern-alien "mkdtemp"
|
| 2962 | 2968 | (function (* char)
|
| ... | ... | @@ -20,7 +20,7 @@ |
| 20 | 20 | (when fd
|
| 21 | 21 | (unix:unix-unlink name)))))
|
| 22 | 22 | |
| 23 | -(define-test mkstemp.name-returned.2
|
|
| 23 | +(define-test mkstemp.non-ascii-name-returned
|
|
| 24 | 24 | (:tag :issues)
|
| 25 | 25 | (let ((unix::*filename-encoding* :utf-8)
|
| 26 | 26 | fd name)
|
| ... | ... | @@ -84,7 +84,7 @@ |
| 84 | 84 | (when name
|
| 85 | 85 | (unix:unix-rmdir name)))))
|
| 86 | 86 | |
| 87 | -(define-test mkdtemp.name-returned.2
|
|
| 87 | +(define-test mkdtemp.non-ascii-name-returned
|
|
| 88 | 88 | (:tag :issues)
|
| 89 | 89 | (let ((unix::*filename-encoding* :utf-8)
|
| 90 | 90 | name)
|