summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/testsuite/winsup.api/iospeed.c
diff options
context:
space:
mode:
authorcvs2svn <>2000-09-01 20:54:23 +0000
committercvs2svn <>2000-09-01 20:54:23 +0000
commitb430c53f7ee4a0e2d83f6dacb6d2f14feacdc591 (patch)
treeee6ddd86111b217ed61b6f66787e668df4fd8890 /winsup/cygwin/testsuite/winsup.api/iospeed.c
parent074f88429327b287c95d145e30fe0f940c357231 (diff)
downloadcygnal-b430c53f7ee4a0e2d83f6dacb6d2f14feacdc591.tar.gz
cygnal-b430c53f7ee4a0e2d83f6dacb6d2f14feacdc591.tar.bz2
cygnal-b430c53f7ee4a0e2d83f6dacb6d2f14feacdc591.zip
This commit was manufactured by cvs2svn to create tag 'pre-cygwin-heap'.pre-cygwin-heap
Sprout from cygwin-1-1-4 2000-07-28 22:33:44 UTC cvs2svn 'This commit was manufactured by cvs2svn to create branch 'cygwin-1-1-4'.' Cherrypick from master 2000-09-01 20:54:22 UTC Christopher Faylor <me@cgf.cx> '* sigproc.cc (proc_info): Rename proc_exists which takes a pid to "pid_exists".': winsup/cygwin/localtime.c winsup/cygwin/regexp/regerror.c winsup/cygwin/regexp/regexp.c winsup/cygwin/shared.h Delete: winsup/MAINTAINERS winsup/cygwin/testsuite/README winsup/cygwin/testsuite/config/default.exp winsup/cygwin/testsuite/winsup.api/crlf.c winsup/cygwin/testsuite/winsup.api/devzero.c winsup/cygwin/testsuite/winsup.api/iospeed.c winsup/cygwin/testsuite/winsup.api/samples/sample-pass.c winsup/cygwin/testsuite/winsup.api/samples/xf-sample-fail.c winsup/cygwin/testsuite/winsup.api/samples/xf-sample-miscompile.c winsup/cygwin/testsuite/winsup.api/winsup.exp winsup/doc/sites.texinfo winsup/mingw/dirent.c winsup/mingw/moldname-crtdll.def winsup/mingw/moldname-msvcrt.def winsup/mingw/moldname.def winsup/mingw/msvcrt.def winsup/mingw/msvcrt20.def winsup/mingw/msvcrt40.def winsup/mingw/profile/ChangeLog winsup/w32api/README winsup/w32api/include/excpt.h
Diffstat (limited to 'winsup/cygwin/testsuite/winsup.api/iospeed.c')
-rw-r--r--winsup/cygwin/testsuite/winsup.api/iospeed.c115
1 files changed, 0 insertions, 115 deletions
diff --git a/winsup/cygwin/testsuite/winsup.api/iospeed.c b/winsup/cygwin/testsuite/winsup.api/iospeed.c
deleted file mode 100644
index d286f90bd..000000000
--- a/winsup/cygwin/testsuite/winsup.api/iospeed.c
+++ /dev/null
@@ -1,115 +0,0 @@
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <stdarg.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <windows.h>
-
-int verbose = 0;
-
-void
-v(char *fmt, ...)
-{
- va_list ap;
- if (!verbose) return;
- va_start(ap, fmt);
- vfprintf(stdout, fmt, ap);
- va_end(ap);
-}
-
-#define TSIZE (1024 * 1024 * 16)
-
-unsigned long start_tic;
-
-void
-start(FILE *f)
-{
- fseek(f, 0, SEEK_SET);
- start_tic = GetTickCount();
-}
-
-void
-end()
-{
- unsigned long end_tic = GetTickCount();
- printf("%6d", end_tic - start_tic);
-}
-
-void
-test(int linesz, int cr)
-{
- FILE *f = fopen("iospeed.dat", "wb");
- char buf[65536];
- int i, fd;
-
- memset(buf, 'x', linesz);
- buf[linesz-1] = '\n';
- if (cr)
- buf[linesz-2] = '\r';
- for (i=0; i<TSIZE; i += linesz)
- fwrite(buf, 1, linesz, f);
- fclose(f);
-
- f = fopen("iospeed.dat", "rt");
- fd = fileno(f);
-
- printf("%6d%6d", linesz, cr);
- for (i=0; i<TSIZE; i+= 65536)
- read(fd, buf, 65536);
-
- start(f);
- while (getc(f) != EOF);
- end();
-
- start(f);
- while (fread(buf, 1, 256, f) > 0);
- end();
-
- start(f);
- while (fgets(buf, 64436, f));
- end();
-
- f = fopen("iospeed.dat", "rb");
- fd = fileno(f);
-
- for (i=0; i<TSIZE; i+= 65536)
- read(fd, buf, 65536);
-
- start(f);
- while (getc(f) != EOF);
- end();
-
- start(f);
- while (fread(buf, 1, 256, f) > 0);
- end();
-
- start(f);
- while (fgets(buf, 64436, f));
- end();
-
- printf("\n");
-}
-
-int
-main(int argc, char **argv)
-{
- if (argc > 1 && strcmp(argv[1],"-v") == 0)
- verbose = 1;
-
- setbuf(stdout, 0);
-
- printf(" ----- text ----- ---- binary ----\n");
- printf("linesz cr getc fread fgets getc fread fgets\n");
-
- test(4, 0);
- test(64, 0);
- test(4096, 0);
- test(4, 1);
- test(64, 1);
- test(4096, 1);
-
- remove ("iospeed.dat");
-
- return 0;
-}