scsh-hackers
[Top] [All Lists]

[Scsh-hackers] [ scsh-Bugs-407805 ] dynload.c and bsd/waitcodes.scm

To: noreply@sourceforge.net
Subject: [Scsh-hackers] [ scsh-Bugs-407805 ] dynload.c and bsd/waitcodes.scm
From: "SourceForge.net" <noreply@sourceforge.net>
Date: Tue Apr 22 00:39:07 2003
List-id: Discussion among the implementors <scsh-hackers.lists.sourceforge.net>
Sender: scsh-hackers-admin@lists.sourceforge.net
Bugs item #407805, was opened at 2001-03-12 03:25
Message generated for change (Comment added) made by mainzelm
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=110493&aid=407805&group_id=10493

Category: run-time
Group: None
>Status: Closed
>Resolution: Out of Date
Priority: 1
Submitted By: Brian D. Carlstrom (bdc)
Assigned to: Brian D. Carlstrom (bdc)
Summary: dynload.c and bsd/waitcodes.scm

Initial Comment:
From: Alan Bawden <Alan@LCS.MIT.EDU>
Sender: Alan@LCS.MIT.EDU
To: scsh-bugs@martigny.ai.mit.edu
Subject: dynload.c and bsd/waitcodes.scm
Date: Wed, 8 Jan 1997 01:38:28 -0500

Two problems to report in scsh 0.4.4:

------- #1

scsh-0.4.4/dynload.c contains the following code:

    newhandle=dlopen(pathname, S48_DLOPEN_MODE);
  #if defined(__NetBSD__) || defined(__FreeBSD__)
    if (newhandle == -1) {
      fprintf(stderr, " dynamic_load of %s can't 
dlopen %s",
              sharedobjname, pathname);
      return -1;
    };
  #else
    if (!newhandle) {
      fprintf(stderr, " dynamic_load of %s can't 
dlopen %s: %s ",
              sharedobjname, pathname, dlerror());
      return -1;
    };
  #endif

First off, the manual page for dlopen() on FreeBSD 
version 2.1.0
claims that dlopen returns a null pointer if it 
fails.  That manual page
also claims that dlerror() is supported.  I do seem to 
recall that previous
versions of FreeBSD had some undocumented dynamic 
loading support, so
perhaps this code is a hold-over from those old days.  
Probably autoconf
should be figuring this out for you somehow...

Second off, this code generates a compile-time warning 
because of the
comparison between newhandle and -1.  Since this is 
the -only- warning I
got when installing scsh, you might want to achieve 
perfection by replacing
that "-1" with "(void *) -1"!

------- #2

In scsh-0.4.4/scsh/bsd/waitcodes.scm the line:

         (not (= 
#x7F))                                 ; Not suspended.

should probably read:
  
         (not (= #x7F 
termsig))                         ; Not suspended.

------- EOM







----------------------------------------------------------------------

>Comment By: Martin Gasbichler (mainzelm)
Date: 2003-04-22 09:38

Message:
Logged In: YES 
user_id=17553

The reported problem refers to an old version of the FFI.

----------------------------------------------------------------------

Comment By: Brian D. Carlstrom (bdc)
Date: 2001-03-12 03:26

Message:
Logged In: YES 
user_id=27364

From: Martin Cracauer <cracauer@wavehh.hanse.de>
To: Alan Bawden <Alan@LCS.MIT.EDU>
Cc: scsh-bugs@martigny.ai.mit.edu
Subject: dynload.c and bsd/waitcodes.scm
Date: Wed, 8 Jan 97 11:58:39 +0100

Alan Bawden writes:
> Two problems to report in scsh 0.4.4:
>
> ------- #1
>
> scsh-0.4.4/dynload.c contains the following code:
> 
>     newhandle=dlopen(pathname, S48_DLOPEN_MODE);
>   #if defined(__NetBSD__) || defined(__FreeBSD__)
>     if (newhandle == -1) {
>       fprintf(stderr, " dynamic_load of %s can't dlopen %
s",
>             sharedobjname, pathname);
>       return -1;
>     };
>   #else
>     if (!newhandle) {
>       fprintf(stderr, " dynamic_load of %s can't dlopen %
s: %s ",
>             sharedobjname, pathname, dlerror());
>       return -1;
>     };
>   #endif
>
 First off, the manual page for dlopen() on FreeBSD version 
2.1.0
> claims that dlopen returns a null pointer if it fails.  
That manual page
> also claims that dlerror() is supported.  I do seem to 
recall that previous
> versions of FreeBSD had some undocumented dynamic loading 
support, so
> perhaps this code is a hold-over from those old days.  
Probably autoconf
> should be figuring this out for you somehow...

FreeBSD, NetBSD (and therefore OpenBSD) return NULL when 
dlopen fails
and support dlerror.

I checked the FreeBSD CVS files and this feature is support 
at least
since FreeBSD-2.0 (start of CVS files). My NetBSD 1.0 also 
claims so.

I can only suspect the different dlopen support was in 
386BSD, and
inherited to FreeBSD-1.x and NetBSD <1.0.

I would change the code to check for all platforms

     if (newhandle<=0) {

The remaining problem could be a missing dlerror(), but I 
don't think
such old BSD releases are still in use. If ignoring the 
problem is not
an option for you, I could send you code to test for 
FreeBSD<2.0 and
ask NetBSD people about the issue.
  
> Second off, this code generates a compile-time warning 
because of the
> comparison between newhandle and -1.  Since this is the -
only- warning I
> got when installing scsh, you might want to achieve 
perfection by replacing
> that "-1" with "(void *) -1"!
>
> ------- #2
>
> In scsh-0.4.4/scsh/bsd/waitcodes.scm the line:
>
>        (not (= #x7F))                                 ; 
Not suspended.
>
>
> should probably read:
>
>        (not (= #x7F termsig))                         ; 
Not suspended.
>
> ------- EOM
--
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Martin Cracauer <cracauer@wavehh.hanse.de>
http://cracauer.cons.org
Fax +49 40 522 85 36








----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=110493&aid=407805&group_id=10493


<Prev in Thread] Current Thread [Next in Thread>
  • [Scsh-hackers] [ scsh-Bugs-407805 ] dynload.c and bsd/waitcodes.scm, SourceForge.net <=