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