On Fr, 28.01.22 10:55, Demi Marie Obenour (demioben...@gmail.com) wrote:

> As an aside, can Linux and/or glibc please disallow passing a NULL
> argv[0]?  I would honestly be okay with glibc just crashing the process
> during startup if argv[0] is NULL or empty.

Yeah, it would be good if glibc start-up code would automatically
synthesize argv[0] in some way (maybe set it to the name PR_GET_NAME
returns or so) if argc == 0. And that this would then propagate into
program_invocation_name[] and program_invocation_short_name[] so that
all code can safely rely that once main() is invoked argc > 0, argv[0]
is non-NULL (and ideally even a non-empty string), and both
program_invocation{_short,}_name are set. There's just too much code
out there that relies on this, and I think it would be best if glibc
would just make it so that what people assume is guaranteed actually
becomes guaranteed.

Lennart

--
Lennart Poettering, Berlin
_______________________________________________
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure

Reply via email to