build: remove IRIX-specific build logic
[xfstests-dev.git] / include / tlibio.h
1 /*
2  * Copyright (c) 2000 Silicon Graphics, Inc.
3  * All Rights Reserved.
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms 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,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write the Free Software Foundation,
16  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
17  */
18
19 #define LIO_IO_SYNC             00001   /* read/write */
20 #define LIO_IO_ASYNC            00002   /* reada/writea/aio_write/aio_read */
21 #define LIO_IO_SLISTIO          00004   /* single stride sync listio */
22 #define LIO_IO_ALISTIO          00010   /* single stride async listio */
23 #define LIO_IO_SYNCV            00020   /* single-buffer readv/writev */
24 #define LIO_IO_SYNCP            00040   /* pread/pwrite */
25
26 #ifdef linux
27 #define LIO_IO_TYPES            00021   /* all io types */
28 #endif /* linux */
29
30 #define LIO_WAIT_NONE           00010000 /* return asap -- use with care */
31 #define LIO_WAIT_ACTIVE         00020000 /* spin looking at iosw fields, or EINPROGRESS */
32 #define LIO_WAIT_RECALL         00040000 /* call recall(2)/aio_suspend(3) */
33 #define LIO_WAIT_SIGPAUSE       00100000 /* call pause */
34 #define LIO_WAIT_SIGACTIVE      00200000 /* spin waiting for signal */
35
36 #ifdef linux
37 #define LIO_WAIT_TYPES          00300000 /* all wait types, except nowait */
38 #endif /* linux */
39
40 /* meta wait io  */
41 /*  00  000 0000 */
42
43 #ifdef linux
44 /* all signal wait types */
45 #define LIO_WAIT_SIGTYPES       (LIO_WAIT_SIGPAUSE)
46 #endif /* linux */
47
48 /*
49  * This bit provides a way to randomly pick an io type and wait method.
50  * lio_read_buffer() and lio_write_buffer() functions will call
51  * lio_random_methods() with the given method.
52  */
53 #define LIO_RANDOM              010000000
54
55 /*
56  * This bit provides a way for the programmer to use async i/o with
57  * signals and to use their own signal handler.  By default,
58  * the signal will only be given to the system call if the wait
59  * method is LIO_WAIT_SIGPAUSE or LIO_WAIT_SIGACTIVE.
60  * Whenever these wait methods are used, libio signal handler
61  * will be used.
62  */
63 #define LIO_USE_SIGNAL          020000000
64
65 /*
66  * prototypes/structures for functions in the libio.c module.  See comments
67  * in that module, or man page entries for information on the individual
68  * functions.
69  */
70
71 int  stride_bounds(int offset, int stride, int nstrides,
72                       int bytes_per_stride, int *min_byte, int *max_byte);
73
74 int  lio_set_debug(int level);
75 int  lio_parse_io_arg1(char *string);
76 void lio_help1(char *prefex);
77 int  lio_parse_io_arg2(char *string, char **badtoken);
78 void lio_help2(char *prefex);
79 int  lio_write_buffer(int fd, int method, char *buffer, int size,
80                       int sig, char **errmsg, long wrd);
81
82 int  lio_read_buffer(int fd, int method, char *buffer, int size,
83                      int sig, char **errmsg, long wrd);
84 int  lio_random_methods(long mask);
85
86 /*
87  * Define the structure that contains the infomation that is used
88  * by the parsing and help functions.
89  */
90 struct lio_info_type {
91     char *token;
92     int  bits;
93     char *desc;
94 };
95
96