Back to index

glibc  2.9
Defines | Functions
tst-setvbuf1.c File Reference
#include <errno.h>
#include <error.h>
#include <fcntl.h>
#include <locale.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <wchar.h>
#include "../test-skeleton.c"

Go to the source code of this file.


#define TEST_FUNCTION   do_test ()


static char buf[512] __attribute__ ((aligned(4096)))
static int do_test (void)

Define Documentation

#define TEST_FUNCTION   do_test ()

Definition at line 38 of file tst-setvbuf1.c.

Function Documentation

static char buf [512] __attribute__ ( (aligned(4096))  ) [static]
static int do_test ( void  ) [static]

Definition at line 17 of file tst-setvbuf1.c.

  setlocale (LC_ALL, "de_DE.UTF-8");

  FILE *fp = fdopen (dup (STDOUT_FILENO), "a");
  if (fp == NULL)
    error (EXIT_FAILURE, errno, "fdopen(,\"a\")");

  setvbuf (fp, buf, _IOFBF, sizeof (buf));

  /* fwprintf to unbuffered stream.   */
  fwprintf (fp, L"hello.\n");

  fclose (fp);

  /* touch my buffer */
  buf[45] = 'a';

  return 0;

Here is the call graph for this function: