#include #include #include #include #include #include #include "common/common.h" #include /* * Copyright (c) 2011 Luka Marčetić * * Redistribution and use in source and binary forms, with or without * modification, are permitted. * * There's ABSOLUTELY NO WARRANTY, express or implied. */ jmp_buf env; static void bridge_sig_jmp(int sig) { longjmp(env, sig); } int main() { union ret ret; int sig, err; unsigned int d, f, failed; char *call, *more; size_t i = 0; struct arguments *arg; struct sigaction oldact, act; struct { unsigned int ret:1, err:1, sig:1; } error, no_error; memset(&no_error, 0, sizeof(no_error)); act.sa_handler = bridge_sig_jmp; act.sa_flags = SA_NODEFER; struct test t[] = { { "realpath", 2, 1, (struct data[]) { {//data (struct arguments[]) {//arg {2, (char *[]) {".", "./123456789"}}, {1, (char *[]) {NULL}}, }, (char *[]){NULL}, ENAMETOOLONG, }, } }, }; failed = 0; for (f=0; f