[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Shared Libs
>Have you thought about global variables *in the application* that must be
>accessed by functions *in the library*? "errno" is an example for this.
>
>All accesses to such variables must be via pointers, as two different programs
>will contain different instances of the same variable.
I think the easiest way to handle that is going to be to pass things like
errno through as an argument. For example, open() might be something like:
#define open(file,type) _dispatch(_libc_struct,_OPEN_FUNC,file,type,&errno)
So, the header file passes it so the C code doesn't change. Hopefully,
there won't be too much like this. We may need some sort of data table
scheme if we have to support more than 2 or 3 per call.
CYA,
Evan