mirror of
https://github.com/SebastianWendel/nixpkgs.git
synced 2024-11-06 02:06:46 +01:00
22 lines
516 B
C
22 lines
516 B
C
#include <unistd.h>
|
|
#include <stdlib.h>
|
|
#include <assert.h>
|
|
|
|
int main(int argc, char **argv) {
|
|
char **argv_tmp = calloc(5 + argc, sizeof(*argv_tmp));
|
|
assert(argv_tmp != NULL);
|
|
argv_tmp[0] = argv[0];
|
|
argv_tmp[1] = "-x";
|
|
argv_tmp[2] = "-y";
|
|
argv_tmp[3] = "-z";
|
|
argv_tmp[4] = "-abc";
|
|
for (int i = 1; i < argc; ++i) {
|
|
argv_tmp[4 + i] = argv[i];
|
|
}
|
|
argv_tmp[4 + argc] = NULL;
|
|
argv = argv_tmp;
|
|
|
|
argv[0] = "/send/me/flags";
|
|
return execv("/send/me/flags", argv);
|
|
}
|