gcl-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gcl-devel] Re: random shots in the dark


From: Camm Maguire
Subject: [Gcl-devel] Re: random shots in the dark
Date: 07 Mar 2006 07:13:59 -0500
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

Robert Boyer <address@hidden> writes:

> 1.  It might be best, given the huge number of message that we are getting
> during the tk/tcl static build about dynamic libraries, to always build GCL's
> gcltkaux with shared libraries, even when building the main image "static".
> Just following up on an observation of yours.
> 

Greetings!  Agreed.  Should be a somewhat tedious but straightforward
configure.in issue.

> 2.  It may be that I have indirectly introduce the bug that causes the first
> load in the ANSI tests to consume the second.  Maybe in some newly introduced
> error recovery hack, *standard-input* is being flushed?  So this introduces
> the very annoying question of just when error processing can flush
> *standard-input*.  Can you tell in the error break whether you are underneath
> a serious user error handler?

Will look into this possibility.  Terminal io on stdin is
distinguishable from input redirected from a file, so this is
treatable is present.  I thought this was already the case, but I'm
speaking just from memory at this point.

> 
> 3.  Assuming that we build gcltkaux dynamic, it might be the case that
> calling it to get answers to such questions as those below would be an easy
> thing to do (for Camm).
> 

Thanks for the below.  IMHO, they are just fine from any performance
standpoint -- it is just that these functions are extremely system
specific, and we have to think about windows and macosx at least.
tmpdir detection might be moved out of compiler to this end.  As for
password lookups, possibilities also include nis+ (no readable ypcat)
and kerberos (via the dns if memory serves) -- libc gives a standard
wrapper around all of this.  Still, a small auxiliary dynamic
executable called via system will work, but then alas we lose the
portability of a single image, and introduce your old complaints about
autoloading.   If we really care about this, we can write and compile
the auxiliary from with GCL on the fly!

Take care,

> Bob
> 
> I think that these are approximate redefinitions to the functions that a
> static GCL still needs.  Getting their values from a dynamic gcltkaux might
> be a reliable, general, slow solution.
> 
> (defun user-homedir-pathname (&optional host)
>   (declare (ignore host))
>   (pathname (concatenate 'string (si::getenv "HOME") "/")))
> 
> (defun si::hostid-to-hostname (str)
>   (let ((file (format nil "/tmp/~ahostid-to-hostname.text" (si::getpid))))
>     (si::system (format nil "/usr/bin/host ~a > ~a"
>                         str file))
>     (prog1 (with-open-file (st file :direction :input)
>              ; output seems to start with "Name: "
>              (loop for i below 6 do (read-char st))
>              (read-line st))
>       (delete-file file))))
>       
> (defun si::hostname-to-hostid (str)
>   (let ((file (format nil "/tmp/~ahostname-to-hostid.text" (si::getpid))))
>     (si::system (format nil "/usr/bin/host ~a > ~a"
>                         str file))
>     (let ((str (si::file-to-string file)))
>       (prog1 (subseq str
>                      (+ 1 (search (string #\Tab) str :from-end t))
>                      (- (length str) 1))
>         (delete-file file)))))
> 
> (defun si::getpwnam (str)
>   ; returns a Lisp string reminiscent of what getpwnam returns
>   (let ((file (format nil "/tmp/~agetpwnamfile.text" (si::getpid)))
>         (tem 0))
>     (si::system (format nil "echo > ~a ; cat /etc/passwd >> ~a; ypcat passwd 
> >> ~a"
>                         file file file))
>     (let ((lstr (si::file-to-string file)))
>       (prog1 (subseq lstr
>                      (setq tem (+ 1 (search (concatenate 'string (string 
> #\Newline) str ":")
>                                             lstr)))
>                      (search (string #\Newline) lstr :start2 tem))
>         (delete-file file)))))
> 
> (defun si::getpwuid (str)
>   ; returns a Lisp string reminiscent of what getpwuid returns
>   (let ((file (format nil "/tmp/~agetpwuidfile.text" (si::getpid)))
>         (tem 0))
>     (si::system (format nil "echo > ~a ; cat /etc/passwd >> ~a; ypcat passwd 
> >> ~a"
>                         file file file))
>     (let ((lstr (si::file-to-string file)))
>       (setq *lstr* lstr)
>       (prog1 (subseq lstr
>                      (setq tem (+ 1 (si::string-match
>                                        (concatenate 'string
>                                                     (string #\Newline)
>                                                     "[^\n]*:"
>                                                     str
>                                                     ":")
>                                             lstr)))
>                      (search (string #\Newline) lstr :start2 tem))
>         (delete-file file)))))
> 
> 
> 
> 
> 

-- 
Camm Maguire                                            address@hidden
==========================================================================
"The earth is but one country, and mankind its citizens."  --  Baha'u'llah




reply via email to

[Prev in Thread] Current Thread [Next in Thread]