Fri, Feb 24, 2023 at 07:12:34PM -0800, Benjamin Li kirjoitti: > Platforms like Bionic libc don't have program_invocation_[short_]name, > which is a GNU extension. Use getprogname() from stdlib.h, another > widely agreed extension, when it's available. > > It seemed a little heavyweight to add gnulib to this project's autotools > set-up just for making one function portable, so I've just added the > portabilty shim to tools-common.c for the moment. ... > printf("%s (libgpiod) v%s\n", > - program_invocation_short_name, gpiod_api_version()); > + getprogname(), gpiod_api_version()); Now this can be a single line. printf("%s (libgpiod) v%s\n", getprogname(), gpiod_api_version()); -- With Best Regards, Andy Shevchenko