diff options
Diffstat (limited to 'src/nonstd')
| -rw-r--r-- | src/nonstd/__libc.c | 1 | ||||
| -rw-r--r-- | src/nonstd/__libc_start.c | 1 | ||||
| -rw-r--r-- | src/nonstd/__pthread_per_thread.c | 9 | ||||
| -rw-r--r-- | src/nonstd/_printf.h | 1 |
4 files changed, 7 insertions, 5 deletions
diff --git a/src/nonstd/__libc.c b/src/nonstd/__libc.c index 2d246203..e1d64c6d 100644 --- a/src/nonstd/__libc.c +++ b/src/nonstd/__libc.c @@ -1,3 +1,4 @@ +#include "sys/types.h" #include <nonstd/internal.h> #include "locale.h" #include "nonstd/locale.h" diff --git a/src/nonstd/__libc_start.c b/src/nonstd/__libc_start.c index 8dab57fb..0cff0ab3 100644 --- a/src/nonstd/__libc_start.c +++ b/src/nonstd/__libc_start.c @@ -23,4 +23,3 @@ void __libc_start(int argc, char **argv) exit(main(argc, argv)); } - diff --git a/src/nonstd/__pthread_per_thread.c b/src/nonstd/__pthread_per_thread.c index 0dff3999..0f633a1b 100644 --- a/src/nonstd/__pthread_per_thread.c +++ b/src/nonstd/__pthread_per_thread.c @@ -1,10 +1,12 @@ +#if defined _POSIX_C_SOURCE && 199506L <= _POSIX_C_SOURCE + #include "pthread.h" static pthread_key_t __per_thread_key; static void __make_key(void) { - pthread_key_create(&key, NULL); + pthread_key_create(&__per_thread_key, NULL); } static struct per_thread *per_thread(void) @@ -12,12 +14,13 @@ static struct per_thread *per_thread(void) static pthread_once_t key_once = PTHREAD_ONCE_INIT; struct per_thread *pt; pthread_once(&key_once, __make_key); - if ((pt = pthread_getspecific(key)) == NULL) { + if ((pt = pthread_getspecific(__per_thread_key)) == NULL) { pt = calloc(1, sizeof (*pt)); - pthread_setspecific(key, pt); + pthread_setspecific(__per_thread_key, pt); } return pt; } +#endif /* LINK(pthread) diff --git a/src/nonstd/_printf.h b/src/nonstd/_printf.h index 0c513bef..fa132367 100644 --- a/src/nonstd/_printf.h +++ b/src/nonstd/_printf.h @@ -58,7 +58,6 @@ int (__printf)(struct io_options *opt, const char * format, va_list arg) { extern int isdigit(int); extern int isupper(int); - extern size_t fwrite(char *, size_t, size_t, struct __FILE *); char buf[BUFSIZ]; int nout = 0; |
