depot/third_party/nixpkgs/pkgs/test/make-binary-wrapper/chdir.c
Default email 3cbfd2b52c Project import generated by Copybara.
GitOrigin-RevId: 395879c28386e1abf20c7ecacd45880759548391
2021-12-18 20:06:50 -05:00

11 lines
292 B
C

#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#define assert_success(e) do { if ((e) < 0) { perror(#e); abort(); } } while (0)
int main(int argc, char **argv) {
assert_success(chdir("./tmp/foo"));
argv[0] = "/send/me/flags";
return execv("/send/me/flags", argv);
}