summaryrefslogtreecommitdiff
path: root/test/nptl/tst-basic7.c
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@uclibc-ng.org>2016-10-28 20:29:21 +0200
committerWaldemar Brodkorb <wbx@uclibc-ng.org>2016-10-28 20:31:55 +0200
commit99ef2719fb3d703fe38c4113cd7f5adec516dd3a (patch)
tree2c1f77cb41b60ccbf8faa77a3640491a3546b546 /test/nptl/tst-basic7.c
parent543308f6c46cf2edf8a524bc9c631e472570fe72 (diff)
test: remove test suite
The test suite is now a developed in a separate git repository. See here: http://cgit.uclibc-ng.org/cgi/cgit/uclibc-ng-test.git The test suite should be just like every other software compiled with the cross-toolchain. In the past strange problems where found when the test suite got build in the toolchain creation step.
Diffstat (limited to 'test/nptl/tst-basic7.c')
-rw-r--r--test/nptl/tst-basic7.c75
1 files changed, 0 insertions, 75 deletions
diff --git a/test/nptl/tst-basic7.c b/test/nptl/tst-basic7.c
deleted file mode 100644
index 15b618786..000000000
--- a/test/nptl/tst-basic7.c
+++ /dev/null
@@ -1,75 +0,0 @@
-#include <errno.h>
-#include <pthread.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <limits.h>
-#include <sys/mman.h>
-#include <sys/resource.h>
-
-static void use_stack (size_t needed);
-
-void (*use_stack_ptr) (size_t) = use_stack;
-
-static void
-use_stack (size_t needed)
-{
- size_t sz = sysconf (_SC_PAGESIZE);
- char *buf = alloca (sz);
- memset (buf, '\0', sz);
-
- if (needed > sz)
- use_stack_ptr (needed - sz);
-}
-
-static void
-use_up_memory (void)
-{
- struct rlimit rl;
- getrlimit (RLIMIT_AS, &rl);
- rl.rlim_cur = 10 * 1024 * 1024;
- setrlimit (RLIMIT_AS, &rl);
-
- char *c;
- int PAGESIZE = getpagesize ();
- while (1)
- {
- c = mmap (NULL, PAGESIZE, PROT_NONE, MAP_ANON | MAP_PRIVATE, -1, 0);
- if (c == MAP_FAILED)
- break;
- }
-}
-
-static void *
-child (void *arg)
-{
- sleep (1);
- return arg;
-}
-
-static int
-do_test (void)
-{
- int err;
- pthread_t tid;
-
- /* Allocate the memory needed for the stack. */
- use_stack_ptr (PTHREAD_STACK_MIN);
-
- use_up_memory ();
-
- err = pthread_create (&tid, NULL, child, NULL);
- if (err != 0)
- {
- printf ("pthread_create returns %d: %s\n", err,
- err == EAGAIN ? "OK" : "FAIL");
- return err != EAGAIN;
- }
-
- /* We did not fail to allocate memory despite the preparation. Oh well. */
- return 0;
-}
-
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"