Changeset 14432
- Timestamp:
- Nov 14, 2010, 5:10:38 PM (14 years ago)
- Location:
- trunk/source
- Files:
-
- 2 edited
-
level-0/l0-cfm-support.lisp (modified) (5 diffs)
-
level-1/linux-files.lisp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/level-0/l0-cfm-support.lisp
r14288 r14432 479 479 (defvar *get-module-handle-ex-addr*) 480 480 481 (defun nbackslash-to-forward-slash (namestring) 482 (dotimes (i (length namestring) namestring) 483 (when (eql (schar namestring i) #\\) 484 (setf (schar namestring i) #\/)))) 481 485 482 486 (defun init-windows-ffi () … … 491 495 492 496 (defun hmodule-pathname (hmodule) 493 (do* ((bufsize 64))497 (do* ((bufsize 128)) 494 498 () 495 499 (%stack-block ((name bufsize)) 496 500 (let* ((needed (ff-call *get-module-file-name-addr* 497 :address *current-process-handle*498 501 :address hmodule 499 502 :address name … … 502 505 (if (eql 0 needed) 503 506 (return nil) 504 (if (< bufsize needed)505 (setq bufsize needed)506 (return ( %str-from-ptr name needed))))))))507 (if (<= bufsize needed) 508 (setq bufsize (+ bufsize bufsize)) 509 (return (nbackslash-to-forward-slash (%str-from-ptr name needed))))))))) 507 510 508 511 (defun hmodule-basename (hmodule) … … 594 597 (values nil (%windows-error-string (get-last-windows-error)))))) 595 598 596 (init-shared-libraries) 599 (init-shared-libraries) 600 601 (defun revive-shared-libraries () 602 (dolist (lib *shared-libraries*) 603 (setf (shlib.map lib) nil 604 (shlib.handle lib) nil 605 (shlib.pathname lib) nil 606 (shlib.base lib) nil) 607 (let* ((soname (shlib.soname lib)) 608 (soname-len (length soname))) 609 (block found 610 (for-each-loaded-module 611 (lambda (m) 612 (let* ((module-soname (hmodule-basename m))) 613 (when (%simple-string= soname module-soname 0 0 soname-len (length module-soname)) 614 (let* ((m (%inc-ptr m 0))) 615 (setf (shlib.base lib) m 616 (shlib.map lib) m 617 (shlib.pathname lib) (hmodule-pathname m))) 618 (return-from found))))))))) 619 620 (defun reopen-user-libraries () 621 (dolist (lib *shared-libraries*) 622 (unless (shlib.map lib) 623 (let* ((handle (with-cstrs ((name (shlib.soname lib))) 624 (ff-call 625 (%kernel-import target::kernel-import-GetSharedLibrary) 626 :address name 627 :unsigned-fullword 0 628 :address)))) 629 (unless (%null-ptr-p handle) 630 (setf (shlib.handle lib) handle 631 (shlib.base lib) handle 632 (shlib.map lib) handle 633 (shlib.pathname lib) (hmodule-pathname handle) 634 (shlib.opencount lib) 1)))))) 635 636 597 637 598 638 ;;; end windows-target 599 )639 ) 600 640 601 641 … … 959 999 (reopen-user-libraries)) 960 1000 #+windows-target 961 (init-windows-ffi) 1001 (progn 1002 (init-windows-ffi) 1003 (revive-shared-libraries) 1004 (reopen-user-libraries)) 962 1005 (when *eeps* 963 1006 (without-interrupts -
trunk/source/level-1/linux-files.lisp
r14404 r14432 26 26 27 27 28 (defun nbackslash-to-forward-slash (namestring) 29 (dotimes (i (length namestring) namestring) 30 (when (eql (schar namestring i) #\\) 31 (setf (schar namestring i) #\/)))) 28 32 29 33 30 (defconstant univeral-time-start-in-windows-seconds 9435484800)
Note:
See TracChangeset
for help on using the changeset viewer.
