pkgsrc-Changes archive

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

Re: CVS commit: pkgsrc/mk



Jared D. McNeill wrote:
Send me a test case that reproduces this issue. Let me write you one that doesn't.

And here we go (test application attached);

$ cc dlopen.c -o dlopen && ./dlopen && uname -srm
zlib version 1.2.3
NetBSD 4.0_STABLE i386

$ cc dlopen.c -o dlopen && ./dlopen && uname -srm
zlib version 1.2.3
NetBSD 5.0_BETA i386

$ cc dlopen.c -o dlopen && ./dlopen && uname -srm
zlib version 1.2.3
NetBSD 5.99.5 amd64
#include <dlfcn.h>
#include <stdio.h>
#include <stdlib.h>

static struct _fns {
        const char *    (*zlibVersion)(void);
} fns;

int
main(int argc, char *argv[])
{
        void *h;

        h = dlopen("libz.so", RTLD_NOW);
        if (h == NULL) {
                fprintf(stderr, "dlopen failed: %s\n", dlerror());
                return EXIT_FAILURE;
        }
        fns.zlibVersion = dlsym(h, "zlibVersion");
        if (fns.zlibVersion == NULL) {
                fprintf(stderr, "dlsym failed: %s\n", dlerror());
                return EXIT_FAILURE;
        }

        printf("zlib version %s\n", fns.zlibVersion());

        dlclose(h);
        return EXIT_SUCCESS;
}


Home | Main Index | Thread Index | Old Index