Subj : Re: creating library to be used in threaded and nonthreaded apps To : comp.programming.threads From : Paul Pluzhnikov Date : Thu Apr 28 2005 09:46 pm Chris Friesen writes: > Can I get away with building the library without any special flags and > link it into a threaded app? Yes on some systems, no on others. > I thought there was stuff like "errno" > that got handled differently based on compiler flags (or is that not > applicable anymore?) On Linux, errno is defined to be *(__errno_location()) both for MT and ST complies, so you are safe (at least as far as errno is concerned). On Solaris and HP-UX, to get MT-safe errno you must compile with -D_REENTRANT. However, you will still be able to link your library into ST executable (libc provides stubs to make this possible). On some older systems compiling with -D_REENTRANT introduced dependencies on libpthread, and on such a system one had to provide 2 versions of ones library. I believe this is no longer true for any currently supported UNIX. Cheers, -- In order to understand recursion you must first understand recursion. Remove /-nsp/ for email. .