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