3 ms·
I don't think so either. It's something in the implementation of `execv` I think. #include <unistd.h>
by Tyr42 10y ago
I don't think so either. It's something in the implementation of `execv` I think.
#include <unistd.h>
int main() {
execl("cat-quine", "cat-quine", NULL);
return 0;
}
Is sufficient to have this work.
- khc 10y agoAn entire generation of programmer has grown up not knowing that this is implemented in the kernel.
- cyphar 10y agoI remember being surprised by this and then realising, "wait, of course it's in the kernel -- that's so much nicer from a usability and sanity standpoint".
- cyphar 10y agoIt's implemented in the kernel. Look at fs/binfmt_script.c in the Linux kernel source tree for an example.
- geon 10y agoSomeone linked to it on reddit: https://www.reddit.com/r/programming/comments/4k7gvh/shebang_quine/d3csbiu https://www.reddit.com/r/programming/comments/4k7gvh/shebang...