Back to index

glibc  2.9
Defines | Functions
tst-align.c File Reference
#include <pthread.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <tst-stack-align.h>
#include "../test-skeleton.c"

Go to the source code of this file.

Defines

#define TEST_FUNCTION   do_test ()

Functions

static void * tf (void *arg)
static int do_test (void)

Define Documentation

#define TEST_FUNCTION   do_test ()

Definition at line 70 of file tst-align.c.


Function Documentation

static int do_test ( void  ) [static]

Definition at line 40 of file tst-align.c.

{
  bool ok = true;

  puts ("in main");

  if (TEST_STACK_ALIGN ())
    ok = false;

  pthread_t th;
  if (pthread_create (&th, NULL, tf, NULL) != 0)
    {
      puts ("create failed");
      return 1;
    }

  void *res;
  if (pthread_join (th, &res) != 0)
    {
      puts ("join failed");
      return 1;
    }

  if (res != NULL)
    ok = false;

  return ok ? 0 : 1;
}

Here is the call graph for this function:

static void* tf ( void *  arg) [static]

Definition at line 27 of file tst-align.c.

{
  bool ok = true;

  puts ("in thread");

  if (TEST_STACK_ALIGN ())
    ok = false;

  return ok ? NULL : (void *) -1l;
}

Here is the call graph for this function: