blob: 775ba39f09a05cf60e510adb7966c48181bc72c1 [file] [log] [blame]
alaffincc2e5552000-07-27 17:13:18 +00001/*
2 * Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved.
Cyril Hrubis06f9fe42013-06-26 14:55:48 +02003 * Copyright (c) 2009-2013 Cyril Hrubis chrubis@suse.cz
subrata_modak88c166c2009-06-09 16:01:20 +00004 *
alaffincc2e5552000-07-27 17:13:18 +00005 * 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.
vapier45a8ba02009-07-20 10:59:32 +00008 *
alaffincc2e5552000-07-27 17:13:18 +00009 * 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.
vapier45a8ba02009-07-20 10:59:32 +000012 *
alaffincc2e5552000-07-27 17:13:18 +000013 * 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.
vapier45a8ba02009-07-20 10:59:32 +000019 *
alaffincc2e5552000-07-27 17:13:18 +000020 * You should have received a copy of the GNU General Public License along
Wanlong Gaofed96412012-10-24 10:10:29 +080021 * with this program; if not, write the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
vapier45a8ba02009-07-20 10:59:32 +000023 *
alaffincc2e5552000-07-27 17:13:18 +000024 * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
25 * Mountain View, CA 94043, or:
vapier45a8ba02009-07-20 10:59:32 +000026 *
27 * http://www.sgi.com
28 *
29 * For further information regarding this notice, see:
30 *
alaffincc2e5552000-07-27 17:13:18 +000031 * http://oss.sgi.com/projects/GenInfo/NoticeExplan/
32 */
33
alaffincc2e5552000-07-27 17:13:18 +000034#ifndef __TEST_H__
35#define __TEST_H__
36
37#include <stdio.h>
38#include <signal.h>
39#include <unistd.h>
plars28884512002-05-21 13:01:00 +000040#include <string.h>
41#include <stdlib.h>
Xiaoguang Wang46941672014-04-25 10:02:07 +080042#include <stdint.h>
alaffincc2e5552000-07-27 17:13:18 +000043
vapier2751f262008-02-11 16:39:54 +000044#include "compiler.h"
45
Cyril Hrubis42748952012-11-27 19:26:45 +010046#include "safe_file_ops.h"
Cyril Hrubisab8388c2012-11-28 15:42:17 +010047#include "tst_checkpoint.h"
Cyril Hrubis19240612012-12-11 18:51:54 +010048#include "tst_process_state.h"
Cyril Hrubis69c2ab02012-12-12 17:22:29 +010049#include "tst_resource.h"
Xiaoguang Wang6f6878f2014-06-24 15:11:39 +080050#include "tst_res_flags.h"
alaffincc2e5552000-07-27 17:13:18 +000051
Jan Stancek11a84a62013-10-17 12:44:49 +020052/* virt types for tst_is_virt() */
53#define VIRT_XEN 1 /* xen dom0/domU */
54
alaffincc2e5552000-07-27 17:13:18 +000055/*
alaffincc2e5552000-07-27 17:13:18 +000056 * Ensure that NUMSIGS is defined.
57 * It should be defined in signal.h or sys/signal.h on
58 * UNICOS/mk and IRIX systems. On UNICOS systems,
59 * it is not defined, thus it is being set to UNICOS's NSIG.
vapier45a8ba02009-07-20 10:59:32 +000060 * Note: IRIX's NSIG (signals are 1-(NSIG-1))
alaffincc2e5552000-07-27 17:13:18 +000061 * is not same meaning as UNICOS/UMK's NSIG (signals 1-NSIG)
62 */
63#ifndef NUMSIGS
64#define NUMSIGS NSIG
65#endif
66
67
68/* defines for unexpected signal setup routine (set_usig.c) */
69#define FORK 1 /* SIGCLD is to be ignored */
70#define NOFORK 0 /* SIGCLD is to be caught */
subrata_modak40bc6aa2009-09-27 17:46:05 +000071#define DEF_HANDLER SIG_ERR /* tells set_usig() to use default signal handler */
alaffincc2e5552000-07-27 17:13:18 +000072
73/*
74 * The following defines are used to control tst_res and t_result reporting.
75 */
76
77#define TOUTPUT "TOUTPUT" /* The name of the environment variable */
78 /* that can be set to one of the following */
79 /* strings to control tst_res output */
80 /* If not set, TOUT_VERBOSE_S is assumed */
81
alaffincc2e5552000-07-27 17:13:18 +000082/*
robbiewd34d5812005-07-11 22:28:09 +000083 * fork() can't be used on uClinux systems, so use FORK_OR_VFORK instead,
84 * which will run vfork() on uClinux.
85 * mmap() doesn't support MAP_PRIVATE on uClinux systems, so use
86 * MAP_PRIVATE_EXCEPT_UCLINUX instead, which will skip the option on uClinux.
87 * If MAP_PRIVATE really is required, the test can not be run on uClinux.
88 */
89#ifdef UCLINUX
Cyril Hrubis3f0510c2014-02-06 13:50:14 +010090# define FORK_OR_VFORK tst_vfork
91# define MAP_PRIVATE_EXCEPT_UCLINUX 0
92/* tst_flush() + vfork() */
93pid_t tst_vfork(void);
robbiewd34d5812005-07-11 22:28:09 +000094#else
Cyril Hrubis3f0510c2014-02-06 13:50:14 +010095# define FORK_OR_VFORK tst_fork
96# define MAP_PRIVATE_EXCEPT_UCLINUX MAP_PRIVATE
robbiewd34d5812005-07-11 22:28:09 +000097#endif
98
99/*
Alexey Kodanevbf17abf2014-02-18 18:08:30 +0400100 * Macro to use for making functions called only once in
101 * multi-threaded tests such as init or cleanup function.
102 * The first call to @name_fn function by any thread shall
103 * call the @exec_fn. Subsequent calls shall not call @exec_fn.
104 * *_fn functions must not take any arguments.
105 */
106#define TST_DECLARE_ONCE_FN(name_fn, exec_fn) \
107 void name_fn(void) \
108 { \
109 static pthread_once_t ltp_once = PTHREAD_ONCE_INIT; \
110 pthread_once(&ltp_once, exec_fn); \
111 }
112
113/*
Garrett Cooperaec33cd2010-12-17 04:14:16 -0800114 * lib/forker.c
alaffincc2e5552000-07-27 17:13:18 +0000115 */
Garrett Cooperaec33cd2010-12-17 04:14:16 -0800116extern int Forker_pids[];
117extern int Forker_npids;
118
119/* lib/tst_res.c */
vapier9799ea12009-07-20 02:42:32 +0000120const char *strttype(int ttype);
Xiaoguang Wanga161c6f2014-07-21 17:00:04 +0800121void tst_res_(const char *file, const int lineno, int ttype,
122 const char *fname, const char *arg_fmt, ...)
123 __attribute__ ((format (printf, 5, 6)));
124
125#define tst_res(ttype, fname, arg_fmt, ...) \
126 tst_res_(__FILE__, __LINE__, (ttype), (fname), \
127 (arg_fmt), ##__VA_ARGS__)
128
129void tst_resm_(const char *file, const int lineno, int ttype,
130 const char *arg_fmt, ...)
Alexey Kodanev04a34ba2013-05-23 11:03:18 +0400131 __attribute__ ((format (printf, 4, 5)));
Xiaoguang Wanga161c6f2014-07-21 17:00:04 +0800132#define tst_resm(ttype, arg_fmt, ...) \
133 tst_resm_(__FILE__, __LINE__, (ttype), \
134 (arg_fmt), ##__VA_ARGS__)
135
136void tst_resm_hexd_(const char *file, const int lineno, int ttype,
137 const void *buf, size_t size, const char *arg_fmt, ...)
138 __attribute__ ((format (printf, 6, 7)));
139#define tst_resm_hexd(ttype, buf, size, arg_fmt, ...) \
140 tst_resm_hexd_(__FILE__, __LINE__, (ttype), (buf), (size), \
141 (arg_fmt), ##__VA_ARGS__)
142
143void tst_brk_(const char *file, const int lineno, int ttype,
144 const char *fname, void (*func)(void), const char *arg_fmt, ...)
145 __attribute__ ((format (printf, 6, 7)));
146#define tst_brk(ttype, fname, func, arg_fmt, ...) \
147 tst_brk_(__FILE__, __LINE__, (ttype), (fname), (func), \
148 (arg_fmt), ##__VA_ARGS__)
149
150void tst_brkm_(const char *file, const int lineno, int ttype,
151 void (*func)(void), const char *arg_fmt, ...)
152 __attribute__ ((format (printf, 5, 6))) LTP_ATTRIBUTE_NORETURN;
153#define tst_brkm(ttype, func, arg_fmt, ...) \
154 tst_brkm_(__FILE__, __LINE__, (ttype), (func), \
155 (arg_fmt), ##__VA_ARGS__)
156
subrata_modak88c166c2009-06-09 16:01:20 +0000157void tst_require_root(void (*func)(void));
158int tst_environ(void);
159void tst_exit(void) LTP_ATTRIBUTE_NORETURN;
160void tst_flush(void);
alaffincc2e5552000-07-27 17:13:18 +0000161
Cyril Hrubisddd3b852014-02-03 17:10:04 +0100162/*
163 * tst_flush() + fork
Xiaoguang Wang8c1e0b32014-07-28 19:51:39 +0800164 * NOTE: tst_fork() will reset T_exitval to 0 for child process.
Cyril Hrubisddd3b852014-02-03 17:10:04 +0100165 */
166pid_t tst_fork(void);
167
Xiaoguang Wang8c1e0b32014-07-28 19:51:39 +0800168/* lib/tst_res.c */
169/*
170 * In case we need do real test work in child process parent process can use
171 * tst_record_childstatus() to make child process's test results propagated to
172 * parent process correctly.
173 *
174 * The child can use tst_resm(), tst_brkm() followed by the tst_exit() or
175 * plain old exit() (with TPASS, TFAIL and TBROK).
176 *
177 * WARNING: Be wary that the child cleanup function passed to tst_brkm()
178 * must clean only resources the child has allocated. E.g. the
179 * child cleanup is different function from the parent cleanup.
180 */
181void tst_record_childstatus(void (*cleanup)(void), pid_t child);
182
Caspar Zhangd59a6592013-03-07 14:59:12 +0800183extern int tst_count;
alaffincc2e5552000-07-27 17:13:18 +0000184
Garrett Cooperaec33cd2010-12-17 04:14:16 -0800185/* lib/tst_sig.c */
subrata_modak88c166c2009-06-09 16:01:20 +0000186void tst_sig(int fork_flag, void (*handler)(), void (*cleanup)());
alaffincc2e5552000-07-27 17:13:18 +0000187
Garrett Cooperaec33cd2010-12-17 04:14:16 -0800188/* lib/tst_tmpdir.c */
Marios Makris60b1baa2012-08-09 20:36:46 +0300189
190/* tst_tmpdir()
191 *
192 * Create a unique temporary directory and chdir() to it. It expects the caller
193 * to have defined/initialized the TCID/TST_TOTAL global variables.
194 * The TESTDIR global variable will be set to the directory that gets used
195 * as the testing directory.
196 *
197 * NOTE: This function must be called BEFORE any activity that would require
198 * CLEANUP. If tst_tmpdir() fails, it cleans up afer itself and calls
199 * tst_exit() (i.e. does not return).
200 */
subrata_modak88c166c2009-06-09 16:01:20 +0000201void tst_tmpdir(void);
Marios Makris60b1baa2012-08-09 20:36:46 +0300202/* tst_rmdir()
203 *
204 * Recursively remove the temporary directory created by tst_tmpdir().
205 * This function is intended ONLY as a companion to tst_tmpdir().
Marios Makris60b1baa2012-08-09 20:36:46 +0300206 */
subrata_modak88c166c2009-06-09 16:01:20 +0000207void tst_rmdir(void);
Cyril Hrubis9c31ad22014-05-14 17:15:39 +0200208/* tst_get_tmpdir()
Marios Makris60b1baa2012-08-09 20:36:46 +0300209 *
210 * Return a copy of the test temp directory as seen by LTP. This is for
211 * path-oriented tests like chroot, etc, that may munge the path a bit.
212 *
213 * FREE VARIABLE AFTER USE IF IT IS REUSED!
214 */
Cyril Hrubis9c31ad22014-05-14 17:15:39 +0200215char *tst_get_tmpdir(void);
Cyril Hrubisab8388c2012-11-28 15:42:17 +0100216/*
217 * Returns 1 if temp directory was created.
218 */
219int tst_tmpdir_created(void);
alaffincc2e5552000-07-27 17:13:18 +0000220
Garrett Cooperaec33cd2010-12-17 04:14:16 -0800221/* lib/get_high_address.c */
subrata_modak88c166c2009-06-09 16:01:20 +0000222char *get_high_address(void);
robbiewf3a83d52002-05-28 16:26:16 +0000223
Garrett Cooperaec33cd2010-12-17 04:14:16 -0800224/* lib/tst_kvercmp.c */
subrata_modak88c166c2009-06-09 16:01:20 +0000225void tst_getkver(int *k1, int *k2, int *k3);
226int tst_kvercmp(int r1, int r2, int r3);
robbiew143090a2005-01-17 22:10:09 +0000227
Wanlong Gaoef73cc92013-07-09 15:54:51 +0800228struct tst_kern_exv {
229 char *dist_name;
230 char *extra_ver;
231};
232
233int tst_kvercmp2(int r1, int r2, int r3, struct tst_kern_exv *vers);
234
Xiaoguang Wang46941672014-04-25 10:02:07 +0800235enum {
236 TST_BYTES = 1,
237 TST_KB = 1024,
238 TST_MB = 1048576,
239 TST_GB = 1073741824,
240};
241
242/* lib/tst_fs_has_free.c
243 *
244 * @path: path is the pathname of any file within the mounted file system
245 * @mult: mult should be TST_KB, TST_MB or TST_GB
246 * the required free space is calculated by @size * @mult
247 */
248int tst_fs_has_free(void (*cleanup)(void), const char *path,
249 unsigned int size, unsigned int mult);
subrata_modak88c166c2009-06-09 16:01:20 +0000250
Jan Stancek11a84a62013-10-17 12:44:49 +0200251int tst_is_virt(int virt_type);
252
Garrett Cooperaec33cd2010-12-17 04:14:16 -0800253/* lib/self_exec.c */
Mike Frysinger55d8ae52014-02-13 04:11:45 -0500254void maybe_run_child(void (*child)(), const char *fmt, ...);
255int self_exec(const char *argv0, const char *fmt, ...);
subrata_modak744305e2008-08-19 07:00:49 +0000256
Garrett Cooperaec33cd2010-12-17 04:14:16 -0800257/* Functions from lib/cloner.c */
Zeng Linggang1db62662014-01-09 20:10:11 +0800258int ltp_clone(unsigned long flags, int (*fn)(void *arg), void *arg,
259 size_t stack_size, void *stack);
260int ltp_clone7(unsigned long flags, int (*fn)(void *arg), void *arg,
zenglg.jy5f5cb632013-12-18 17:29:51 +0800261 size_t stack_size, void *stack, ...);
vapierf6d7f092009-11-03 20:07:35 +0000262int ltp_clone_malloc(unsigned long clone_flags, int (*fn)(void *arg),
263 void *arg, size_t stacksize);
264int ltp_clone_quick(unsigned long clone_flags, int (*fn)(void *arg),
265 void *arg);
266#define clone(...) use_the_ltp_clone_functions,do_not_use_clone
267
Garrett Cooperaec33cd2010-12-17 04:14:16 -0800268/* Function from lib/get_path.c */
Subrata Modakca758b72010-05-18 01:28:14 +0530269int tst_get_path(const char *prog_name, char *buf, size_t buf_len);
270
Wanlong Gao3b535a82012-10-18 16:35:14 +0800271/* lib/tst_cpu.c */
272long tst_ncpus(void);
Zeng Linggangda642ba2014-09-10 13:25:57 +0800273long tst_ncpus_conf(void);
Wanlong Gao3b535a82012-10-18 16:35:14 +0800274long tst_ncpus_max(void);
275
Alexey Kodanev4bc55ec2013-06-27 18:52:22 +0400276/* lib/tst_run_cmd.c
277 *
278 * vfork() + execvp() specified program.
279 * @argv: a list of two (at least program name + NULL) or more pointers that
280 * represent the argument list to the new program. The array of pointers
281 * must be terminated by a NULL pointer.
Stanislav kholmanskikhbee0a942013-08-06 16:54:37 +0400282 * @stdout_fd: file descriptor where to redirect stdout. Set -1 if
283 * redirection is not needed.
284 * @stderr_fd: file descriptor where to redirect stderr. Set -1 if
285 * redirection is not needed.
Alexey Kodanev4bc55ec2013-06-27 18:52:22 +0400286 */
Stanislav kholmanskikhbee0a942013-08-06 16:54:37 +0400287void tst_run_cmd_fds(void (cleanup_fn)(void),
Stanislav Kholmanskikhe63337a2013-08-08 11:18:06 +0400288 const char *const argv[],
Stanislav kholmanskikhbee0a942013-08-06 16:54:37 +0400289 int stdout_fd,
290 int stderr_fd);
291
292/* Executes tst_run_cmd_fds() and redirects its output to a file
293 * @stdout_path: path where to redirect stdout. Set NULL if redirection is
294 * not needed.
295 * @stderr_path: path where to redirect stderr. Set NULL if redirection is
296 * not needed.
297 */
298void tst_run_cmd(void (cleanup_fn)(void),
Stanislav Kholmanskikhe63337a2013-08-08 11:18:06 +0400299 const char *const argv[],
Stanislav kholmanskikhbee0a942013-08-06 16:54:37 +0400300 const char *stdout_path,
301 const char *stderr_path);
Alexey Kodanev4bc55ec2013-06-27 18:52:22 +0400302
Cyril Hrubis2492ce22013-08-08 14:24:38 +0200303/* lib/tst_mkfs.c
304 *
305 * @dev: path to a device
306 * @fs_type: filesystem type
Xiaoguang Wang35266852014-03-26 17:23:45 +0800307 * @fs_opts: NULL or NULL terminated array of extra mkfs options
Cyril Hrubis2492ce22013-08-08 14:24:38 +0200308 */
309void tst_mkfs(void (cleanup_fn)(void), const char *dev,
Xiaoguang Wang35266852014-03-26 17:23:45 +0800310 const char *fs_type, const char *const fs_opts[]);
Cyril Hrubis2492ce22013-08-08 14:24:38 +0200311
Cyril Hrubise6c24c12014-06-19 12:46:45 +0200312/*
313 * Returns filesystem type to be used for the testing. Unless your test is
314 * designed for specific filesystem you should use this function to the tested
315 * filesytem.
316 *
317 * If TST_DEV_FS_TYPE is set the function returns it's content,
318 * otherwise default fs type hardcoded in the library is returned.
319 */
320const char *tst_dev_fs_type(void);
321
Cyril Hrubis85e787e2014-06-18 17:09:21 +0200322/* lib/tst_device.c
323 *
324 * Acquires test device.
325 *
326 * Can be used only once, i.e. you cannot get two different devices.
327 *
328 * Looks for LTP_DEV env variable first (which may be passed by the test
329 * driver or by a user) and returns just it's value if found.
330 *
331 * Otherwise creates a temp file and loop device.
332 *
333 * Note that you have to call tst_tmpdir() beforehand.
334 *
335 * Returns path to the device or NULL if it cannot be created.
336 */
337const char *tst_acquire_device(void (cleanup_fn)(void));
338
339/* lib/tst_device.c
340 * @dev: device path returned by the tst_acquire_device()
341 */
342void tst_release_device(void (cleanup_fn)(void), const char *dev);
343
Stanislav Kholmanskikh1d5d4842013-08-14 10:01:46 +0400344/* lib/tst_fill_file.c
345 *
346 * Creates/ovewrites a file with specified pattern
347 * @path: path to file
348 * @pattern: pattern
349 * @bs: block size
350 * @bcount: blocks amount
351 */
352int tst_fill_file(const char *path, char pattern, size_t bs, size_t bcount);
353
Jan Stanceke77bf552014-03-07 10:08:30 +0100354/* lib/tst_net.c
355 *
356 * Return unused port
357 */
358unsigned short tst_get_unused_port(void (cleanup_fn)(void),
359 unsigned short family, int type);
360
Xiaoguang Wang1a6f68a2014-05-13 19:02:59 +0800361/* lib/tst_res.c
362 * tst_strsig converts signal's value to corresponding string.
363 * tst_strerrno converts errno to corresponding string.
364 */
365const char *tst_strsig(int sig);
366const char *tst_strerrno(int err);
367
gux.fnst@cn.fujitsu.com2db57392014-05-08 17:50:51 +0800368/* lib/tst_path_has_mnt_flags.c
369 *
370 * Check whether a path is on a filesystem that is mounted with
371 * specified flags
Cyril Hrubis78fe6422014-05-14 16:53:04 +0200372 * @path: path to file, if path is NULL tst_tmpdir is used.
gux.fnst@cn.fujitsu.com2db57392014-05-08 17:50:51 +0800373 * @flags: NULL or NULL terminated array of mount flags
374 *
375 * Return: 0..n - number of flags matched
376 */
377int tst_path_has_mnt_flags(void (cleanup_fn)(void),
378 const char *path, const char *flags[]);
379
Xiaoguang Wang3db20822014-06-09 15:37:10 +0800380/*
381 * lib/tst_fs_link_count.c
382 *
383 * Try to get maximum number of hard links to a regular file inside the @dir.
384 *
385 * Note: This number depends on the filesystem @dir is on.
386 *
387 * The code uses link(2) to create hard links to a single file until it gets
388 * EMLINK or creates 65535 links.
389 *
390 * If limit is hit maximal number of hardlinks is returned and the the @dir is
391 * filled with hardlinks in format "testfile%i" where i belongs to [0, limit)
392 * interval.
393 *
394 * If no limit is hit (succed to create 65535 without error) or if link()
395 * failed with ENOSPC or EDQUOT zero is returned previously created files are
396 * removed.
397 */
398int tst_fs_fill_hardlinks(void (*cleanup) (void), const char *dir);
399
400/*
401 * lib/tst_fs_link_count.c
402 *
403 * Try to get maximum number of subdirectories in directory.
404 *
405 * Note: This number depends on the filesystem @dir is on.
406 *
407 * The code uses mkdir(2) to create directories in @dir until it gets EMLINK
408 * or creates 65535 directories.
409 *
410 * If limit is hit the maximal number of subdirectories is returned and the
411 * @dir is filled with subdirectories in format "testdir%i" where i belongs to
412 * [0, limit - 2) interval (because each newly created dir has two links
413 * allready the '.' and link from parent dir).
414 *
415 * If no limit is hit or mkdir() failed with ENOSPC or EDQUOT zero is returned
416 * previously created directories are removed.
417 *
418 */
419int tst_fs_fill_subdirs(void (*cleanup) (void), const char *dir);
420
Stanislav Kholmanskikh07a10332014-06-30 14:48:22 +0400421/*
422 * lib/tst_pid.c
423 *
Stanislav Kholmanskikh502e42f2014-06-30 14:48:23 +0400424 * Get a pid value not used by the OS
Stanislav Kholmanskikh07a10332014-06-30 14:48:22 +0400425 */
Stanislav Kholmanskikh502e42f2014-06-30 14:48:23 +0400426pid_t tst_get_unused_pid(void (*cleanup_fn) (void));
Stanislav Kholmanskikh07a10332014-06-30 14:48:22 +0400427
428/*
429 * lib/tst_pid.c
430 *
Stanislav Kholmanskikh502e42f2014-06-30 14:48:23 +0400431 * Returns number of free pids by substarction of the number of pids
Stanislav Kholmanskikh07a10332014-06-30 14:48:22 +0400432 * currently used ('ps -eT') from max_pids
433 */
Stanislav Kholmanskikh502e42f2014-06-30 14:48:23 +0400434int tst_get_free_pids(void (*cleanup_fn) (void));
Stanislav Kholmanskikh07a10332014-06-30 14:48:22 +0400435
subrata_modak744305e2008-08-19 07:00:49 +0000436#ifdef TST_USE_COMPAT16_SYSCALL
437#define TCID_BIT_SUFFIX "_16"
438#elif TST_USE_NEWER64_SYSCALL
439#define TCID_BIT_SUFFIX "_64"
440#else
441#define TCID_BIT_SUFFIX ""
442#endif
subrata_modak88c166c2009-06-09 16:01:20 +0000443#define TCID_DEFINE(ID) char *TCID = (#ID TCID_BIT_SUFFIX)
subrata_modak744305e2008-08-19 07:00:49 +0000444
subrata_modak88c166c2009-06-09 16:01:20 +0000445#endif /* __TEST_H__ */