extract_argv0_path
extern const char *extract_argv0_path(const char *path);
cmd = extract_argv0_path(argv[0]);