1*49cdfc7eSAndroid Build Coastguard Worker /* 2*49cdfc7eSAndroid Build Coastguard Worker * Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved. 3*49cdfc7eSAndroid Build Coastguard Worker * Author: William Roske 4*49cdfc7eSAndroid Build Coastguard Worker * 5*49cdfc7eSAndroid Build Coastguard Worker * This program is free software; you can redistribute it and/or modify it 6*49cdfc7eSAndroid Build Coastguard Worker * under the terms of version 2 of the GNU General Public License as 7*49cdfc7eSAndroid Build Coastguard Worker * published by the Free Software Foundation. 8*49cdfc7eSAndroid Build Coastguard Worker * 9*49cdfc7eSAndroid Build Coastguard Worker * This program is distributed in the hope that it would be useful, but 10*49cdfc7eSAndroid Build Coastguard Worker * WITHOUT ANY WARRANTY; without even the implied warranty of 11*49cdfc7eSAndroid Build Coastguard Worker * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12*49cdfc7eSAndroid Build Coastguard Worker * 13*49cdfc7eSAndroid Build Coastguard Worker * Further, this software is distributed without any warranty that it is 14*49cdfc7eSAndroid Build Coastguard Worker * free of the rightful claim of any third person regarding infringement 15*49cdfc7eSAndroid Build Coastguard Worker * or the like. Any license provided herein, whether implied or 16*49cdfc7eSAndroid Build Coastguard Worker * otherwise, applies only to this software file. Patent licenses, if 17*49cdfc7eSAndroid Build Coastguard Worker * any, provided herein do not apply to combinations of this program with 18*49cdfc7eSAndroid Build Coastguard Worker * other software, or any other product whatsoever. 19*49cdfc7eSAndroid Build Coastguard Worker * 20*49cdfc7eSAndroid Build Coastguard Worker * You should have received a copy of the GNU General Public License along 21*49cdfc7eSAndroid Build Coastguard Worker * with this program; if not, write the Free Software Foundation, Inc., 22*49cdfc7eSAndroid Build Coastguard Worker * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 23*49cdfc7eSAndroid Build Coastguard Worker * 24*49cdfc7eSAndroid Build Coastguard Worker * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, 25*49cdfc7eSAndroid Build Coastguard Worker * Mountain View, CA 94043, or: 26*49cdfc7eSAndroid Build Coastguard Worker * 27*49cdfc7eSAndroid Build Coastguard Worker * http://www.sgi.com 28*49cdfc7eSAndroid Build Coastguard Worker * 29*49cdfc7eSAndroid Build Coastguard Worker * For further information regarding this notice, see: 30*49cdfc7eSAndroid Build Coastguard Worker * 31*49cdfc7eSAndroid Build Coastguard Worker * http://oss.sgi.com/projects/GenInfo/NoticeExplan/ 32*49cdfc7eSAndroid Build Coastguard Worker */ 33*49cdfc7eSAndroid Build Coastguard Worker 34*49cdfc7eSAndroid Build Coastguard Worker #ifndef __USCTEST_H__ 35*49cdfc7eSAndroid Build Coastguard Worker #define __USCTEST_H__ 36*49cdfc7eSAndroid Build Coastguard Worker 37*49cdfc7eSAndroid Build Coastguard Worker /* For PATH_MAX */ 38*49cdfc7eSAndroid Build Coastguard Worker #include <linux/limits.h> 39*49cdfc7eSAndroid Build Coastguard Worker 40*49cdfc7eSAndroid Build Coastguard Worker /*********************************************************************** 41*49cdfc7eSAndroid Build Coastguard Worker * The following globals are defined in parse_opts.c but must be 42*49cdfc7eSAndroid Build Coastguard Worker * externed here because they are used in the macros defined below. 43*49cdfc7eSAndroid Build Coastguard Worker ***********************************************************************/ 44*49cdfc7eSAndroid Build Coastguard Worker extern int STD_LOOP_COUNT; /* changed by -in to set loop count to n */ 45*49cdfc7eSAndroid Build Coastguard Worker 46*49cdfc7eSAndroid Build Coastguard Worker extern long TEST_RETURN; 47*49cdfc7eSAndroid Build Coastguard Worker extern int TEST_ERRNO; 48*49cdfc7eSAndroid Build Coastguard Worker 49*49cdfc7eSAndroid Build Coastguard Worker /*********************************************************************** 50*49cdfc7eSAndroid Build Coastguard Worker * TEST: calls a system call 51*49cdfc7eSAndroid Build Coastguard Worker * 52*49cdfc7eSAndroid Build Coastguard Worker * parameters: 53*49cdfc7eSAndroid Build Coastguard Worker * SCALL = system call and parameters to execute 54*49cdfc7eSAndroid Build Coastguard Worker * 55*49cdfc7eSAndroid Build Coastguard Worker ***********************************************************************/ 56*49cdfc7eSAndroid Build Coastguard Worker #define TEST(SCALL) \ 57*49cdfc7eSAndroid Build Coastguard Worker do { \ 58*49cdfc7eSAndroid Build Coastguard Worker errno = 0; \ 59*49cdfc7eSAndroid Build Coastguard Worker TEST_RETURN = SCALL; \ 60*49cdfc7eSAndroid Build Coastguard Worker TEST_ERRNO = errno; \ 61*49cdfc7eSAndroid Build Coastguard Worker } while (0) 62*49cdfc7eSAndroid Build Coastguard Worker 63*49cdfc7eSAndroid Build Coastguard Worker /*********************************************************************** 64*49cdfc7eSAndroid Build Coastguard Worker * TEST_VOID: calls a system call 65*49cdfc7eSAndroid Build Coastguard Worker * 66*49cdfc7eSAndroid Build Coastguard Worker * parameters: 67*49cdfc7eSAndroid Build Coastguard Worker * SCALL = system call and parameters to execute 68*49cdfc7eSAndroid Build Coastguard Worker * 69*49cdfc7eSAndroid Build Coastguard Worker * Note: This is IDENTICAL to the TEST() macro except that it is intended 70*49cdfc7eSAndroid Build Coastguard Worker * for use with syscalls returning no values (void syscall()). The 71*49cdfc7eSAndroid Build Coastguard Worker * Typecasting nothing (void) into an unsigned integer causes compilation 72*49cdfc7eSAndroid Build Coastguard Worker * errors. 73*49cdfc7eSAndroid Build Coastguard Worker * 74*49cdfc7eSAndroid Build Coastguard Worker ***********************************************************************/ 75*49cdfc7eSAndroid Build Coastguard Worker #define TEST_VOID(SCALL) do { errno = 0; SCALL; TEST_ERRNO = errno; } while (0) 76*49cdfc7eSAndroid Build Coastguard Worker 77*49cdfc7eSAndroid Build Coastguard Worker /*********************************************************************** 78*49cdfc7eSAndroid Build Coastguard Worker * TEST_PAUSE: Pause for SIGUSR1 if the pause flag is set. 79*49cdfc7eSAndroid Build Coastguard Worker * Just continue when signal comes in. 80*49cdfc7eSAndroid Build Coastguard Worker * 81*49cdfc7eSAndroid Build Coastguard Worker * parameters: 82*49cdfc7eSAndroid Build Coastguard Worker * none 83*49cdfc7eSAndroid Build Coastguard Worker * 84*49cdfc7eSAndroid Build Coastguard Worker ***********************************************************************/ 85*49cdfc7eSAndroid Build Coastguard Worker #define TEST_PAUSE usc_global_setup_hook(); 86*49cdfc7eSAndroid Build Coastguard Worker int usc_global_setup_hook(); 87*49cdfc7eSAndroid Build Coastguard Worker 88*49cdfc7eSAndroid Build Coastguard Worker /*********************************************************************** 89*49cdfc7eSAndroid Build Coastguard Worker * TEST_LOOPING now call the usc_test_looping function. 90*49cdfc7eSAndroid Build Coastguard Worker * The function will return 1 if the test should continue 91*49cdfc7eSAndroid Build Coastguard Worker * iterating. 92*49cdfc7eSAndroid Build Coastguard Worker * 93*49cdfc7eSAndroid Build Coastguard Worker ***********************************************************************/ 94*49cdfc7eSAndroid Build Coastguard Worker #define TEST_LOOPING usc_test_looping 95*49cdfc7eSAndroid Build Coastguard Worker int usc_test_looping(int counter); 96*49cdfc7eSAndroid Build Coastguard Worker 97*49cdfc7eSAndroid Build Coastguard Worker #endif /* __USCTEST_H__ */ 98