diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2013-10-19 09:20:30 -0400 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2013-10-19 09:20:30 -0400 |
commit | 69ddc631fae2f744d2cc99dbf5871f7c8efcc386 (patch) | |
tree | a6b5d7c4bdc409df184a5ee721ca36fdd38060cf /gpsd.h-tail | |
parent | ab51fd3b2b3a48eca877cff79d9a7b5ab6807153 (diff) | |
download | gpsd-69ddc631fae2f744d2cc99dbf5871f7c8efcc386.tar.gz |
Attempt to arrange reentrancy. All regression tests pass.
Diffstat (limited to 'gpsd.h-tail')
-rw-r--r-- | gpsd.h-tail | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/gpsd.h-tail b/gpsd.h-tail index f91791a2..72bcf7e7 100644 --- a/gpsd.h-tail +++ b/gpsd.h-tail @@ -9,6 +9,19 @@ #include <stdint.h> #include "gps.h" +/* + * Tell GCC that we want thread-safe behavior wuth _REENTRANT; + * in particular, errno must be thread-local. + * Tell POSIX-conforming implementations with _POSIX_THREAD_SAFE_FUNCTIONS. + * See http://www.unix.org/whitepapers/reentrant.html + */ +#ifndef _REENTRANT +#define _REENTRANT +#endif +#ifndef _POSIX_THREAD_SAFE_FUNCTIONS +#define _POSIX_THREAD_SAFE_FUNCTIONS +#endif + /* use RFC 2782 PPS API */ /* this needs linux >= 2.6.34 and * CONFIG_PPS=y |