PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
hpux.c File Reference
#include "postgres.h"
#include <a.out.h>
#include <dl.h>
#include "dynloader.h"
#include "utils/dynamic_loader.h"
Include dependency graph for hpux.c:

Go to the source code of this file.

Functions

void * pg_dlopen (char *filename)
 
PGFunction pg_dlsym (void *handle, char *funcname)
 
void pg_dlclose (void *handle)
 
char * pg_dlerror (void)
 

Function Documentation

void pg_dlclose ( void *  handle)

Definition at line 54 of file hpux.c.

55 {
56  shl_unload((shl_t) handle);
57 }
char* pg_dlerror ( void  )

Definition at line 60 of file hpux.c.

References errmsg(), and strerror().

61 {
62  static char errmsg[] = "shl_load failed";
63 
64  if (errno)
65  return strerror(errno);
66 
67  return errmsg;
68 }
int errmsg(const char *fmt,...)
Definition: elog.c:797
const char * strerror(int errnum)
Definition: strerror.c:19
void* pg_dlopen ( char *  filename)

Definition at line 29 of file hpux.c.

30 {
31  /*
32  * Use BIND_IMMEDIATE so that undefined symbols cause a failure return
33  * from shl_load(), rather than an abort() later on when we attempt to
34  * call the library!
35  */
36  shl_t handle = shl_load(filename,
37  BIND_IMMEDIATE | BIND_VERBOSE | DYNAMIC_PATH,
38  0L);
39 
40  return (void *) handle;
41 }
static char * filename
Definition: pg_dumpall.c:89
PGFunction pg_dlsym ( void *  handle,
char *  funcname 
)

Definition at line 44 of file hpux.c.

References NULL.

45 {
46  PGFunction f;
47 
48  if (shl_findsym((shl_t *) & handle, funcname, TYPE_PROCEDURE, &f) == -1)
49  f = (PGFunction) NULL;
50  return f;
51 }
Datum(* PGFunction)(FunctionCallInfo fcinfo)
Definition: fmgr.h:40
#define NULL
Definition: c.h:229