summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2008-02-24 11:39:57 +0100
committerVolker Lendecke <vl@samba.org>2008-02-24 11:39:57 +0100
commit21b6a036780ae0c020e199043c25c63fbbf8fa95 (patch)
treedd4ba5ef4427156a1fa0b387be508fe2cdb57221 /source3
parent658b72916f176190b78586073e922ffabf6704b5 (diff)
downloadsamba-21b6a036780ae0c020e199043c25c63fbbf8fa95.tar.gz
samba-21b6a036780ae0c020e199043c25c63fbbf8fa95.tar.bz2
samba-21b6a036780ae0c020e199043c25c63fbbf8fa95.zip
Export aio_request_done()
This is for external modules implementing the Posix AIO API that not necessarily depend on the signal mechanism to indicate completion. (This used to be commit 9a069d306bb6f8a2cd51b8ba87b433884942d13f)
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/aio.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/source3/smbd/aio.c b/source3/smbd/aio.c
index 59dd9a9568..78189d32f7 100644
--- a/source3/smbd/aio.c
+++ b/source3/smbd/aio.c
@@ -150,12 +150,18 @@ 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)
+void aio_request_done(uint16_t mid)
{
if (signals_received < AIO_PENDING_SIZE) {
- aio_pending_array[signals_received] = info->si_value.sival_int;
+ aio_pending_array[signals_received] = mid;
signals_received++;
- } /* Else signal is lost. */
+ }
+ /* Else signal is lost. */
+}
+
+static void signal_handler(int sig, siginfo_t *info, void *unused)
+{
+ aio_request_done(info->si_value.sival_int);
sys_select_signal(RT_SIGNAL_AIO);
}