1 /* Test for bug in fflush synchronization behavior. */
7 #include <support/xstdlib.h>
11 static void prepare (void);
12 #define PREPARE(argc, argv) prepare ()
15 #define TEST_FUNCTION do_test ()
16 static int do_test (void);
17 #include "../test-skeleton.c"
23 int fd
= create_temp_file ("bug-mmap-fflush.", &fname
);
26 /* We don't need the descriptor. */
38 snprintf (buffer
, sizeof (buffer
), "echo 'From foo@bar.com' > %s", fname
);
41 f
= fopen (fname
, "r");
42 fseek (f
, 0, SEEK_END
);
44 fseek (f
, 0, SEEK_SET
);
46 snprintf (buffer
, sizeof (buffer
), "echo 'From bar@baz.edu' >> %s", fname
);
49 fseek (f
, o
, SEEK_SET
);
50 if (fgets (buffer
, 1024, f
) == NULL
)
52 if (strncmp (buffer
, "From ", 5) != 0)