Fwd: threads.h implementation issues
Juan Manuel Torres Palma
j.m.torrespalma@gmail.com
Wed Oct 29 07:24:00 GMT 2014
> 3. Cast int->uintptr_t->void*->uintptr_t->int to round-trip the int
> result via a value of type void*. This assumes that any value of
> int can be represented in uintptr_t, and that any value of
> uintptr_t can be represented in void*. I think this is acceptable
> but others may disagree.
That worked amazingly good, thanks.
> That should be fine, but you need to keep nanosleep out of the
> namespace, so either use __nanosleep (if it exists) or an inline
> syscall.
I thought that nanosleep is part of <time.h> that is automatically
included with threads.h, so there must be no namespace problems. If
there is, please let me know why.
One more question. I made a function named __thrd_err_map, that I use
to match errors between those received by pthread_* functions and is
only used in the definition file (.c), so I'm also including
<errno.h>. Any inconvenience on that?
Thanks for the feedback.
Cheers.
--
Juan Manuel "Lolo" Torres Palma.
Computer Science Student at Universidad de Granada.
--
Juan Manuel "Lolo" Torres Palma.
Computer Science Student at Universidad de Granada.
More information about the Libc-alpha
mailing list