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 /* For PATH_MAX */ 38 #include <linux/limits.h> 39 40 /*********************************************************************** 41 * The following globals are defined in parse_opts.c but must be 42 * externed here because they are used in the macros defined below. 43 ***********************************************************************/ 44 extern int STD_LOOP_COUNT; /* changed by -in to set loop count to n */ 45 46 extern long TEST_RETURN; 47 extern int TEST_ERRNO; 48 49 /*********************************************************************** 50 * TEST: calls a system call 51 * 52 * parameters: 53 * SCALL = system call and parameters to execute 54 * 55 ***********************************************************************/ 56 #define TEST(SCALL) \ 57 do { \ 58 errno = 0; \ 59 TEST_RETURN = SCALL; \ 60 TEST_ERRNO = errno; \ 61 } while (0) 62 63 /*********************************************************************** 64 * TEST_VOID: calls a system call 65 * 66 * parameters: 67 * SCALL = system call and parameters to execute 68 * 69 * Note: This is IDENTICAL to the TEST() macro except that it is intended 70 * for use with syscalls returning no values (void syscall()). The 71 * Typecasting nothing (void) into an unsigned integer causes compilation 72 * errors. 73 * 74 ***********************************************************************/ 75 #define TEST_VOID(SCALL) do { errno = 0; SCALL; TEST_ERRNO = errno; } while (0) 76 77 /*********************************************************************** 78 * TEST_PAUSE: Pause for SIGUSR1 if the pause flag is set. 79 * Just continue when signal comes in. 80 * 81 * parameters: 82 * none 83 * 84 ***********************************************************************/ 85 #define TEST_PAUSE usc_global_setup_hook(); 86 int usc_global_setup_hook(); 87 88 /*********************************************************************** 89 * TEST_LOOPING now call the usc_test_looping function. 90 * The function will return 1 if the test should continue 91 * iterating. 92 * 93 ***********************************************************************/ 94 #define TEST_LOOPING usc_test_looping 95 int usc_test_looping(int counter); 96 97 #endif /* __USCTEST_H__ */ 98