summaryrefslogtreecommitdiff
path: root/libc/tests/rand.c
diff options
context:
space:
mode:
Diffstat (limited to 'libc/tests/rand.c')
-rw-r--r--libc/tests/rand.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/libc/tests/rand.c b/libc/tests/rand.c
new file mode 100644
index 0000000..c4fc6d2
--- /dev/null
+++ b/libc/tests/rand.c
@@ -0,0 +1,16 @@
+#include <stdio.h>
+
+FILE * popen();
+
+main()
+{
+ FILE * fd = popen("./hd", "w");
+ int ch;
+
+ srand(time((void*)0));
+
+ for(ch=0; ch<256; ch++)
+ putc(rand(), fd);
+
+ pclose(fd);
+}