1 /* Copyright (C) 1997,99,2000,01 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) any later version.
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
14 You should have received a copy of the GNU Lesser General Public
15 License along with the GNU C Library; if not, write to the Free
16 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
26 /* Extend the operation enum. */
29 LIO_DSYNC
= LIO_NOP
+ 1,
31 LIO_READ64
= LIO_READ
| 128,
32 LIO_WRITE64
= LIO_WRITE
| 128
36 /* Union of the two request types. */
40 struct aiocb64 aiocb64
;
44 /* Used to synchronize. */
47 struct waitlist
*next
;
50 volatile int *counterp
;
51 /* The next field is used in asynchronous `lio_listio' operations. */
52 struct sigevent
*sigevp
;
53 /* XXX See requestlist, it's used to work around the broken signal
59 /* Status of a request. */
70 /* Used to queue requests.. */
75 struct requestlist
*last_fd
;
76 struct requestlist
*next_fd
;
77 struct requestlist
*next_prio
;
78 struct requestlist
*next_run
;
80 /* Pointer to the actual data. */
83 /* PID of the initiator thread.
84 XXX This is only necessary for the broken signal handling on Linux. */
87 /* List of waiting processes. */
88 struct waitlist
*waiting
;
92 /* Lock for global I/O list of requests. */
93 extern pthread_mutex_t __aio_requests_mutex
;
96 /* Enqueue request. */
97 extern struct requestlist
*__aio_enqueue_request (aiocb_union
*aiocbp
,
101 /* Find request entry for given AIO control block. */
102 extern struct requestlist
*__aio_find_req (aiocb_union
*elem
)
105 /* Find request entry for given file descriptor. */
106 extern struct requestlist
*__aio_find_req_fd (int fildes
) internal_function
;
108 /* Remove request from the list. */
109 extern void __aio_remove_request (struct requestlist
*last
,
110 struct requestlist
*req
, int all
)
113 /* Release the entry for the request. */
114 extern void __aio_free_request (struct requestlist
*req
) internal_function
;
116 /* Notify initiator of request and tell this everybody listening. */
117 extern void __aio_notify (struct requestlist
*req
) internal_function
;
119 /* Notify initiator of request. */
120 extern int __aio_notify_only (struct sigevent
*sigev
, pid_t caller_pid
)
123 /* Send the signal. */
124 extern int __aio_sigqueue (int sig
, const union sigval val
, pid_t caller_pid
)
127 #endif /* aio_misc.h */