hpux.c

来自「PostgreSQL 8.1.4的源码 适用于Linux下的开源数据库系统」· C语言 代码 · 共 69 行

C
69
字号
/*------------------------------------------------------------------------- * * dynloader.c *	  dynamic loader for HP-UX using the shared library mechanism * * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * * IDENTIFICATION *	  $PostgreSQL: pgsql/src/backend/port/dynloader/hpux.c,v 1.28 2005/10/15 02:49:23 momjian Exp $ * *	NOTES *		all functions are defined here -- it's impossible to trace the *		shl_* routines from the bundled HP-UX debugger. * *------------------------------------------------------------------------- */#include "postgres.h"/* System includes */#include <a.out.h>#include <dl.h>#include "dynloader.h"#include "utils/dynamic_loader.h"void *pg_dlopen(char *filename){	/*	 * Use BIND_IMMEDIATE so that undefined symbols cause a failure return	 * from shl_load(), rather than an abort() later on when we attempt to	 * call the library!	 */	shl_t		handle = shl_load(filename,								BIND_IMMEDIATE | BIND_VERBOSE | DYNAMIC_PATH,								  0L);	return (void *) handle;}PGFunctionpg_dlsym(void *handle, char *funcname){	PGFunction	f;	if (shl_findsym((shl_t *) & handle, funcname, TYPE_PROCEDURE, &f) == -1)		f = (PGFunction) NULL;	return f;}voidpg_dlclose(void *handle){	shl_unload((shl_t) handle);}char *pg_dlerror(void){	static char errmsg[] = "shl_load failed";	if (errno)		return strerror(errno);	return errmsg;}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?