1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (c) 2000 Silicon Graphics, Inc.
7 #define LIO_IO_SYNC 00001 /* read/write */
8 #define LIO_IO_ASYNC 00002 /* reada/writea/aio_write/aio_read */
9 #define LIO_IO_SLISTIO 00004 /* single stride sync listio */
10 #define LIO_IO_ALISTIO 00010 /* single stride async listio */
11 #define LIO_IO_SYNCV 00020 /* single-buffer readv/writev */
12 #define LIO_IO_SYNCP 00040 /* pread/pwrite */
15 #define LIO_IO_TYPES 00021 /* all io types */
18 #define LIO_WAIT_NONE 00010000 /* return asap -- use with care */
19 #define LIO_WAIT_ACTIVE 00020000 /* spin looking at iosw fields, or EINPROGRESS */
20 #define LIO_WAIT_RECALL 00040000 /* call recall(2)/aio_suspend(3) */
21 #define LIO_WAIT_SIGPAUSE 00100000 /* call pause */
22 #define LIO_WAIT_SIGACTIVE 00200000 /* spin waiting for signal */
25 #define LIO_WAIT_TYPES 00300000 /* all wait types, except nowait */
32 /* all signal wait types */
33 #define LIO_WAIT_SIGTYPES (LIO_WAIT_SIGPAUSE)
37 * This bit provides a way to randomly pick an io type and wait method.
38 * lio_read_buffer() and lio_write_buffer() functions will call
39 * lio_random_methods() with the given method.
41 #define LIO_RANDOM 010000000
44 * This bit provides a way for the programmer to use async i/o with
45 * signals and to use their own signal handler. By default,
46 * the signal will only be given to the system call if the wait
47 * method is LIO_WAIT_SIGPAUSE or LIO_WAIT_SIGACTIVE.
48 * Whenever these wait methods are used, libio signal handler
51 #define LIO_USE_SIGNAL 020000000
54 * prototypes/structures for functions in the libio.c module. See comments
55 * in that module, or man page entries for information on the individual
59 int stride_bounds(int offset, int stride, int nstrides,
60 int bytes_per_stride, int *min_byte, int *max_byte);
62 int lio_set_debug(int level);
63 int lio_parse_io_arg1(char *string);
64 void lio_help1(char *prefex);
65 int lio_parse_io_arg2(char *string, char **badtoken);
66 void lio_help2(char *prefex);
67 int lio_write_buffer(int fd, int method, char *buffer, int size,
68 int sig, char **errmsg, long wrd);
70 int lio_read_buffer(int fd, int method, char *buffer, int size,
71 int sig, char **errmsg, long wrd);
72 int lio_random_methods(long mask);
75 * Define the structure that contains the infomation that is used
76 * by the parsing and help functions.
78 struct lio_info_type {