From aee3d6896ab728aa9270377bdb6cb5efe21e9144 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Wed, 10 Feb 1999 17:03:46 +0000 Subject: POSIX timer support modifications. --- c/src/exec/posix/src/pthreadkill.c | 6 ++---- c/src/exec/posix/src/sigaction.c | 6 ++++++ c/src/exec/posix/src/sigtimedwait.c | 8 ++++++++ cpukit/posix/src/pthreadkill.c | 6 ++---- cpukit/posix/src/sigaction.c | 6 ++++++ cpukit/posix/src/sigtimedwait.c | 8 ++++++++ 6 files changed, 32 insertions(+), 8 deletions(-) diff --git a/c/src/exec/posix/src/pthreadkill.c b/c/src/exec/posix/src/pthreadkill.c index 652b3554a1..85fe4a35bb 100644 --- a/c/src/exec/posix/src/pthreadkill.c +++ b/c/src/exec/posix/src/pthreadkill.c @@ -34,12 +34,10 @@ int pthread_kill( if ( sig && !is_valid_signo(sig) ) set_errno_and_return_minus_one( EINVAL ); +/* commented out when posix timers added if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) set_errno_and_return_minus_one( ENOSYS ); - - /* - * RTEMS does not support sending a siginfo signal to a specific thread. - */ +*/ the_thread = _POSIX_Threads_Get( thread, &location ); switch ( location ) { diff --git a/c/src/exec/posix/src/sigaction.c b/c/src/exec/posix/src/sigaction.c index a2d709e8e7..26abb4ff86 100644 --- a/c/src/exec/posix/src/sigaction.c +++ b/c/src/exec/posix/src/sigaction.c @@ -22,6 +22,12 @@ #include #include +/* + * PARAMETERS_PASSING_S is defined in ptimer.c + */ + +extern void PARAMETERS_PASSING_S (int num_signal, const struct sigaction inf); + int sigaction( int sig, const struct sigaction *act, diff --git a/c/src/exec/posix/src/sigtimedwait.c b/c/src/exec/posix/src/sigtimedwait.c index bb35dd30d7..87bb0ff372 100644 --- a/c/src/exec/posix/src/sigtimedwait.c +++ b/c/src/exec/posix/src/sigtimedwait.c @@ -112,6 +112,14 @@ int sigtimedwait( _Thread_queue_Enqueue( &_POSIX_signals_Wait_queue, interval ); _Thread_Enable_dispatch(); + /* + * When the thread is set free by a signal, it is need to eliminate + * the signal. + */ + + _POSIX_signals_Clear_signals( api, the_info->si_signo, the_info, + FALSE, FALSE ); + errno = _Thread_Executing->Wait.return_code; return the_info->si_signo; } diff --git a/cpukit/posix/src/pthreadkill.c b/cpukit/posix/src/pthreadkill.c index 652b3554a1..85fe4a35bb 100644 --- a/cpukit/posix/src/pthreadkill.c +++ b/cpukit/posix/src/pthreadkill.c @@ -34,12 +34,10 @@ int pthread_kill( if ( sig && !is_valid_signo(sig) ) set_errno_and_return_minus_one( EINVAL ); +/* commented out when posix timers added if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) set_errno_and_return_minus_one( ENOSYS ); - - /* - * RTEMS does not support sending a siginfo signal to a specific thread. - */ +*/ the_thread = _POSIX_Threads_Get( thread, &location ); switch ( location ) { diff --git a/cpukit/posix/src/sigaction.c b/cpukit/posix/src/sigaction.c index a2d709e8e7..26abb4ff86 100644 --- a/cpukit/posix/src/sigaction.c +++ b/cpukit/posix/src/sigaction.c @@ -22,6 +22,12 @@ #include #include +/* + * PARAMETERS_PASSING_S is defined in ptimer.c + */ + +extern void PARAMETERS_PASSING_S (int num_signal, const struct sigaction inf); + int sigaction( int sig, const struct sigaction *act, diff --git a/cpukit/posix/src/sigtimedwait.c b/cpukit/posix/src/sigtimedwait.c index bb35dd30d7..87bb0ff372 100644 --- a/cpukit/posix/src/sigtimedwait.c +++ b/cpukit/posix/src/sigtimedwait.c @@ -112,6 +112,14 @@ int sigtimedwait( _Thread_queue_Enqueue( &_POSIX_signals_Wait_queue, interval ); _Thread_Enable_dispatch(); + /* + * When the thread is set free by a signal, it is need to eliminate + * the signal. + */ + + _POSIX_signals_Clear_signals( api, the_info->si_signo, the_info, + FALSE, FALSE ); + errno = _Thread_Executing->Wait.return_code; return the_info->si_signo; } -- cgit v1.2.3