]> git.ipfire.org Git - thirdparty/glibc.git/blame - stdio-common/bug4.c
Use “copy "es_BO"” in LC_TIME of es_CU, es_CL, and es_EC
[thirdparty/glibc.git] / stdio-common / bug4.c
CommitLineData
28f540f4
RM
1#include <stdio.h>
2#include <unistd.h>
3#include <string.h>
4
5int stdio_block_read = 1, stdio_block_write = 1;
6
7int
1f07e617 8main (int argc, char *argv[])
28f540f4
RM
9{
10 FILE *f;
11 int i;
12 char buffer[31];
1f07e617 13 const char filename[] = "/tmp/bug4.test";
28f540f4 14
1ef32c3d 15 while ((i = getopt (argc, argv, "rw")) != -1)
28f540f4
RM
16 switch (i)
17 {
18 case 'r':
19 stdio_block_read = 0;
20 break;
21 case 'w':
22 stdio_block_write = 0;
23 break;
24 }
25
1f07e617
UD
26 f = fopen (filename, "w+");
27 for (i = 0; i < 9000; ++i)
28f540f4 28 putc('x', f);
1f07e617
UD
29
30 fseek (f, 8180L, 0);
31 fwrite ("Where does this text come from?", 1, 31, f);
32 fseek (f, 8180L, 0);
33 fread (buffer, 1, 31, f);
34 fwrite (buffer, 1, 31, stdout);
35 fclose (f);
36 remove (filename);
28f540f4
RM
37
38 if (!memcmp (buffer, "Where does this text come from?", 31))
39 {
40 puts ("\nTest succeeded.");
41 return 0;
42 }
43 else
44 {
45 puts ("\nTest FAILED!");
46 return 1;
47 }
48}