-#define AIO_PENDING_SIZE 10
-static sig_atomic_t signals_received;
-static int outstanding_aio_calls;
-static uint16 aio_pending_array[AIO_PENDING_SIZE];
-
-/****************************************************************************
- Signal handler when an aio request completes.
-*****************************************************************************/
-
-static void signal_handler(int sig, siginfo_t *info, void *unused)
-{
- if (signals_received < AIO_PENDING_SIZE - 1) {
- aio_pending_array[signals_received] = info->si_value.sival_int;
- signals_received++;
- } /* Else signal is lost. */
- sys_select_signal(RT_SIGNAL_AIO);
-}
-
-/****************************************************************************
- Is there a signal waiting ?
-*****************************************************************************/
-
-BOOL aio_finished(void)
-{
- return (signals_received != 0);
-}
-
-/****************************************************************************
- Initialize the signal handler for aio read/write.
-*****************************************************************************/
-
-void initialize_async_io_handler(void)
-{
- struct sigaction act;
-
- ZERO_STRUCT(act);
- act.sa_sigaction = signal_handler;
- act.sa_flags = SA_SIGINFO;
- sigemptyset( &act.sa_mask );
- if (sigaction(RT_SIGNAL_AIO, &act, NULL) != 0) {
- DEBUG(0,("Failed to setup RT_SIGNAL_AIO handler\n"));
- }
-
- /* the signal can start off blocked due to a bug in bash */
- BlockSignals(False, RT_SIGNAL_AIO);
-}
-