From 4bc082e7cb4a6b0ce1d5df7183ee07c87d2f140e Mon Sep 17 00:00:00 2001 From: BernardXiong Date: Sun, 31 Dec 2017 14:48:54 +0800 Subject: [PATCH] [libc] move `struct sigevent` to libc_signal.h file. --- components/libc/pthreads/pthread.h | 21 --------------------- components/libc/signal/posix_signal.h | 1 - include/libc/libc_signal.h | 14 ++++++++++++++ 3 files changed, 14 insertions(+), 22 deletions(-) diff --git a/components/libc/pthreads/pthread.h b/components/libc/pthreads/pthread.h index 81af885981..d79a065fe6 100644 --- a/components/libc/pthreads/pthread.h +++ b/components/libc/pthreads/pthread.h @@ -276,27 +276,6 @@ int pthread_barrier_init(pthread_barrier_t *barrier, 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 -{ - int sigev_notify; /* Notification type */ - int sigev_signo; /* Signal number */ - union sigval sigev_value; /* Signal value */ - void (*sigev_notify_function)( union sigval ); - /* Notification function */ - pthread_attr_t *sigev_notify_attributes; /* Notification Attributes */ -}; - /* posix clock and timer */ #define MILLISECOND_PER_SECOND 1000UL #define MICROSECOND_PER_SECOND 1000000UL diff --git a/components/libc/signal/posix_signal.h b/components/libc/signal/posix_signal.h index e0a2039926..fbb33e7821 100644 --- a/components/libc/signal/posix_signal.h +++ b/components/libc/signal/posix_signal.h @@ -97,7 +97,6 @@ struct sigevent { int sigev_signo; union sigval sigev_value; - void (*sigev_notify_function)( union sigval ); pthread_attr_t *sigev_notify_attributes; diff --git a/include/libc/libc_signal.h b/include/libc/libc_signal.h index 759647cdd1..cc4552f990 100644 --- a/include/libc/libc_signal.h +++ b/include/libc/libc_signal.h @@ -30,12 +30,26 @@ extern "C" { #endif +/* 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. */ + union sigval { int sival_int; /* Integer signal value */ void *sival_ptr; /* Pointer signal value */ }; +struct sigevent +{ + int sigev_notify; /* Notification type */ + int sigev_signo; /* Signal number */ + union sigval sigev_value; /* Signal value */ + void (*sigev_notify_function)( union sigval ); + /* Notification function */ + void *sigev_notify_attributes; /* Notification Attributes, really pthread_attr_t */ +}; + struct siginfo { rt_uint8_t si_signo; -- GitLab