Ask a Question related to UNIX Programming, Design and Development.

  1. #1

    Default dlopen portability

    Hello,
    On linux there is an interface to dynamically link against shared libraries
    using the functions,

    void *dlopen(const char *filename, int flag);
    const char *dlerror(void);
    void *dlsym(void *handle, char *symbol);
    int dlclose(void *handle);

    Most of my man pages have a section CONFORMING TO at the end, but not the
    one for these functions. There is an (unusual) section
    ACKNOWLEDGEMENTS
    The dlopen interface standard comes from Solaris.

    I was wondering how portable this interface was to other unixen then
    linux/solaris? xxBSD/True 64/HP-UX/etc.
    Thanks!
    Tobias.

    --
    unix [url]http://www.faqs.org/faqs/by-newsgroup/comp/comp.unix.programmer.html[/url]
    clc [url]http://www.eskimo.com/~scs/C-faq/top.html[/url]
    fclc (french): [url]http://www.isty-info.uvsq.fr/~rumeau/fclc/[/url]
    Tobias Oed Guest

  2. Similar Questions and Discussions

    1. Portability
      Hi all, I want to know from where can i start making a GUI, i don't think it is the same way as writing code, as u adviced me from "printing hello...
    2. PHP Portability Tip
      "Michael Willcocks" <michael@metrogroup.com.au> wrote... Not a battery operated device. The things are called "pen drives", "thumb drives", "usb...
    3. dlopen problem
      I'm trying to dlopen a library on AIX 5.1 but getting errno == ENOEXEC. dlerror() returns nothing. This library has other dependencies. If I...
    4. dlopen - calling functions other way round
      I am using the dlopen,dlsym functions to load in an external module in my program which works fine. I can call functions inside the loaded module...
    5. dlopen() and shared objects
      I created a shared object - as others before on AIX - and wanted it to be used from Tcl/Tk at runtime via dlopen(). But what worked for me on Linux,...
  3. #2

    Default Re: dlopen portability

    Tobias Oed wrote:
    > I was wondering how portable this interface was to other unixen then
    > linux/solaris? xxBSD/True 64/HP-UX/etc.
    The dlopen interfaces are part of the SUSv2 (aka UNIX98) standard.
    It is implemented on many Unices that predate this standard.
    Bjorn Reese Guest

  4. #3

    Default Re: dlopen portability

    On Wed, 30 Jul 2003 11:02:56 -0700 William Ahern <william@wilbur.25thandclement.com> wrote:
    | Tobias Oed <tobias@physics.odu.edu> wrote:
    |> Hello,
    |> On linux there is an interface to dynamically link against shared libraries
    |> using the functions,
    |>
    |> void *dlopen(const char *filename, int flag);
    |> const char *dlerror(void);
    |> void *dlsym(void *handle, char *symbol);
    |> int dlclose(void *handle);
    |
    |> Most of my man pages have a section CONFORMING TO at the end, but not the
    |> one for these functions. There is an (unusual) section
    |> ACKNOWLEDGEMENTS
    |> The dlopen interface standard comes from Solaris.
    |>
    |> I was wondering how portable this interface was to other unixen then
    |> linux/solaris? xxBSD/True 64/HP-UX/etc.
    |> Thanks!
    |> Tobias.
    |
    | Many people use GNU Autotools' Libtool library/interface. It smoothes over
    | the edges for portable applications. For instance, OpenBSD has dlopen()
    | available from libc, whereas on Linux you have to link to libdl; OTOH
    | OpenBSD doesn't support the RTLD_NEXT handler.

    I found dlopen() in SUSv3. The RTLD_NEXT option is not listed, so SUSv3
    does not appear to require it. So it could be the case that OpenBSD is in
    full conformance for dlopen().

    --
    -----------------------------------------------------------------------------
    | Phil Howard KA9WGN | [url]http://linuxhomepage.com/[/url] [url]http://ham.org/[/url] |
    | (first name) at ipal.net | [url]http://phil.ipal.org/[/url] [url]http://ka9wgn.ham.org/[/url] |
    -----------------------------------------------------------------------------
    phil-news-nospam@ipal.net Guest

  5. #4

    Default Re: dlopen portability

    [email]phil-news-nospam@ipal.net[/email] wrote:
    > I found dlopen() in SUSv3. The RTLD_NEXT option is not listed, so SUSv3
    > does not appear to require it. So it could be the case that OpenBSD is in
    > full conformance for dlopen().

    According to the following (registration required) RTLD_NEXT is reserved
    for future use.

    [url]http://www.opengroup.org/onlinepubs/007904975/functions/dlsym.html[/url]

    It'd be extremely nice if OpenBSD didn't wait to implement it.
    William Ahern Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139