summaryrefslogtreecommitdiff
path: root/vio/viopipe.c
diff options
context:
space:
mode:
Diffstat (limited to 'vio/viopipe.c')
-rw-r--r--vio/viopipe.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/vio/viopipe.c b/vio/viopipe.c
index 6db0944d8df..567884807fe 100644
--- a/vio/viopipe.c
+++ b/vio/viopipe.c
@@ -140,5 +140,11 @@ int vio_close_pipe(Vio *vio)
DBUG_RETURN(ret);
}
+/* return number of bytes readable from pipe.*/
+uint vio_pending_pipe(Vio *vio)
+{
+ DWORD bytes;
+ return PeekNamedPipe(vio->hPipe, NULL, 0, NULL, &bytes, NULL) ? bytes : 0;
+}
#endif