Back to index

glibc  2.9
Defines | Functions | Variables
tst-mmap2-eofsync.c File Reference
#include <stdio.h>
#include <error.h>
#include <errno.h>
#include <string.h>
#include <unistd.h>
#include <test-skeleton.c>

Go to the source code of this file.


#define PREPARE(argc, argv)   do_prepare ()
#define TEST_FUNCTION   do_test ()


static void do_prepare (void)
static int do_test (void)


static char * temp_file
static int temp_fd
static char * pages

Define Documentation

#define PREPARE (   argc,
)    do_prepare ()

Definition at line 10 of file tst-mmap2-eofsync.c.

#define TEST_FUNCTION   do_test ()

Definition at line 12 of file tst-mmap2-eofsync.c.

Function Documentation

static void do_prepare ( void  ) [static]

Definition at line 21 of file tst-mmap2-eofsync.c.

  pages = malloc (getpagesize () * 2);
  memset (pages, 'a', getpagesize ());
  memset (pages + getpagesize (), 'b', getpagesize ());

  temp_fd = create_temp_file ("tst-mmap2-eofsync.", &temp_file);
  if (temp_fd == -1)
    error (1, errno, "cannot create temporary file");
      ssize_t cc = write (temp_fd, pages, getpagesize ());
      if (cc != getpagesize ())
       error (1, errno, "cannot write to temporary file");

Here is the call graph for this function:

static int do_test ( void  ) [static]

Variable Documentation

char* pages [static]

Definition at line 18 of file tst-mmap2-eofsync.c.

int temp_fd [static]

Definition at line 16 of file tst-mmap2-eofsync.c.

char* temp_file [static]

Definition at line 15 of file tst-mmap2-eofsync.c.