|
Packit |
577717 |
/*
|
|
Packit |
577717 |
* File: exec.c
|
|
Packit |
577717 |
* Author: Philip Mucci
|
|
Packit |
577717 |
* mucci@cs.utk.edu
|
|
Packit |
577717 |
* Mods: <your name here>
|
|
Packit |
577717 |
* <your email address>
|
|
Packit |
577717 |
*/
|
|
Packit |
577717 |
|
|
Packit |
577717 |
/* This file performs the following test: start, stop and timer
|
|
Packit |
577717 |
functionality for a parent and a forked child. */
|
|
Packit |
577717 |
|
|
Packit |
577717 |
#include <stdio.h>
|
|
Packit |
577717 |
#include <stdlib.h>
|
|
Packit |
577717 |
#include <string.h>
|
|
Packit |
577717 |
#include <unistd.h>
|
|
Packit |
577717 |
#include <sys/wait.h>
|
|
Packit |
577717 |
|
|
Packit |
577717 |
#include "papi.h"
|
|
Packit |
577717 |
#include "papi_test.h"
|
|
Packit |
577717 |
|
|
Packit |
577717 |
int
|
|
Packit |
577717 |
main( int argc, char **argv )
|
|
Packit |
577717 |
{
|
|
Packit |
577717 |
int retval;
|
|
Packit |
577717 |
|
|
Packit |
577717 |
tests_quiet( argc, argv ); /* Set TESTS_QUIET variable */
|
|
Packit |
577717 |
|
|
Packit |
577717 |
if ( ( argc > 1 ) && ( strcmp( argv[1], "xxx" ) == 0 ) ) {
|
|
Packit |
577717 |
retval = PAPI_library_init( PAPI_VER_CURRENT );
|
|
Packit |
577717 |
if ( retval != PAPI_VER_CURRENT )
|
|
Packit |
577717 |
test_fail( __FILE__, __LINE__, "execed PAPI_library_init", retval );
|
|
Packit |
577717 |
} else {
|
|
Packit |
577717 |
retval = PAPI_library_init( PAPI_VER_CURRENT );
|
|
Packit |
577717 |
if ( retval != PAPI_VER_CURRENT )
|
|
Packit |
577717 |
test_fail( __FILE__, __LINE__, "main PAPI_library_init", retval );
|
|
Packit |
577717 |
|
|
Packit |
577717 |
if ( execlp( argv[0], argv[0], "xxx", NULL ) == -1 )
|
|
Packit |
577717 |
test_fail( __FILE__, __LINE__, "execlp", PAPI_ESYS );
|
|
Packit |
577717 |
}
|
|
Packit |
577717 |
|
|
Packit |
577717 |
test_pass( __FILE__ );
|
|
Packit |
577717 |
|
|
Packit |
577717 |
return 0;
|
|
Packit |
577717 |
|
|
Packit |
577717 |
}
|