https://issues.dlang.org/show_bug.cgi?id=21656
--- Comment #7 from Vladimir Panteleev <dlang-bugzi...@thecybershadow.net> --- (In reply to Jacob Carlborg from comment #6) > A file descriptor to the executable also seems to be available in the > auxiliary vector on Linux [1]. This can be accessed with the function > `getauxval` or directly after the `envp` parameter in the C main function. I > see references to the auxiliary vector in *BSD systems as well. Might be > worth checking out. Interesting, though as far as I can see, that file descriptor is only available to interpreters, and is no longer there at the time that the interpreted program has begun execution. Otherwise, it would take up a file descriptor slot, and thus would be a very noticeable fourth addition to the standard stdin/stdout/stderr streams. So it doesn't look like we can use this unfortunately. --