]> git.lizzy.rs Git - plan9front.git/blob - sys/src/cmd/aux/write.c
exec(2): fix prototypes
[plan9front.git] / sys / src / cmd / aux / write.c
1 #include <u.h>
2 #include <libc.h>
3
4 static char x[1024];
5 static char s[64] = "  ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
6
7 static void
8 fill(void)
9 {
10         int i;
11
12         for(i = 0; i < sizeof(x); i += sizeof(s)){
13                 memmove(&x[i], s, sizeof(s));
14                 x[i] = i>>8;
15                 x[i+1] = i;
16         }
17 }
18
19 void
20 main(int argc, char *argv[])
21 {
22         int i = 2560;
23
24         if(argc > 1){
25                 argc--; argv++;
26                 i = atoi(*argv);
27         }
28         USED(argc);
29
30         fill();
31
32         while(i--)
33                 write(1, x, sizeof(x));
34         exits(0);
35 }