Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

dlfcn.h - header for dynamic linking

&pagelevel(3)&pagelevel

Syntax


#include <dlfcn.h>

Description

The dlfcn.h header defines macros for use in the dlopen() construction of a mode argument. In addition, dlfcn.h contains structures and prototypes of the function calls.


#ifndef _DLFCN_H
#define _DLFCN_H


#if defined(_LITERAL_ENCODING_ASCII)
#    if (_LITERAL_ENCODING_ASCII - 0 == 1) && !defined(_ASCII_SOURCE)
#       define _ASCII_SOURCE 1  /*automatische Umsetzung*/
#    endif
#endif
#if defined(_ASCII_SOURCE)
#   if (_ASCII_SOURCE - 0 != 0) && (_ASCII_SOURCE - 0!= 1)
#       error unsupported _ASCII_SOURCE
#   endif
#else
#   define _ASCII_SOURCE 0
#endif


struct Dl_info {
    const char *    dli_fname;
    void *          dli_fbase;
    const char *    dli_sname;
    void *          dli_saddr;
};


extern void *__dlopen_ascii(const char *, int);
extern void *__dlsym_ascii(void *, const char *);
extern char *__dlerror_ascii(void);
extern int   __dladdr_ascii(void *, struct Dl_info *);
extern void *dlopen(const char *, int );
extern void *dlsym(void *, const char *);
extern int   dlclose(void *);
extern char *dlerror(void);
extern int   dladdr(void *, struct Dl_info *);
#if (_ASCII_SOURCE - 0 == 1)
#   ifdef _MAP_NAME
#       define dlopen  __dlopen_ascii
#       define dlsym   __dlsym_ascii
#       define dlerror __dlerror_ascii
#       define dladdr  __dladdr_ascii
#   else
#       define dlopen(_n, _f) __dlopen_ascii(_n, _f)
#       define dlsym(_h, _s)  __dlsym_ascii(_h, _s)
#       define dlerror()      __dlerror_ascii()
#       define dladdr(_v, _i) __dladdr_ascii(_v, _i)
#   endif
#endif /* _ASCII_SOURCE == 1 */


/* valid values for mode argument to dlopen */
#define RTLD_LAZY       1       /* lazy function call binding */
#define RTLD_NOW        2       /* immediate function call binding */
#define RTLD_GLOBAL     4       /* symbols in this dlopen'ed obj are visible */
                                /* to other dlopen'ed objs */
#define RTLD_LOCAL      8       /* symbols in this dlopen'ed obj are */
                                /* invisible to other dlopen'ed objs */


#define RTLD_MAIN_UPPERCASE     0x10    /* uppercase names in main program */
#define RTLD_MAIN_DOLLAR        0x20    /* dollar for underscore in names */


/*
 * defines for dlsym
 * RTLD_DEFAULT searches all objects loaded
 * RTLD_NEXT    searches all objects loaded after the object the call comes from
 * RTLD_SELF    searches all objects loaded after the object the call comes from
 *              including this object as the first one
 */


#define RTLD_DEFAULT    (void *)(-2)
#define RTLD_NEXT       (void *)(-1)
#define RTLD_SELF       (void *)(-3)


#endif  /* _DLFCN_H */

See also

dlopen(), dlclose(), dlsym(), dlerror()