Home | History | Annotate | Download | only in raise
      1 /*
      2  * Copyright (c) 2002, Intel Corporation. All rights reserved.
      3  * Created by:  julie.n.fleischer REMOVE-THIS AT intel DOT com
      4  * This file is licensed under the GPL license.  For the full content
      5  * of this license, see the COPYING file at the top level of this
      6  * source tree.
      7 
      8  *  Test that the raise(<signal>) sets errno to indicate the error on
      9  *  unsuccessful completion.
     10  *  1) Raise an invalid signal.
     11  *  2) Verify a non-zero value is returned.
     12  *  3) Verify errno is set to EINVAL.
     13  */
     14 
     15 #include <signal.h>
     16 #include <stdio.h>
     17 #include <stdlib.h>
     18 #include <errno.h>
     19 #include "posixtest.h"
     20 
     21 int main(void)
     22 {
     23 	if (raise(10000) == 0) {
     24 		printf("Incorrectly returned 0\n");
     25 		printf("Test FAILED\n");
     26 		return PTS_FAIL;
     27 	}
     28 
     29 	if (EINVAL == errno) {
     30 		printf("Test PASSED\n");
     31 		return PTS_PASS;
     32 	} else {
     33 		printf("errno not correctly set\n");
     34 		return PTS_FAIL;
     35 	}
     36 
     37 }
     38