#define _XOPEN_SOURCE 700 #include #include #include #include int main(int argc, char *argv[]) { int increment = 0; int c; while ((c = getopt(argc, argv, "n:")) != -1) { switch (c) { case 'n': increment = atoi(optarg); break; default: return 1; } } argv += optind; errno = 0; if (nice(increment) == -1 && errno != 0) { perror("nice"); } execvp(argv[0], argv); perror("nice"); return errno == ENOENT ? 127 : 126; }