Ignore:
Timestamp:
Feb 25, 2008, 11:40:45 AM (12 years ago)
Author:
gb
Message:

On ELF platforms, distinguish between link-map and handle returned
by #_dlopen. (They're EQL on Linux but differ on FreeBSD.) Note
that we only set the handle for libraries opened explicitly by
user code, which allows us to usurp the old opened-by-lisp-kernel
slot.

Ensure that CLOSE-SHARED-LIBRARY is defined on FreeBSD; make the ELF
version call #_dlclose on the handle if it exists, not the link map.

File:
1 edited

Legend:

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

    r8487 r8587  
    596596
    597597;;; Kind of has something to do with files, and doesn't work in level-0.
    598 #+linux-target
     598#+(or linux-target freebsd-target)
    599599(defun close-shared-library (lib &key (completely t))
    600600  "If completely is T, set the reference count of library to 0. Otherwise,
     
    606606                    (error "Shared library ~s not found." lib))
    607607                (require-type lib 'shlib)))
    608          (map (shlib.map lib)))
    609     (unless (shlib.opened-by-lisp-kernel lib)
    610       (when map
     608         (handle (shlib.handle lib)))
     609      (when handle
    611610        (let* ((found nil)
    612611               (base (shlib.base lib)))
    613612          (do* ()
    614613               ((progn           
    615                   (#_dlclose map)
     614                  (#_dlclose handle)
    616615                  (or (not (setq found (shlib-containing-address base)))
    617616                      (not completely)))))
     
    619618            (setf (shlib.pathname lib) nil
    620619              (shlib.base lib) nil
     620              (shlib.handle lib) nil
    621621              (shlib.map lib) nil)
    622622            (unload-foreign-variables lib)
    623             (unload-library-entrypoints lib)))))))
     623            (unload-library-entrypoints lib))))))
    624624
    625625#+darwin-target
Note: See TracChangeset for help on using the changeset viewer.