Ignore:
Timestamp:
Sep 8, 2008, 3:30:50 PM (11 years ago)
Author:
gb
Message:

Don't use syscalls for directory access on windows; use
INT-ERRNO-FFCALL and new kernel imports.

File:
1 edited

Legend:

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

    r10637 r10662  
    661661(defun %open-dir (namestring)
    662662  (with-filename-cstrs ((name namestring))
    663     (let* ((DIR #+windows-target (syscall syscalls::opendir name)
    664                 #-windows-target (#_opendir name)))
     663    (let* ((DIR (ff-call (%kernel-import target::kernel-global-lisp-opendir)
     664                         :address name
     665                         :address)))
    665666      (unless (%null-ptr-p DIR)
    666667        DIR))))
    667668
    668669(defun close-dir (dir)
    669   #+windows-target (syscall syscalls::closedir DIR)
    670   #-windows-target (#_closedir DIR))
    671 
    672 #-windows-target                        ;want a reentrant version, anyhow
     670  (ff-call (%kernel-import target::kernel-global-lisp-closedir)
     671           :address dir
     672           :int))
     673
    673674(defun %read-dir (dir)
    674   (let* ((res (#_readdir dir)))
     675  (let* ((res (ff-call (%kernel-import target::kernel-global-lisp-closedir)
     676                       :address dir
     677                       :address)))
    675678    (unless (%null-ptr-p res)
    676       (get-foreign-namestring (pref res :dirent.d_name)))))
    677 
    678 #+windows-target
    679 (defun %read-dir (dir)
    680   (let* ((res (syscall syscalls::readdir dir)))
    681     (unless (%null-ptr-p res)
    682       (get-foreign-namestring (pref res :_wdirent.d_name)))))
     679      (get-foreign-namestring (pref res
     680                                    #+windows-target :_wdirent.d_name
     681                                    #-windows-target :dirent.d_name)))))
     682
    683683
    684684#-windows-target
Note: See TracChangeset for help on using the changeset viewer.