From 99ef2719fb3d703fe38c4113cd7f5adec516dd3a Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Fri, 28 Oct 2016 20:29:21 +0200 Subject: 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. --- test/setjmp/tst-vfork-longjmp.c | 108 ---------------------------------------- 1 file changed, 108 deletions(-) delete mode 100644 test/setjmp/tst-vfork-longjmp.c (limited to 'test/setjmp/tst-vfork-longjmp.c') diff --git a/test/setjmp/tst-vfork-longjmp.c b/test/setjmp/tst-vfork-longjmp.c deleted file mode 100644 index 278442472..000000000 --- a/test/setjmp/tst-vfork-longjmp.c +++ /dev/null @@ -1,108 +0,0 @@ -/* make sure we can vfork/exec across setjmp/longjmp's - * and make sure signal block masks don't get corrupted - * in the process. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -int verbose = 0; - -static int execute_child(const char *prog) -{ - int status; - pid_t child; - child = vfork(); - if (child == 0) { - execlp(prog, prog, NULL); - perror("Could not execute specified prog"); - _exit(1); - } else if (child == 1) - return 1; - wait(&status); - return WEXITSTATUS(status); -} - -sigset_t orig_mask; - -static int check_sig_mask(void) -{ - int status; - pid_t child; - - child = vfork(); - if (child == 0) { - int ret; - sigset_t child_mask; - memset(&child_mask, 0x00, sizeof(child_mask)); - ret = sigprocmask(SIG_BLOCK, NULL, &child_mask); - if (ret != 0) { - perror("could not get child sig block mask"); - _exit(1); - } - ret = memcmp(&orig_mask, &child_mask, sizeof(orig_mask)); - if (verbose) { - printf("sigmsk: %08lx%08lx ", child_mask.__val[1], child_mask.__val[0]); - printf("sigmsk: %08lx%08lx ", orig_mask.__val[1], orig_mask.__val[0]); - printf("%i\n", ret); - } - _exit(ret); - } else if (child == 1) - return 1; - wait(&status); - return WEXITSTATUS(status); -} - -int main(int argc, char *argv[]) -{ - const char *prog; - jmp_buf env; - sigjmp_buf sigenv; - int max; - /* values modified between setjmp/longjmp cannot be local to this func */ - static int cnt, ret; - - memset(&orig_mask, 0x00, sizeof(orig_mask)); - ret = sigprocmask(SIG_BLOCK, NULL, &orig_mask); - if (ret != 0) { - perror("could not get orig sig block mask"); - return 1; - } - - prog = (argc > 1 ? argv[1] : "true"); - ret = 0; - verbose = 0; - max = 10; - - /* test vfork()/exec() inside of sigsetjmp/siglongjmp */ - cnt = 0; - sigsetjmp(sigenv, 1); - ++cnt; - if (verbose) - printf("sigsetjmp loop %i\n", cnt); - ret |= check_sig_mask(); - ret |= execute_child(prog); - if (cnt < max) - siglongjmp(sigenv, 0); - - /* test vfork()/sigprocmask() inside of setjmp/longjmp */ - cnt = 0; - setjmp(env); - ++cnt; - if (verbose) - printf("setjmp loop %i\n", cnt); - ret |= check_sig_mask(); - ret |= execute_child(prog); - if (cnt < max) - longjmp(env, 0); - - return ret; -} -- cgit v1.2.3