2004-05-21 Joel Sherrill <joel@OARcorp.com>

PR 628/rtems
	* src/killinfo.c, src/pthreadkill.c, src/ptimer1.c, src/sigaction.c,
	src/sigaddset.c, src/sigsuspend.c: Signal set of 0 is supposed to
	return EINVAL.  In addition timer_create needed to return an error
	if the clock was not CLOCK_REALTIME.
This commit is contained in:
Joel Sherrill
2004-05-21 20:16:39 +00:00
parent 0732eb4997
commit cfc43898e6
7 changed files with 41 additions and 10 deletions

View File

@@ -1,3 +1,11 @@
2004-05-21 Joel Sherrill <joel@OARcorp.com>
PR 628/rtems
* src/killinfo.c, src/pthreadkill.c, src/ptimer1.c, src/sigaction.c,
src/sigaddset.c, src/sigsuspend.c: Signal set of 0 is supposed to
return EINVAL. In addition timer_create needed to return an error
if the clock was not CLOCK_REALTIME.
2004-05-21 Joel Sherrill <joel@OARcorp.com>
PR 629/rtems

View File

@@ -66,10 +66,13 @@ int killinfo(
rtems_set_errno_and_return_minus_one( ESRCH );
/*
* Validate the signal passed if not 0.
* Validate the signal passed.
*/
if ( sig && !is_valid_signo(sig) ) {
if ( !sig )
rtems_set_errno_and_return_minus_one( EINVAL );
if ( !is_valid_signo(sig) ) {
rtems_set_errno_and_return_minus_one( EINVAL );
}
@@ -77,7 +80,7 @@ int killinfo(
* If the signal is being ignored, then we are out of here.
*/
if ( !sig || _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) {
if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) {
return 0;
}

View File

@@ -34,7 +34,10 @@ int pthread_kill(
Thread_Control *the_thread;
Objects_Locations location;
if ( sig && !is_valid_signo(sig) )
if ( !sig )
rtems_set_errno_and_return_minus_one( EINVAL );
if ( !is_valid_signo(sig) )
rtems_set_errno_and_return_minus_one( EINVAL );
/* commented out when posix timers added

View File

@@ -271,6 +271,9 @@ int timer_create(
rtems_id timer_id; /* created timer identifier */
int timer_pos; /* Position in the table of timers */
if ( clock_id != CLOCK_REALTIME )
rtems_set_errno_and_return_minus_one( EINVAL );
/*
* The data of the structure evp are checked in order to verify if they
* are coherent.
@@ -283,11 +286,17 @@ int timer_create(
/* The value of the field sigev_notify is not valid */
rtems_set_errno_and_return_minus_one( EINVAL );
}
if ( !evp->sigev_signo )
rtems_set_errno_and_return_minus_one( EINVAL );
if ( !is_valid_signo(evp->sigev_signo) )
rtems_set_errno_and_return_minus_one( EINVAL );
}
/*
* A timer is created using the primitive rtems_timer_create
*/
/*
* A timer is created using the primitive rtems_timer_create
*/
return_v = rtems_timer_create ( clock_id, &timer_id );

View File

@@ -43,7 +43,7 @@ int sigaction(
*oact = _POSIX_signals_Vectors[ sig ];
if ( !sig )
return 0;
rtems_set_errno_and_return_minus_one( EINVAL );
if ( !is_valid_signo(sig) )
rtems_set_errno_and_return_minus_one( EINVAL );

View File

@@ -32,7 +32,7 @@ int sigaddset(
rtems_set_errno_and_return_minus_one( EINVAL );
if ( !signo )
return 0;
rtems_set_errno_and_return_minus_one( EINVAL );
if ( !is_valid_signo(signo) )
rtems_set_errno_and_return_minus_one( EINVAL );

View File

@@ -1,7 +1,7 @@
/*
* 3.3.7 Wait for a Signal, P1003.1b-1993, p. 75
*
* COPYRIGHT (c) 1989-1999.
* COPYRIGHT (c) 1989-2004.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -21,6 +21,7 @@
#include <rtems/system.h>
#include <rtems/posix/pthread.h>
#include <rtems/posix/psignal.h>
#include <rtems/seterr.h>
int sigsuspend(
const sigset_t *sigmask
@@ -41,5 +42,12 @@ int sigsuspend(
(void) sigprocmask( SIG_SETMASK, &saved_signals_blocked, NULL );
/*
* sigtimedwait() returns the signal number while sigsuspend()
* is supposed to return -1 and EINTR when a signal is caught.
*/
if ( status != -1 )
rtems_set_errno_and_return_minus_one( EINTR );
return status;
}