22 lines
512 B
C
22 lines
512 B
C
|
#define __STDC_WANT_LIB_EXT1__ 1
|
||
|
#include <stdlib.h>
|
||
|
#include <stdio.h>
|
||
|
|
||
|
void my_handler( const char *msg, void *ptr, errno_t error )
|
||
|
{
|
||
|
fprintf( stderr, "rt-constraint violation caught: " );
|
||
|
fprintf( stderr, msg );
|
||
|
fprintf( stderr, "\n" );
|
||
|
}
|
||
|
|
||
|
void main( void )
|
||
|
{
|
||
|
constraint_handler_t old_handler;
|
||
|
|
||
|
old_handler = set_constraint_handler_s( my_handler );
|
||
|
if( getenv_s( NULL, NULL, 0, NULL ) ) {
|
||
|
printf( "getenv_s failed\n" );
|
||
|
}
|
||
|
set_constraint_handler_s( old_handler );
|
||
|
}
|