Index: tests/process/child/child.c
===================================================================
--- tests/process/child/child.c	(revision 907)
+++ tests/process/child/child.c	(revision 907)
@@ -0,0 +1,57 @@
+#include <stdio.h>
+#include <stdlib.h>
+
+
+int main(int argc, char *argv[])
+{
+    int         n;
+    FILE        *fp;
+    char        buffer[4096];
+
+    if( argc > 2 )
+    {
+        switch( atoi( argv[1] ) )
+        {
+        case 0:
+            if( (fp = fopen(argv[2], "wb" )) != NULL )
+            {
+                while( (n = fread(buffer, 1, sizeof(buffer), stdin)) > 0 )
+                {
+                    fwrite(buffer, 1, n, fp);
+                }
+
+                fclose( fp );
+            }
+
+            return 0;
+
+        case 1:
+            if( (fp = fopen(argv[2], "rb" )) != NULL )
+            {
+                while( (n = fread(buffer, 1, sizeof(buffer), fp)) > 0 )
+                {
+                    fwrite(buffer, 1, n, stdout);
+                }
+
+                fclose( fp );
+            }
+
+            return 0;
+
+        case 2:
+            if( (fp = fopen(argv[2], "rb" )) != NULL )
+            {
+                while( (n = fread(buffer, 1, sizeof(buffer), fp)) > 0 )
+                {
+                    fwrite(buffer, 1, n, stderr);
+                }
+
+                fclose( fp );
+            }
+
+            return 0;
+        }
+    }
+
+    return -1;
+}
Index: tests/process/child/child.pro
===================================================================
--- tests/process/child/child.pro	(revision 907)
+++ tests/process/child/child.pro	(revision 907)
@@ -0,0 +1,8 @@
+DEPTH = ../..
+include($$DEPTH/common.pri)
+
+DESTDIR = $$OUT_PWD/..
+
+QT = 
+
+SOURCES = child.c
Index: tests/process/mkbigfile.cmd
===================================================================
--- tests/process/mkbigfile.cmd	(revision 907)
+++ tests/process/mkbigfile.cmd	(revision 907)
@@ -0,0 +1,15 @@
+/**/
+parse arg size in out
+if size == '' | in == '' | out == '' then do
+  say 'Usage: mkbigfile.cmd <size> <in_file> <out_file>'
+  exit
+end
+len = 512
+data = charin(in, 1, len)
+if length(data) < len then len = length(data)
+'@del' out '1>nul 2>nul'
+do i = 1 to size % len
+  call charout out, data
+end
+call charout out, left(data, size // len)
+call charout out
Index: tests/process/process-async/process-async.pro
===================================================================
--- tests/process/process-async/process-async.pro	(revision 904)
+++ tests/process/process-async/process-async.pro	(revision 907)
@@ -1,4 +1,6 @@
 DEPTH = ../..
 include($$DEPTH/common.pri)
+
+DESTDIR = $$OUT_PWD/..
 
 QT = core gui
Index: tests/process/process-sync/process-sync.cpp
===================================================================
--- tests/process/process-sync/process-sync.cpp	(revision 907)
+++ tests/process/process-sync/process-sync.cpp	(revision 907)
@@ -0,0 +1,160 @@
+/*
+ *
+ * Demostrates failure when piping a large ( +100KB ) file to a child process
+ *
+ */
+
+#include <QDebug>
+#include <QFile>
+#include <QProcess>
+
+int test_write(const QString &aFile)
+{
+    printf ("test_write: Write '%s' to child's stdin that will write "
+            "it to '%s.out'\n", aFile.toLocal8Bit().constData(),
+            aFile.toLocal8Bit().constData());
+
+    QProcess p;
+
+    QFile f (aFile);
+    if (f.open (QIODevice::ReadOnly))
+    {
+        QString aOutFile = aFile + ".out";
+
+        p.start ("child",
+                 QStringList() << "0" << aOutFile,
+                 QIODevice::WriteOnly);
+
+        if (p.waitForStarted())
+        {
+            while (!f.atEnd())
+            {
+                //QByteArray ba = f.read (2048);
+                QByteArray ba = f.read (32768);
+
+                p.write (ba);
+
+                p.waitForBytesWritten (-1);
+            }
+
+            //p.close();
+            p.closeWriteChannel();
+
+            p.waitForFinished();
+            printf ("Process finished with %d (%d)\n",
+                    p.exitCode(), p.exitStatus());
+        }
+        else
+            printf ("waitForStarted() failed\n");
+
+        f.close();
+    }
+    else
+        printf ("Can't open output file %s\n",
+                aFile.toLatin1().constData());
+
+    return 0;
+}
+
+int test_read(const QString &aFile)
+{
+    printf ("test_read: Read '%s' from child's stdout " 
+            "and write it to '%s.out'\n", aFile.toLocal8Bit().constData(),
+            aFile.toLocal8Bit().constData());
+
+    QString aOutFile = aFile + ".out";
+    QProcess p;
+    QFile f (aOutFile);
+
+    if (f.open (QIODevice::WriteOnly))
+    {
+        p.start ("child",
+                 QStringList() << "1" << aFile,
+                 QIODevice::ReadOnly);
+
+        if (p.waitForStarted())
+        {
+            while (p.waitForReadyRead())
+            {
+                QByteArray ba = p.read (p.bytesAvailable());
+
+                f.write (ba);
+            }
+
+            p.waitForFinished();
+            printf ("Process finished with %d (%d)\n",
+                    p.exitCode(), p.exitStatus());
+        }
+        else
+            printf ("waitForStarted() failed\n");
+
+        f.close();
+    }
+    else
+        printf ("Can't open output file %s\n",
+                aOutFile.toLatin1().constData());
+
+    return 0;
+}
+
+int test_sleep()
+{
+    QProcess p;
+
+    p.start ("cmd",
+             QStringList() << "/c" << "sleep.cmd");
+
+    if (p.waitForStarted())
+    {
+        p.waitForFinished();
+        printf ("Process finished with %d (%d)\n",
+                p.exitCode(), p.exitStatus());
+    }
+    else
+        printf ("waitForStarted() failed\n");
+
+    return 0;
+}
+
+int test_hang()
+{
+    QProcess p;
+
+    p.start ("cmd",
+             QStringList() << "/c" << "pause");
+
+    if (p.waitForStarted())
+    {
+        p.waitForFinished();
+        printf ("Process finished with %d (%d)\n",
+                p.exitCode(), p.exitStatus());
+    }
+    else
+        printf ("waitForStarted() failed\n");
+
+    return 0;
+}
+
+int main( int argc, char *argv[] )
+{
+    if (argc == 3)
+    {
+    	if (qstrcmp (argv [1], "read") == 0)
+    		return test_read (QLatin1String (argv [2]));
+    	if (qstrcmp (argv [1], "write") == 0)
+    		return test_write(QLatin1String (argv [2]));
+	}
+	else
+    if (argc == 2)
+    {
+    	if (qstrcmp (argv [1], "sleep") == 0)
+    		return test_sleep();
+    	if (qstrcmp (argv [1], "hang") == 0)
+    		return test_hang();
+    }
+
+    printf ("Usage: testcase read|write <filename>\n"
+            "       testcase sleep|hang\n");
+
+    return 0;
+}
Index: tests/process/process-sync/process-sync.pro
===================================================================
--- tests/process/process-sync/process-sync.pro	(revision 907)
+++ tests/process/process-sync/process-sync.pro	(revision 907)
@@ -0,0 +1,17 @@
+DEPTH = ../..
+include($$DEPTH/common.pri)
+
+DESTDIR = $$OUT_PWD/..
+
+QT = core
+
+SOURCES = process-sync.cpp
+
+bigfile.target = $$DESTDIR/bigfile.txt
+os2:bigfile.commands = $$PWD/../mkbigfile.cmd 1500000 $$PWD/process-sync.cpp $${bigfile.target}
+
+sleep.target = $$DESTDIR/sleep.cmd
+os2:sleep.commands = $(COPY_FILE) $$fixSep($$PWD/../sleep.cmd) $$fixSep($${sleep.target})
+
+QMAKE_EXTRA_TARGETS += bigfile sleep
+POST_TARGETDEPS = $${bigfile.target} $${sleep.target}
Index: tests/process/process.pro
===================================================================
--- tests/process/process.pro	(revision 904)
+++ tests/process/process.pro	(revision 907)
@@ -1,2 +1,2 @@
 TEMPLATE = subdirs
-SUBDIRS = process-async test
+SUBDIRS = process-async test process-sync child
Index: tests/process/sleep.cmd
===================================================================
--- tests/process/sleep.cmd	(revision 907)
+++ tests/process/sleep.cmd	(revision 907)
@@ -0,0 +1,2 @@
+/**/
+call SysSleep 3
Index: tests/process/test/test.pro
===================================================================
--- tests/process/test/test.pro	(revision 904)
+++ tests/process/test/test.pro	(revision 907)
@@ -1,4 +1,6 @@
 DEPTH = ../..
 include($$DEPTH/common.pri)
+
+DESTDIR = $$OUT_PWD/..
 
 QT = 
