/* * thud.c -- start a program with the thud.so library preloaded. * * Copyright (C) 2004 David Collier-Brown * * This program is free software; you can redistribute it and/or modify * it under the terms of your choice of the GNU Lesser (Library) General * Public License or the Sun Common Development and Distribution License. */ #include #include #include #include #include #include /* For wait(). */ #include /* For sigation. */ #include /* For sigaction(). */ #include /* For errno. */ #include /* For strerro(). */ #include #include "thud.h" /* Just debugging code. */ #define MAXLINE 1024 static char *ProgName = "thud"; static pid_t Child; static int AllSignals = 0; int main(int argc, char *argv[]) { pid_t rc; int i, j, childRc; struct stat buf; char putenvLine[MAXLINE]; if (argc < 2) { (void) fprintf(stderr, "%s: you must supply a " "full path to a command to be checked.\n", ProgName); (void) fprintf(stderr, "Usage: %s program args ...\n", argv[0]); (void) exit(1); } for (i=1; i