about summary refs log tree commit diff
path: root/nixpkgs/pkgs/test/make-binary-wrapper/chdir.c
blob: 9e0b7e2c7f52af3844d54c14be556f9323c5d1ee (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
#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);
}