Mail Archives: djgpp/2015/09/16/14:45:09
On Wednesday, September 16, 2015 at 8:07:44 PM UTC+2, Ozkan Sezer (sezeroz AT gmail DOT com) [via djgpp AT delorie DOT com] wrote:
> On 9/16/15, Eli Zaretskii (eliz AT gnu DOT org) [via djgpp AT delorie DOT com]
> <djgpp AT delorie DOT com> wrote:
> >> Date: Wed, 16 Sep 2015 10:14:40 -0700 (PDT)
> >> From: "Juan Manuel Guerrero (juan DOT guerrero AT gmx DOT de) [via
> >> djgpp AT delorie DOT com]" <djgpp AT delorie DOT com>
> >>
> >> On Wednesday, September 16, 2015 at 2:39:19 PM UTC+2, Ozkan Sezer
> >> (sezeroz AT gmail DOT com) [via djgpp AT delorie DOT com] wrote:
> >> > If there are no objections, I want to apply the following
> >> > patch to both HEAD and to v2_05_1. dlopen(NULL,mode) is
> >> > supported by glibc but not by djgpp, and such a call left
> >> > unchecked will result in Bad Things (TM) to happen.
> >> >
> >> > Index: dlopen.c
> >> > ===================================================================
> >> > RCS file: /cvs/djgpp/djgpp/src/libc/dxe/dlopen.c,v
> >> > retrieving revision 1.9
> >> > diff -u -p -r1.9 dlopen.c
> >> > --- dlopen.c 21 Aug 2015 18:10:28 -0000 1.9
> >> > +++ dlopen.c 16 Sep 2015 12:02:07 -0000
> >> > @@ -119,6 +119,11 @@ void *dlopen(const char *filename, int m
> >> > _dl_unresolved_count = 0;
> >> > errno = 0;
> >> >
> >> > + if (!filename || !*filename) {
> >> > + errno = EINVAL;
> >> > + return NULL;
> >> > + }
> >> > +
> >> > /* Find the dynamic module along the LD_LIBRARY_PATH */
> >> > if (!ACCESS(filename))
> >> > {
> >>
> >>
> >> Looks ok to me but my man page tells something like this:
> >> "If filename is NULL, then the returned handle is for the main
> >> program."
> >> What shall this imply for DJGPP?
> >
> > This feature is for when the function is already statically linked
> > into the main program.
>
> Yes, useful in such a case too
>
> > Can we support this in DJGPP?
>
> Someone will need to implement that, but for 2.06 I think
>
> > If not, we should return ENOSYS or some such.
> >
>
> I used EINVAL, because NULL or "" filename is already an invalid
> argument for the current implementation, and ENOSYS would be a
> misleading errno. What do the others think?
>
> --
> O.S.
When this has clarified we will need a new djdev205.zip, etc... before we can proceed.
Regards,
Juan M. Guerrero
- Raw text -