Skip to content

File dynamic_load.c

FileList > base > dynamic_load.c

Go to the source code of this file

  • #include "config.h"
  • #include <a.out.h>
  • #include <sys/types.h>
  • #include <signal.h>
  • #include <unistd.h>
  • #include <errno.h>
  • #include <fcntl.h>
  • #include <ar.h>
  • #include <stdio.h>
  • #include <string.h>
  • #include <stdlib.h>
  • #include <sys/stat.h>
  • #include <assert.h>
  • #include "porting.h"
  • #include "intl_support.h"
  • #include "dynamic_load.h"
  • #include "error_manager.h"
  • #include "memory_alloc.h"
  • #include "environment_variable.h"
  • #include "system_parameter.h"
  • #include "util_func.h"

Classes

Type Name
struct dynamic_loader
struct file_entry
struct tbl_link

Public Types

Type Name
typedef struct dynamic_loader DYNAMIC_LOADER
typedef struct file_entry FILE_ENTRY
typedef void(* FUNCTION_POINTER_TYPE
typedef struct tbl_link TBL_LINK

Public Attributes

Type Name
end_link_file __pad0__
int argc = 0
const char ** argv = [**cub\_alloc**](memory__cwrapper_8h.md#function-cub_alloc)( [**sizeof**](broker__monitor_8c.md#function-timeout) ([**const**](broker__monitor_8c.md#function-timeout) [**char**](broker__monitor_8c.md#function-timeout) \*) \* ([**argc**](dynamic__load_8c.md#variable-argc) + 1) , [**\_\_FILE\_\_**](broker__monitor_8c.md#function-timeout), [**\_\_LINE\_\_**](broker__monitor_8c.md#function-timeout))
const char ** argvp = [**argv**](dynamic__load_8c.md#variable-argv)
int dl_Errno = 0
do = { [**cub\_free**](memory__cwrapper_8h.md#function-cub_free)( ([**void**](broker__monitor_8c.md#function-timeout)\*) ( [**argv**](dynamic__load_8c.md#variable-argv) ) )
else = /* multi line expression */
char * extra_options = ([**char**](broker__monitor_8c.md#function-timeout) \*) [**getenv**](broker__monitor_8c.md#function-timeout) ("DL\_LD\_OPTIONS")
int i
char load_point_buf
int num_options = 0
const char ** option_vec = ([**const**](broker__monitor_8c.md#function-timeout) [**char**](broker__monitor_8c.md#function-timeout) \*\*) [**NULL**](freelistheap_8h.md#define-null)
const char ** p = /* multi line expression */
pid_t pid = 0

Public Static Attributes

Type Name
const char DAEMON_NAME = "dl\_daemon"
const int DAEMON_NOT_AVAILABLE = -2
const int DAEMON_NOT_SPAWNED = -1
const int HANDLES_PER_EXTENT = 10
const int MAX_UNLINK_RETRY = 15
int dl_Debug = 0
DYNAMIC_LOADER * dl_Loader = [**NULL**](freelistheap_8h.md#define-null)

Public Functions

Type Name
_exit (1)
int dl_destroy_module (void)
int dl_initiate_module (const char * module_name)
er_set (ER_ERROR_SEVERITY, __FILE__, __LINE__, dl_Errno=-389, 1, dl_get_system_error_message(errno))
for (p=libs; *p;p++)
for (i=0;i< this_->candidates.num;++i)
for ()
if (extra_options)
if (argv==NULL)
if (dl_Debug)
if (pid)
if (option_vec)
while (0)

Public Static Functions

Type Name
int dl_close_object_file (int fd, int lineno)
void dl_decipher_waitval (int waitval)
void dl_destroy_candidates (DYNAMIC_LOADER * this_)
void dl_destroy_dynamic_loader (DYNAMIC_LOADER * this_)
void dl_find_daemon (DYNAMIC_LOADER * this_)
const char * dl_get_system_error_message (int n)
char * dl_get_temporary_name (const char * dir, const char * prefix, int lineno)
int dl_initiate_dynamic_loader (DYNAMIC_LOADER * this_, const char * original)
int dl_is_valid_image_file (DYNAMIC_LOADER * this_)
int dl_load_object_image (caddr_t, const char *)
void dl_notify_daemon (DYNAMIC_LOADER *)
int dl_open_object_file (const char * filename, int mode, int lineno)
int dl_open_pipe (int * fd, int lineno)
const char ** dl_parse_extra_options (int * num_options, char * option_string)
void dl_record_files (DYNAMIC_LOADER * this_)
int dl_resolve_symbol (DYNAMIC_LOADER * this_, struct nlist * syms)
void dl_set_new_image_file (DYNAMIC_LOADER *, const char *)
int dl_set_new_load_points (DYNAMIC_LOADER * this_, const caddr_t)
void dl_set_pipe_handler (void)
void dl_spawn_daemon (DYNAMIC_LOADER *)
int dl_validate_candidates (DYNAMIC_LOADER * this_, const char ** filenames)
int dl_validate_file_entry (FILE_ENTRY * this_, const char * filename)

Macros

Type Name
define CLOSE (fd) [**dl\_close\_object\_file**](dynamic__load_8c.md#function-dl_close_object_file)((fd), [**\_\_LINE\_\_**](broker__monitor_8c.md#function-timeout))
define DEBUG
define DL_SET_ERROR_SYSTEM_FILENAME (fn) /* multi line expression */
define DL_SET_ERROR_SYSTEM_MSG () /* multi line expression */
define DL_SET_ERROR_WITH_CODE (code) /* multi line expression */
define DL_SET_ERROR_WITH_CODE_ONE_ARG (code, arg) /* multi line expression */
define FNAME_TBL_SIZE 127
define FORK [**fork**](broker__monitor_8c.md#function-timeout)
define OPEN (fn, m) [**dl\_open\_object\_file**](dynamic__load_8c.md#function-dl_open_object_file)(([**fn**](broker__monitor_8c.md#function-timeout)), (m), [**\_\_LINE\_\_**](broker__monitor_8c.md#function-timeout))
define PIPE (fd) [**dl\_open\_pipe**](dynamic__load_8c.md#function-dl_open_pipe)((fd), [**\_\_LINE\_\_**](broker__monitor_8c.md#function-timeout))
define TEMPNAM (d, p) [**dl\_get\_temporary\_name**](dynamic__load_8c.md#function-dl_get_temporary_name)((d), ([**p**](dynamic__load_8c.md#variable-p)), [**\_\_LINE\_\_**](broker__monitor_8c.md#function-timeout))

Public Types Documentation

typedef DYNAMIC_LOADER

typedef struct dynamic_loader DYNAMIC_LOADER;

typedef FILE_ENTRY

typedef struct file_entry FILE_ENTRY;

typedef FUNCTION_POINTER_TYPE

typedef void(* FUNCTION_POINTER_TYPE) (void);

typedef struct tbl_link TBL_LINK;

Public Attributes Documentation

variable __pad0__

end_link_file __pad0__;

variable argc

int argc;

variable argv

argv;

variable argvp

* argvp;

variable dl_Errno

return dl_Errno;

variable do

do;

variable else

else;

variable extra_options

extra_options;

variable i

int i;

variable load_point_buf

char load_point_buf[16];

variable num_options

int num_options;

variable option_vec

const char** option_vec;

variable p

const char** p;

variable pid

pid;

Public Static Attributes Documentation

variable DAEMON_NAME

const char DAEMON_NAME[];

variable DAEMON_NOT_AVAILABLE

const int DAEMON_NOT_AVAILABLE;

variable DAEMON_NOT_SPAWNED

const int DAEMON_NOT_SPAWNED;

variable HANDLES_PER_EXTENT

const int HANDLES_PER_EXTENT;

const int MAX_UNLINK_RETRY;

variable dl_Debug

int dl_Debug;

variable dl_Loader

DYNAMIC_LOADER* dl_Loader;

Public Functions Documentation

function _exit

_exit (
    1
) 

function dl_destroy_module

int dl_destroy_module (
    void
) 

function dl_initiate_module

int dl_initiate_module (
    const  char * module_name
) 

function er_set

er_set (
    ER_ERROR_SEVERITY,
    __FILE__,
    __LINE__,
    dl_Errno=-389,
    1,
    dl_get_system_error_message ( errno )
) 

function for

for (
    p=libs ; * p ; p ++
) 

function for

for (
    i=0; i < this_ ->candidates.num;++ i
) 

function for

for () 

function if

if (
    extra_options
) 

function if

if (
    argv== NULL
) 

function if

if (
    dl_Debug
) 

function if

if (
    pid
) 

function if

if (
    option_vec
) 

function while

while (
    0
) 

Public Static Functions Documentation

function dl_close_object_file

static int dl_close_object_file (
    int fd,
    int lineno
) 

function dl_decipher_waitval

static void dl_decipher_waitval (
    int waitval
) 

function dl_destroy_candidates

static void dl_destroy_candidates (
    DYNAMIC_LOADER * this_
) 

function dl_destroy_dynamic_loader

static void dl_destroy_dynamic_loader (
    DYNAMIC_LOADER * this_
) 

function dl_find_daemon

static void dl_find_daemon (
    DYNAMIC_LOADER * this_
) 

function dl_get_system_error_message

static const  char * dl_get_system_error_message (
    int n
) 

function dl_get_temporary_name

static char * dl_get_temporary_name (
    const  char * dir,
    const  char * prefix,
    int lineno
) 

function dl_initiate_dynamic_loader

static int dl_initiate_dynamic_loader (
    DYNAMIC_LOADER * this_,
    const  char * original
) 

function dl_is_valid_image_file

static int dl_is_valid_image_file (
    DYNAMIC_LOADER * this_
) 

function dl_load_object_image

static int dl_load_object_image (
    caddr_t,
    const  char *
) 

function dl_notify_daemon

static void dl_notify_daemon (
    DYNAMIC_LOADER *
) 

function dl_open_object_file

static int dl_open_object_file (
    const  char * filename,
    int mode,
    int lineno
) 

function dl_open_pipe

static int dl_open_pipe (
    int * fd,
    int lineno
) 

function dl_parse_extra_options

static const  char ** dl_parse_extra_options (
    int * num_options,
    char * option_string
) 

function dl_record_files

static void dl_record_files (
    DYNAMIC_LOADER * this_
) 

function dl_resolve_symbol

static int dl_resolve_symbol (
    DYNAMIC_LOADER * this_,
    struct  nlist * syms
) 

function dl_set_new_image_file

static void dl_set_new_image_file (
    DYNAMIC_LOADER *,
    const  char *
) 

function dl_set_new_load_points

static int dl_set_new_load_points (
    DYNAMIC_LOADER * this_,
    const  caddr_t
) 

function dl_set_pipe_handler

static void dl_set_pipe_handler (
    void
) 

function dl_spawn_daemon

static void dl_spawn_daemon (
    DYNAMIC_LOADER *
) 

function dl_validate_candidates

static int dl_validate_candidates (
    DYNAMIC_LOADER * this_,
    const  char ** filenames
) 

function dl_validate_file_entry

static int dl_validate_file_entry (
    FILE_ENTRY * this_,
    const  char * filename
) 

Macro Definition Documentation

define CLOSE

#define CLOSE (
    fd
) `dl_close_object_file ((fd), __LINE__ )`

define DEBUG

#define DEBUG 

define DL_SET_ERROR_SYSTEM_FILENAME

#define DL_SET_ERROR_SYSTEM_FILENAME (
    fn
) `/* multi line expression */`

define DL_SET_ERROR_SYSTEM_MSG

#define DL_SET_ERROR_SYSTEM_MSG (

) `/* multi line expression */`

define DL_SET_ERROR_WITH_CODE

#define DL_SET_ERROR_WITH_CODE (
    code
) `/* multi line expression */`

define DL_SET_ERROR_WITH_CODE_ONE_ARG

#define DL_SET_ERROR_WITH_CODE_ONE_ARG (
    code,
    arg
) `/* multi line expression */`

define FNAME_TBL_SIZE

#define FNAME_TBL_SIZE `127`

define FORK

#define FORK `fork`

define OPEN

#define OPEN (
    fn,
    m
) `dl_open_object_file (( fn ), (m), __LINE__ )`

define PIPE

#define PIPE (
    fd
) `dl_open_pipe ((fd), __LINE__ )`

define TEMPNAM

#define TEMPNAM (
    d,
    p
) `dl_get_temporary_name ((d), ( p ), __LINE__ )`


The documentation for this class was generated from the following file cubrid/src/base/dynamic_load.c