... |
... |
@@ -2748,9 +2748,12 @@ |
2748
|
2748
|
|
2749
|
2749
|
#+linux
|
2750
|
2750
|
(defun unix-getpwuid (uid)
|
2751
|
|
- _N"Return a USER-INFO structure for the user identified by UID, or NIL if not found."
|
|
2751
|
+ "Return a USER-INFO structure for the user identified by UID. If
|
|
2752
|
+ not found, NIL is returned with a second value indicating the cause
|
|
2753
|
+ of the failure. In particular, if the second value is 0 (or
|
|
2754
|
+ ENONENT, ESRCH, EBADF, etc.), then the uid was not found."
|
2752
|
2755
|
(declare (type unix-uid uid))
|
2753
|
|
- (with-alien ((buf (array c-call:char 1024))
|
|
2756
|
+ (with-alien ((buf (array c-call:char 16384))
|
2754
|
2757
|
(user-info (struct passwd))
|
2755
|
2758
|
(result (* (struct passwd))))
|
2756
|
2759
|
(let ((returned
|
... |
... |
@@ -2767,15 +2770,16 @@ |
2767
|
2770
|
(cast buf (* c-call:char))
|
2768
|
2771
|
1024
|
2769
|
2772
|
(addr result))))
|
2770
|
|
- (when (zerop returned)
|
2771
|
|
- (make-user-info
|
2772
|
|
- :name (string (cast (slot result 'pw-name) c-call:c-string))
|
2773
|
|
- :password (string (cast (slot result 'pw-passwd) c-call:c-string))
|
2774
|
|
- :uid (slot result 'pw-uid)
|
2775
|
|
- :gid (slot result 'pw-gid)
|
2776
|
|
- :gecos (string (cast (slot result 'pw-gecos) c-call:c-string))
|
2777
|
|
- :dir (string (cast (slot result 'pw-dir) c-call:c-string))
|
2778
|
|
- :shell (string (cast (slot result 'pw-shell) c-call:c-string)))))))
|
|
2773
|
+ (if (not (zerop (sap-int (alien-sap result))))
|
|
2774
|
+ (make-user-info
|
|
2775
|
+ :name (string (cast (slot result 'pw-name) c-call:c-string))
|
|
2776
|
+ :password (string (cast (slot result 'pw-passwd) c-call:c-string))
|
|
2777
|
+ :uid (slot result 'pw-uid)
|
|
2778
|
+ :gid (slot result 'pw-gid)
|
|
2779
|
+ :gecos (string (cast (slot result 'pw-gecos) c-call:c-string))
|
|
2780
|
+ :dir (string (cast (slot result 'pw-dir) c-call:c-string))
|
|
2781
|
+ :shell (string (cast (slot result 'pw-shell) c-call:c-string)))
|
|
2782
|
+ (values nil returned)))))
|
2779
|
2783
|
|
2780
|
2784
|
;;; Getrusage is not provided in the C library on Solaris 2.4, and is
|
2781
|
2785
|
;;; rather slow on later versions so the "times" system call is
|