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.

File:
1 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)
Note: See TracChangeset for help on using the changeset viewer.