This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: threads.h implementation issues
- From: Juan Manuel Torres Palma <j dot m dot torrespalma at gmail dot com>
- To: Rich Felker <dalias at libc dot org>
- Cc: libc-alpha at sourceware dot org
- Date: Thu, 30 Oct 2014 17:40:27 +0100
- Subject: Re: threads.h implementation issues
- Authentication-results: sourceware.org; auth=none
- References: <CAD82F-r6+-rDWuKycWkAX1e_U0rFRh2CkURaigwqMTynSt7yaw at mail dot gmail dot com> <20141027221931 dot GN22465 at brightrain dot aerifal dot cx> <CAD82F-ro-Df6zHei_vR7_0szbGsm690p2xC+RTK=KVQ=+294Lg at mail dot gmail dot com> <20141029131623 dot GR22465 at brightrain dot aerifal dot cx>
> Including it from where? It can't be included from threads.h. But it
> shouldn't need to be. Mapping of errors needs to take place internally
> in the library, not as part of the calling application.
I have 2 different files. The header (threads.h) and an implementation
file (threads.c). On threads.c I have included errno.h to be able to
read the errors from pthread_* function calls and map them to their
corresponding error value on the threads.h specification. The function
is defined as:
static inline int __thrd_err_val(int);
I thought that it's complex enough to not be defined as a macro, so I
created an inline static function, and it's a static one so I don't
think it will create any ABI or namespace issues. Is that wrong?
Thanks.
Cheers.
--
Juan Manuel "Lolo" Torres Palma.
Computer Science Student at Universidad de Granada.