Go to the source code of this file.
◆ main()
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 32 of file forkexec3.c.
33{
35 int status;
37
38
40
41 if ( ( argc > 1 ) && ( strcmp( argv[1], "xxx" ) == 0 ) ) {
42
46 }
47 return 0;
48 } else {
49 if (!
quiet) printf(
"Testing Init/Shutdown/fork/init/exec/init\n");
50
54
56
57 if ( fork( ) == 0 ) {
58
61 test_fail( __FILE__, __LINE__,
"forked PAPI_library_init",
63 }
64
65 if ( execlp( argv[0], argv[0], "xxx", NULL ) == -1 ) {
67 }
68 } else {
69 wait( &status );
70 if ( WEXITSTATUS( status ) != 0 ) {
71 test_fail( __FILE__, __LINE__,
"fork", WEXITSTATUS( status ) );
72 }
73 }
74 }
75
77
78 return 0;
79
80}
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)