x86-64: Fix the dtv field load for x32 [BZ #31184]
[glibc.git] / libio / tst-setvbuf1.c
blob44ae15815a4f037610fa7583bad6d2298ab2eb26
1 /* Derived from the test case in BZ #2337. */
2 #include <errno.h>
3 #include <error.h>
4 #include <fcntl.h>
5 #include <locale.h>
6 #include <stdio.h>
7 #include <stdlib.h>
8 #include <string.h>
9 #include <unistd.h>
10 #include <wchar.h>
13 static char buf[512] __attribute__ ((aligned (4096)));
16 static int
17 do_test (void)
19 setlocale (LC_ALL, "de_DE.UTF-8");
21 FILE *fp = fdopen (dup (STDOUT_FILENO), "a");
22 if (fp == NULL)
23 error (EXIT_FAILURE, errno, "fdopen(,\"a\")");
25 setvbuf (fp, buf, _IOFBF, sizeof (buf));
27 /* fwprintf to unbuffered stream. */
28 fwprintf (fp, L"hello.\n");
30 fclose (fp);
32 /* touch my buffer */
33 buf[45] = 'a';
35 return 0;
38 #define TEST_FUNCTION do_test ()
39 #include "../test-skeleton.c"