summary refs log tree commit diff
path: root/compat/getprogname_linux.c
blob: 1850e8666b1f84c0ef0e6738ef689ae14d2738d6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <stdlib.h>

#include <errno.h>

const char *
getprogname(void)
{
#if defined(__ANDROID_API__) && __ANDROID_API__ < 21
	/*
	 * Android added getprogname with API 21, so we should not end up here
	 * with APIs newer than 21.
	 * https://github.com/aosp-mirror/platform_bionic/blob/1eb6d3/libc/include/stdlib.h#L160
	 *
	 * Since Android is using portions of OpenBSD libc, it should have
	 * a symbol called __progname.
	 * https://github.com/aosp-mirror/platform_bionic/commit/692207
	 */
	extern const char *__progname;
	return __progname;
#else
	return program_invocation_short_name;
#endif
}
cEnroe 2021-04-26Update to FreeBSD 13.0June McEnroe 2021-01-27Completely rewrite how manuals are fetched and installedJune McEnroe 2020-12-14Update to man-pages-posix 2017-aJune McEnroe 2020-12-14Update to OpenBSD 6.8June McEnroe 2020-12-14Update to NetBSD 9.1June McEnroe 2020-12-14Update to man-pages 5.09June McEnroe 2020-12-14Update to FreeBSD 12.2June McEnroe 2020-06-08Update to OpenBSD 6.7June McEnroe 2020-05-04Add hack for macOS to search extra man sectionsJune McEnroe 2020-05-04Don't clear MANSECTJune McEnroe