Skip site navigation (1) Skip section navigation (2)

AW: AW: fmgr changes not yet ported to AIX

From: Zeugswetter Andreas SB <ZeugswetterA(at)wien(dot)spardat(dot)at>
To: "'Tom Lane'" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "'pgsql-hackers(at)postgresql(dot)org'" <pgsql-hackers(at)postgresql(dot)org>
Subject: AW: AW: fmgr changes not yet ported to AIX
Date: 2000-07-27 13:20:18
Message-ID: 11C1E6749A55D411A9670001FA687963368035@sdexcsrv1.f000.d0188.sd.spardat.at (view raw or flat)
Thread:
Lists: pgsql-hackers

> Zeugswetter Andreas SB <ZeugswetterA(at)wien(dot)spardat(dot)at> writes:
> > Why do you declare dlopen, dlsym, ... in dynamic_loader.h ?
> > They are defined in the port specific dynloader.h .
> > Why do you use "void pg_dlclose" when dlclose is "int dlclose" ?
> > This makes a wrapper function necessary.
> 
> It seems to me that the real problem here is that someone tried to
> take shortcuts in the AIX dynloader code.

actually most other ports do it that way. e.g. FreeBSD
so I guess that is why it is done like that. The aix.c and aix.h
where originally generic files to support the usual dl... functions,
and thus had no connex to postgres. I would like to keep it that way
since aix now has it's own libdl.a with the functions making them obsolete
(they have problems accessing exported global variables though,
have to look deeper).

> Instead of implementing
> the same interface that the rest of the ports support, the AIX files
> try to force their own definition of the pg_dlXXX functions --- and
> for what?  To save a wrapper function?  These are hardly performance-
> critical routines, so I don't see the point.

Yes.

> 
> I propose the following changes instead.  I don't have any way to
> test them however --- would you check them?

With the modification below it works, yes. 

> 
> 			regards, tom lane
> 
> *** aix.h~	Mon Jul 17 00:40:12 2000
> --- aix.h	Mon Jul 17 00:41:34 2000
> ***************
> *** 45,56 ****
>   
>   #ifdef __cplusplus
>   }
> - 
>   #endif
> - 
> - #define  pg_dlopen(f)	dlopen(filename, RTLD_LAZY)
> - #define  pg_dlsym(h,f)	dlsym(h, f)
> - #define  pg_dlclose(h)	dlclose(h)
> - #define  pg_dlerror()	dlerror()
>   
>   #endif	 /* __dlfcn_h__ */
> --- 45,50 ----
> *** aix.c~	Mon Jul 17 00:40:19 2000
> --- aix.c	Mon Jul 17 00:45:34 2000

also #include "utils/dynamic_loader.h" for PGFunction

> ***************
> *** 601,603 ****
> --- 601,631 ----
>   	free(buf);
>   	return ret;
>   }
> + 
> + /*
> +  * PostgreSQL interface to the above functions
> +  */
> + 
> + void *
> + pg_dlopen(char *filename)
> + {
> + 	return dlopen(filename, RTLD_LAZY);
> + }
> + 
> + PGFunction
> + pg_dlsym(void *handle, char *funcname)
> + {
> + 	return (PGFunction) dlsym(handle, funcname);
> + }
> + 
> + void
> + pg_dlclose(void *handle)
> + {
> + 	dlclose(h);

you mean: dlclose(handle);

> + }
> + 
> + char *
> + pg_dlerror()
> + {
> + 	return dlerror();
> + }
>

Andreas 

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2000-07-27 13:53:27
Subject: Re: AW: AW: fmgr changes not yet ported to AIX
Previous:From: Bruce MomjianDate: 2000-07-27 13:06:32
Subject: Re: About these IPC parameters

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group