#ifndef REGTEST
#include <stdlib.h>
+#include <errno.h>
void (*_PDCLIB_sigabrt)( int ) = SIG_DFL;
void (*_PDCLIB_sigfpe)( int ) = SIG_DFL;
void (*signal( int sig, void (*func)( int ) ) )( int )
{
void (*oldhandler)( int );
+ if ( sig <= 0 || func == SIG_ERR )
+ {
+ return SIG_ERR;
+ }
switch ( sig )
{
case SIGABRT:
_PDCLIB_sigterm = func;
break;
default:
- /* The standard calls for an unspecified "positive value". You
- will probably want to define a specific value for this.
- */
- _PDCLIB_errno = 1;
+ errno = EINVAL;
return SIG_ERR;
}
return oldhandler;
int main( void )
{
- TESTCASE( NO_TESTDRIVER );
+ /* Testing covered by raise.c */
return TEST_RESULTS;
}
#endif