Changeset 9212


Ignore:
Timestamp:
Apr 20, 2008, 11:04:52 AM (11 years ago)
Author:
gb
Message:

Use reentrant version of #_readdir.
Need a new canonical foreign-type ordinal for that.
This is a little tricky to bootstrap, so new images.

Location:
trunk/source
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/level-1/linux-files.lisp

    r9007 r9212  
    540540
    541541(defun %read-dir (dir)
    542   (let* ((res (#_readdir dir)))
    543     (unless (%null-ptr-p res)
    544       (get-foreign-namestring (pref res :dirent.d_name)))))
     542  (rlet ((entry #>dirent)
     543         (presult :address +null-ptr+))
     544    (let* ((err (#_readdir_r dir entry presult))
     545           (result (%get-ptr presult)))
     546      (declare (fixnum err) (dynamic-extent result))
     547      (when (zerop err)
     548        (unless (%null-ptr-p result)
     549          (get-foreign-namestring (pref result #>dirent.d_name)))))))
    545550
    546551(defun tcgetpgrp (fd)
  • trunk/source/lib/foreign-types.lisp

    r8541 r9212  
    17131713      (canonicalize-foreign-type-ordinal '(:* (:struct :hostent)))
    17141714      (canonicalize-foreign-type-ordinal '(:array :int 2))
    1715       (canonicalize-foreign-type-ordinal '(:array (:struct :pollfd) 1)))))
     1715      (canonicalize-foreign-type-ordinal '(:array (:struct :pollfd) 1))
     1716      (canonicalize-foreign-type-ordinal '(:struct :dirent)))))
    17161717
    17171718(defun install-standard-foreign-types (ftd)
Note: See TracChangeset for help on using the changeset viewer.