Go to the source code of this file.
◆ main()
| int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 33 of file forkexec2.c.
34{
36 int status;
38
39
41
42 if ( ( argc > 1 ) && ( strcmp( argv[1], "xxx" ) == 0 ) ) {
43
47 }
48 return 0;
49 } else {
50 if (!
quiet) printf(
"Testing fork/PAPI_init/PAPI_shudtdown/exec/PAPI_init\n");
51
52
56 }
58
59 if ( fork( ) == 0 ) {
60
63 test_fail( __FILE__, __LINE__,
"forked PAPI_library_init",
65 }
66
68
69 if ( execlp( argv[0], argv[0], "xxx", NULL ) == -1 ) {
71 }
72 } else {
73
74 wait( &status );
75 if ( WEXITSTATUS( status ) != 0 ) {
76 test_fail( __FILE__, __LINE__,
"fork", WEXITSTATUS( status ) );
77 }
78 }
79 }
80
82
83 return 0;
84
85}
initialize the PAPI library.
Finish using PAPI and free all related resources.
int tests_quiet(int argc, char **argv)
void PAPI_NORETURN test_fail(const char *file, int line, const char *call, int retval)
void PAPI_NORETURN test_pass(const char *filename)