Hacker News new | ask | show | jobs
by ifoundthetao 2457 days ago
Would you be willing to share how you did that (avoiding procfs too)?
1 comments

Instead of

    snprintf(pathbuf, sizeof(pathbuf), "/proc/self/fd/%u", fd);
    execve(pathbuf, argv, envp);
you do

    execveat(fd, "", argv, envp, AT_EMPTY_PATH);
and that's it.
Thanks!!