... |
... |
@@ -2540,14 +2540,24 @@ |
2540
|
2540
|
(unwind-protect
|
2541
|
2541
|
(progn
|
2542
|
2542
|
(setf result
|
2543
|
|
- (alien-funcall
|
2544
|
|
- (extern-alien "os_getpwuid"
|
2545
|
|
- (function (* (struct passwd))
|
2546
|
|
- uid-t))
|
2547
|
|
- uid))
|
|
2543
|
+ (locally
|
|
2544
|
+ ;; Inhibit warnings about not being able to
|
|
2545
|
+ ;; optimize away %sap-alien and doing runtime
|
|
2546
|
+ ;; allocation.
|
|
2547
|
+ (declare (optimize (ext:inhibit-warnings 3)))
|
|
2548
|
+ (alien-funcall
|
|
2549
|
+ (extern-alien "os_getpwuid"
|
|
2550
|
+ (function (* (struct passwd))
|
|
2551
|
+ uid-t))
|
|
2552
|
+ uid)))
|
2548
|
2553
|
(if (null-alien result)
|
2549
|
2554
|
(values nil (unix-errno))
|
2550
|
|
- (let ((passwd (deref result)))
|
|
2555
|
+ (let ((passwd (locally
|
|
2556
|
+ ;; Inhibit warnings about not being able to
|
|
2557
|
+ ;; optimize away %sap-alien and doing runtime
|
|
2558
|
+ ;; allocation.
|
|
2559
|
+ (declare (optimize (ext:inhibit-warnings 3)))
|
|
2560
|
+ (deref result))))
|
2551
|
2561
|
(make-user-info
|
2552
|
2562
|
:name (string (cast (slot passwd 'pw-name) c-call:c-string))
|
2553
|
2563
|
:password (string (cast (slot passwd 'pw-passwd) c-call:c-string))
|
... |
... |
@@ -2557,16 +2567,14 @@ |
2557
|
2567
|
:gecos (string-decode (cast (slot passwd 'pw-gecos) c-call:c-string)
|
2558
|
2568
|
:default)
|
2559
|
2569
|
;; The home directory could be unicode
|
2560
|
|
- :dir (%file->name (cast (slot passwd 'pw-dir) c-call:c-string))
|
|
2570
|
+ :dir (%file->name (string (cast (slot passwd 'pw-dir) c-call:c-string)))
|
2561
|
2571
|
:shell (string (cast (slot passwd 'pw-shell) c-call:c-string))))))
|
2562
|
2572
|
(unless (null-alien result)
|
2563
|
|
- (let ((passwd (deref result)))
|
2564
|
|
- (free-alien (slot passwd 'pw-name))
|
2565
|
|
- (free-alien (slot passwd 'pw-passwd))
|
2566
|
|
- (free-alien (slot passwd 'pw-gecos))
|
2567
|
|
- (free-alien (slot passwd 'pw-dir))
|
2568
|
|
- (free-alien (slot passwd 'pw-shell)))
|
2569
|
|
- (free-alien result))))))
|
|
2573
|
+ (alien-funcall
|
|
2574
|
+ (extern-alien "os_free_getpwuid"
|
|
2575
|
+ (function c-call:void
|
|
2576
|
+ (* (struct passwd))))
|
|
2577
|
+ result))))))
|
2570
|
2578
|
|
2571
|
2579
|
|
2572
|
2580
|
;;; Getrusage is not provided in the C library on Solaris 2.4, and is
|