1 /*
2  * Copyright (C) 1996-2021 The Squid Software Foundation and contributors
3  *
4  * Squid software is distributed under GPLv2+ license and includes
5  * contributions from numerous individuals and organizations.
6  * Please see the COPYING and CONTRIBUTORS files for details.
7  */
8 
9 #ifndef __WIN32_AIO_H__
10 #define __WIN32_AIO_H__
11 
12 #if HAVE_DISKIO_MODULE_AIO
13 
14 #ifndef off64_t
15 typedef int64_t off64_t;
16 #endif
17 
18 #if _SQUID_WINDOWS_
19 
20 union sigval {
21     int sival_int; /* integer value */
22     void *sival_ptr; /* pointer value */
23 };
24 
25 struct sigevent {
26     int sigev_notify; /* notification mode */
27     int sigev_signo; /* signal number */
28     union sigval sigev_value; /* signal value */
29 };
30 
31 // #endif
32 
33 struct aiocb64 {
34     int aio_fildes; /* file descriptor */
35     void *aio_buf; /* buffer location */
36     size_t aio_nbytes; /* length of transfer */
37     off64_t aio_offset; /* file offset */
38     int aio_reqprio; /* request priority offset */
39 
40     struct sigevent aio_sigevent; /* signal number and offset */
41     int aio_lio_opcode; /* listio operation */
42 };
43 
44 struct aiocb {
45     int aio_fildes; /* file descriptor */
46     void *aio_buf; /* buffer location */
47     size_t aio_nbytes; /* length of transfer */
48 #if (_FILE_OFFSET_BITS == 64)
49 
50     off64_t aio_offset; /* file offset */
51 #else
52 
53     off_t aio_offset; /* file offset */
54 #endif
55 
56     int aio_reqprio; /* request priority offset */
57 
58     struct sigevent aio_sigevent; /* signal number and offset */
59     int aio_lio_opcode; /* listio operation */
60 };
61 
62 int aio_read(struct aiocb *);
63 
64 int aio_write(struct aiocb *);
65 
66 ssize_t aio_return(struct aiocb *);
67 
68 int aio_error(const struct aiocb *);
69 
70 int aio_read64(struct aiocb64 *);
71 
72 int aio_write64(struct aiocb64 *);
73 
74 ssize_t aio_return64(struct aiocb64 *);
75 
76 int aio_error64(const struct aiocb64 *);
77 int aio_open(const char *, int);
78 void aio_close(int);
79 
80 #endif /* _SQUID_WINDOWS_ */
81 #endif /* HAVE_DISKIO_MODULE_AIO */
82 #endif /* __WIN32_AIO_H__ */
83 
84