diff options
| author | bernard <[email protected]> | 2017-10-15 22:41:59 +0800 |
|---|---|---|
| committer | bernard <[email protected]> | 2017-10-15 22:41:59 +0800 |
| commit | 5c7b16d00bdb536a694e6e31a2e0a1c33cb9dcb9 (patch) | |
| tree | 5da5e3404e1241b65e90089c4c370b40130df832 /components/libc/pthreads | |
| parent | b27c7e482648535760e012cd6f1afef1d800e2d2 (diff) | |
[libc] Update libc.
1. Add POSIX termios implementation;
2. Add POSIX signals implementation;
3. Add stdio for each libc.
Diffstat (limited to 'components/libc/pthreads')
| -rw-r--r-- | components/libc/pthreads/pthread.c | 15 | ||||
| -rw-r--r-- | components/libc/pthreads/pthread.h | 2 |
2 files changed, 15 insertions, 2 deletions
diff --git a/components/libc/pthreads/pthread.c b/components/libc/pthreads/pthread.c index eb7d582e59..f88dda9ab0 100644 --- a/components/libc/pthreads/pthread.c +++ b/components/libc/pthreads/pthread.c @@ -194,7 +194,7 @@ int pthread_detach(pthread_t thread) ptd = _pthread_get_data(thread); - if (thread->stat == RT_THREAD_CLOSE) + if ((thread->stat & RT_THREAD_STAT_MASK)== RT_THREAD_CLOSE) { /* delete joinable semaphore */ if (ptd->joinable_sem != RT_NULL) @@ -354,10 +354,21 @@ RTM_EXPORT(pthread_atfork); int pthread_kill(pthread_t thread, int sig) { - return EOPNOTSUPP; +#ifdef RT_USING_SIGNALS + return rt_thread_kill(thread, sig); +#else + return ENOSYS; +#endif } RTM_EXPORT(pthread_kill); +#ifdef RT_USING_SIGNALS +int pthread_sigmask(int how, const sigset_t *set, sigset_t *oset) +{ + return sigprocmask(how, set, oset); +} +#endif + void pthread_cleanup_pop(int execute) { _pthread_data_t *ptd; diff --git a/components/libc/pthreads/pthread.h b/components/libc/pthreads/pthread.h index 2674599aac..dd1c5b5bd2 100644 --- a/components/libc/pthreads/pthread.h +++ b/components/libc/pthreads/pthread.h @@ -268,11 +268,13 @@ int pthread_barrier_wait(pthread_barrier_t *barrier); /* Signal Generation and Delivery, P1003.1b-1993, p. 63 NOTE: P1003.1c/D10, p. 34 adds sigev_notify_function and sigev_notify_attributes to the sigevent structure. */ +#if 0 union sigval { int sival_int; /* Integer signal value */ void *sival_ptr; /* Pointer signal value */ }; +#endif struct sigevent { |
