[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gpsd-dev] PPS and privilege-dropping

From: Greg Troxel
Subject: Re: [gpsd-dev] PPS and privilege-dropping
Date: Fri, 18 Oct 2013 19:46:11 -0400
User-agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/23.4 (berkeley-unix)

"Gary E. Miller" <address@hidden> writes:

> I was looking at the GNU libc doc and notice that glibc is NOT thread
> safe unless one of these macros are declared:
>       #define _REENTRANT
>       #define _THREAD_SAFE
> It seems that things like errno are a simple static int (shared by all
> threads) unless one of those is declared.  In thread safe mode there is
> an errno for each thread.  You can see how this works in the
> include: /usr/include/bits/errno.h
> I grepped and could not find that in gpsd.  Maybe _EENTRANT is enabled
> another way?

This is curious; I don't immediately see how defining something in one's
.c file changes the behavior of the compiled library.

Also, gpsd has to be written to the C99/POSIX libc specs, not glibc, so
this feature is probably of limited utility.  That sais, I'm not really
clear what POSIX says about errno (it kind of seems like it has to be
thread-local to be sane).

Attachment: pgpFpFu2EF38O.pgp
Description: PGP signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]